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
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ transport, benchmark tooling); worktrees isolate commits, not semantics.
- [Optional max age](/quest/m1/ietf-max-age.md) - max age is optional, set only by the publisher, and crosses moq-transport as MAX_CACHE_DURATION
- [IETF announce count](/quest/m1/ietf-announce-count.md) - an opt-in moq-transport extension carries the replay count, so IETF announce consumers go live without a timer
- [kio waiter overflow](/quest/m1/kio-waiter-lost.md) - a retained `Waiter` past 8 lists stops adding a duplicate entry to lists it already recorded
- [moqsink keyframe latch](/quest/m1/moqsink-keyframe-latch.md) - a header-only buffer after a break no longer permanently invalidates a moqsink video pad
- [Capture re-anchor](/quest/m1/capture-reanchor.md) - a repeating or restarting device clock never rewinds native capture during a fast backlog drain
- [Splice edge cases](/quest/m1/splice-edges.md) - an unstamped successor, a pruned segment's boundary group, and a warm head during a takeover are each handled correctly
- [Track tail hardening](/quest/m1/track-tail-hardening.md) - Rust and JS wait out a track's tail by the same rules, with the known hang, count, truncation, grace, and memory holes closed
Expand Down
23 changes: 0 additions & 23 deletions quest/m1/moqsink-keyframe-latch.md

This file was deleted.

31 changes: 29 additions & 2 deletions rs/moq-gst/src/sink/pad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ struct Media {
/// Apply a timeline break before the next valid frame, using the normal write error path.
discontinuity: bool,
/// A video break closed the group, and a pause resumes mid-GOP, so deltas drop until a keyframe
/// opens the next one.
/// opens the next one. Stays set once armed: a successful decode may publish nothing (a
/// header-only buffer), and a delta only misses its keyframe while no group is open, which for
/// video means after a break.
keyframe: bool,
}

Expand All @@ -69,7 +71,6 @@ impl Media {
Err(moq_mux::Error::MissingKeyframe(_)) if self.keyframe => return Ok(false),
result => result?,
}
self.keyframe = false;
// One group (one QUIC stream) per audio packet, so the relay forwards it without waiting for
// the next.
if self.audio {
Expand Down Expand Up @@ -1758,6 +1759,32 @@ mod tests {
assert_eq!(push(&mut pad, delta, 166), PushOutcome::Published);
}

// A header-only buffer after a break publishes no frame, so no group opens and the deltas that
// follow must still drop rather than invalidate the pad.
#[test]
fn video_header_only_buffer_keeps_waiting_for_the_keyframe() {
gst::init().unwrap();
let (broadcast, catalog) = producers();
let mut pad = Pad::new();
pad.observe_caps(&broadcast, &catalog, producer_options(&h264_caps(), Some("video")));
pad.observe_segment(time_segment());
// The SPS and PPS of the keyframe AU, without its IDR slice.
let keyframe = h264_keyframe_au();
let headers = keyframe.slice(..keyframe.len() - 9);
let delta = Bytes::from_static(&[0, 0, 0, 1, 0x61, 0xe0, 0x12, 0x34]);
let now = Instant::now();
let push = |pad: &mut Pad, data: Bytes, pts: u64| {
pad.push_buffer(data, Some(gst::ClockTime::from_mseconds(pts)), None, None, now)
.unwrap()
};
assert_eq!(push(&mut pad, keyframe.clone(), 0), PushOutcome::Published);
pad.discontinuity();
assert_eq!(push(&mut pad, headers, 33), PushOutcome::Published);
assert_eq!(push(&mut pad, delta.clone(), 66), PushOutcome::Dropped);
assert_eq!(push(&mut pad, keyframe, 100), PushOutcome::Published);
assert_eq!(push(&mut pad, delta, 133), PushOutcome::Published);
}

// Text and opaque tracks carry no codec jitter, so asking them to measure one is a mistake to report
// rather than a setting to ignore.
#[test]
Expand Down
Loading