Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions host/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,15 @@ pub fn session_summary(
EndReason::LinkLost => "other",
EndReason::Liveness | EndReason::Goodbye(ByeReason::Error) if !streamed => "no_video",
EndReason::Liveness => "signal_lost",
// The iPad gave up on video that went out: none of it arrived, or
// no frame of it completed.
EndReason::Goodbye(ByeReason::Error) if !end.frames_received => {
if end.frags_received {
"no_frame"
} else {
"no_video"
}
}
EndReason::Goodbye(ByeReason::Error) => "other",
EndReason::Failed(StageFailure::Capture) => "capture_failed",
EndReason::Failed(StageFailure::Encoder) => "encoder_failed",
Expand Down Expand Up @@ -706,6 +715,7 @@ pub(crate) mod tests {
reason,
first_video: first_video_ms.map(Duration::from_millis),
frames_received: first_video_ms.is_some(),
frags_received: first_video_ms.is_some(),
duration: Duration::from_millis(duration_ms),
}
}
Expand Down Expand Up @@ -778,6 +788,24 @@ pub(crate) mod tests {
end(Goodbye(ByeReason::Error), Some(500), 30_000),
["steady", "streamed", "other", "goodbye"],
),
// The iPad gave up on video that went out: none of it arrived,
// or no frame of it completed.
(
SessionEnd {
frames_received: false,
frags_received: false,
..end(Goodbye(ByeReason::Error), Some(300), 10_000)
},
["video_sent", "streamed", "no_video", "goodbye"],
),
(
SessionEnd {
frames_received: false,
frags_received: true,
..end(Goodbye(ByeReason::Error), Some(300), 10_000)
},
["video_sent", "streamed", "no_frame", "goodbye"],
),
(
end(Liveness, None, 3_000),
["accepted", "no_picture", "no_video", "liveness"],
Expand Down
8 changes: 7 additions & 1 deletion host/src/transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,13 @@ pub async fn start_sender(
}

let payload = &nal.data;
let payload_size = media_payload_size(shared.max_dgram.load(Ordering::SeqCst) as usize).unwrap_or(MAX_MEDIA_PAYLOAD);
// The PC's packet size, or the smaller one this session's
// client asked for when none of the larger reached it.
let max_dgram = shared.session.lock().max_media_dgram(session_id).map_or(
shared.max_dgram.load(Ordering::SeqCst),
|asked| shared.max_dgram.load(Ordering::SeqCst).min(u32::from(asked)),
);
let payload_size = media_payload_size(max_dgram as usize).unwrap_or(MAX_MEDIA_PAYLOAD);
let frag_count_usize = payload.len().div_ceil(payload_size).max(1);
// Held back until the client answers; the frames after it
// wait for the keyframe its answer asks for.
Expand Down
Loading
Loading