feat(perception): qualify 1x realtime replay envelope

This commit is contained in:
DCCONSTRUCTIONS
2026-07-23 19:01:12 +03:00
parent ae2ce055c8
commit f1f8e21b78
13 changed files with 1425 additions and 141 deletions
+15 -3
View File
@@ -46,13 +46,25 @@ def test_incremental_media_buffer_is_bounded_and_fail_closed() -> None:
source.read(100)
def test_persistent_decoder_rejects_camera_fragment_gaps_before_decode() -> None:
def test_persistent_decoder_counts_latest_wins_camera_fragment_gaps() -> None:
decoder = PersistentFmp4Decoder(on_frame=lambda _frame: None)
decoder.start()
decoder.feed_init(b"not-a-real-init")
decoder.feed_segment(_metadata(1), b"first")
with pytest.raises(ShadowRuntimeError, match="sequence gap"):
decoder.feed_segment(_metadata(3), b"third")
decoder.feed_segment(_metadata(3), b"third")
assert decoder.snapshot()["source_sequence_gaps"] == 1
decoder.finish_input()
with pytest.raises(ShadowRuntimeError, match="decoder failed"):
decoder.join()
def test_persistent_decoder_rejects_non_increasing_camera_sequence() -> None:
decoder = PersistentFmp4Decoder(on_frame=lambda _frame: None)
decoder.start()
decoder.feed_init(b"not-a-real-init")
decoder.feed_segment(_metadata(2), b"second")
with pytest.raises(ShadowRuntimeError, match="not increasing"):
decoder.feed_segment(_metadata(2), b"duplicate")
decoder.finish_input()
with pytest.raises(ShadowRuntimeError, match="decoder failed"):
decoder.join()