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
2 changes: 0 additions & 2 deletions demo/carla/sim/moq_carla_sim/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ def publish(self, frame: Frame) -> None:
self._origin_us = frame.timestamp_us
timestamp = timedelta(microseconds=max(0, frame.timestamp_us - self._origin_us))
track.write_frame(frame.payload, timestamp)
# Live encoder output: records the handoff for the catalog's jitter.
track.flush(timestamp)
self.published[frame.rendition] += 1

async def watch_demand(self, on_demand: Callable[[bool], None] | None = None) -> None:
Expand Down
8 changes: 1 addition & 7 deletions demo/carla/sim/tests/test_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def __init__(self, init: bytes, name: str, hint) -> None:
self.name = name
self.hint = hint
self.frames: list[tuple[bytes, int]] = []
self.flushed: list[int] = []
self.finished = False
self.demand_handle = FakeDemand()

Expand All @@ -137,9 +136,6 @@ def demand(self) -> FakeDemand:
def write_frame(self, payload: bytes, timestamp: timedelta) -> None:
self.frames.append((payload, microseconds(timestamp)))

def flush(self, timestamp: timedelta) -> None:
self.flushed.append(microseconds(timestamp))

def finish(self) -> None:
self.finished = True

Expand Down Expand Up @@ -230,16 +226,14 @@ async def scenario() -> None:
broadcast.tracks["sd"].demand_handle.want(0)
assert await _request(reader) == (0x03, struct.pack("<IB", 1, 0b11))

# Timestamps are rebased onto the first frame's simulation time and
# flushed as live encoder output.
# Timestamps are rebased onto the first frame's simulation time.
writer.write(_frame(1, 1, 100, 5_000_000, True, b"idr"))
writer.write(_frame(1, 0, 100, 5_000_000, True, b"idr-sd"))
writer.write(_frame(1, 1, 101, 5_033_333, False, b"p"))
await writer.drain()
while stream.published != [1, 2]:
await asyncio.sleep(0)
assert broadcast.tracks["hd"].frames == [(b"idr", 0), (b"p", 33_333)]
assert broadcast.tracks["hd"].flushed == [0, 33_333]
assert broadcast.tracks["sd"].frames == [(b"idr-sd", 0)]
broadcast.tracks["hd"].demand_handle.want(None)
assert await _request(reader) == (0x03, struct.pack("<IB", 1, 0b01))
Expand Down
Loading