Skip to content

Commit bfee3fc

Browse files
committed
Remove unused stream profile control path
1 parent 76c858a commit bfee3fc

3 files changed

Lines changed: 5 additions & 59 deletions

File tree

client/src/features/stream/streamWorkerClient.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export function sendWebRtcClientStats(stats: unknown): boolean {
3939

4040
export function sendWebRtcStreamControl(options: {
4141
forceKeyframe?: boolean;
42-
fps?: number;
43-
profile?: "focus" | "full" | "paused" | "thumb" | "thumbnail";
4442
snapshot?: boolean;
4543
}): boolean {
4644
return sendDataChannelMessage(
@@ -1340,12 +1338,7 @@ export class StreamWorkerClient {
13401338
return (await this.backend?.collectVisualArtifactSample?.(udid)) ?? null;
13411339
}
13421340

1343-
sendStreamControl(options: {
1344-
forceKeyframe?: boolean;
1345-
fps?: number;
1346-
profile?: "focus" | "full" | "paused" | "thumb" | "thumbnail";
1347-
snapshot?: boolean;
1348-
}) {
1341+
sendStreamControl(options: { forceKeyframe?: boolean; snapshot?: boolean }) {
13491342
return Boolean(
13501343
this.backend?.sendControl?.({ ...options, type: "streamControl" }),
13511344
);

client/src/features/stream/useLiveStream.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ interface UseLiveStreamOptions {
3333
remote?: boolean;
3434
simulator: SimulatorMetadata | null;
3535
streamConfig?: StreamConfig;
36-
streamProfile?: "focus" | "full" | "paused" | "thumb" | "thumbnail";
3736
}
3837

3938
interface UseLiveStreamResult {
@@ -94,7 +93,6 @@ export function useLiveStream({
9493
remote = false,
9594
simulator,
9695
streamConfig,
97-
streamProfile = "focus",
9896
}: UseLiveStreamOptions): UseLiveStreamResult {
9997
const clientTelemetryIdRef = useRef("");
10098
const workerClientRef = useRef<StreamWorkerClient | null>(null);
@@ -298,30 +296,6 @@ export function useLiveStream({
298296
streamConfig?.quality,
299297
]);
300298

301-
useEffect(() => {
302-
if (paused || !simulator?.isBooted) {
303-
return;
304-
}
305-
let attempts = 0;
306-
const send = () => {
307-
attempts += 1;
308-
return Boolean(
309-
workerClientRef.current?.sendStreamControl({
310-
profile: streamProfile,
311-
}),
312-
);
313-
};
314-
if (send()) {
315-
return;
316-
}
317-
const interval = window.setInterval(() => {
318-
if (send() || attempts >= 8) {
319-
window.clearInterval(interval);
320-
}
321-
}, 250);
322-
return () => window.clearInterval(interval);
323-
}, [paused, simulator?.isBooted, simulator?.udid, streamProfile]);
324-
325299
useEffect(() => {
326300
if (!simulator?.udid) {
327301
return;

server/src/transport/webrtc.rs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -409,17 +409,13 @@ fn attach_control_data_channel(
409409
}
410410
}
411411
WebRtcDataChannelMessage::StreamControl {
412-
fps,
413412
force_keyframe,
414-
profile,
415413
snapshot,
416414
} => {
417-
let command = WebRtcStreamCommand::from_payload(
418-
profile.as_deref(),
419-
fps,
420-
force_keyframe.unwrap_or(false),
421-
snapshot.unwrap_or(false),
422-
);
415+
let command = WebRtcStreamCommand {
416+
force_keyframe: force_keyframe.unwrap_or(false),
417+
snapshot: snapshot.unwrap_or(false),
418+
};
423419
if command.force_keyframe || command.snapshot {
424420
session.request_keyframe();
425421
}
@@ -499,10 +495,8 @@ enum WebRtcDataChannelMessage {
499495
stats: Box<ClientStreamStats>,
500496
},
501497
StreamControl {
502-
fps: Option<u32>,
503498
#[serde(rename = "forceKeyframe")]
504499
force_keyframe: Option<bool>,
505-
profile: Option<String>,
506500
snapshot: Option<bool>,
507501
},
508502
}
@@ -513,21 +507,6 @@ struct WebRtcStreamCommand {
513507
snapshot: bool,
514508
}
515509

516-
impl WebRtcStreamCommand {
517-
fn from_payload(
518-
profile: Option<&str>,
519-
fps: Option<u32>,
520-
force_keyframe: bool,
521-
snapshot: bool,
522-
) -> Self {
523-
let _ = (profile, fps);
524-
Self {
525-
force_keyframe,
526-
snapshot,
527-
}
528-
}
529-
}
530-
531510
fn webrtc_control_message_is_move(message: &ControlMessage) -> bool {
532511
matches!(message, ControlMessage::Touch { phase, .. } if phase == "moved")
533512
}

0 commit comments

Comments
 (0)