feat(perception): qualify 1x realtime replay envelope
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user