Files
NODEDC_MISSION_CORE/tests/test_h264_packetizer.py
T
DCCONSTRUCTIONS 115476d2e6 feat(sdk): add bounded media admission, diagnostics and H264 recovery
Introduce deadline-bound admission and common diagnostics for constrained links. Add H264 packetization, recovery and the measured two-thread veryfast encoder path.
2026-10-29 09:09:59 +03:00

13 lines
631 B
Python

from aiortc.codecs import h264
from missioncore_plugin_sdk.h264_packetizer import packetize_h264, RTP_PAYLOAD_BYTES
def test_overlay_mtu_and_lossless_fu_a_with_actual_pinned_depacketizer():
nals = [b"\x67" + b"s" * 20, b"\x68" + b"p" * 10,
b"\x65" + bytes(range(256)) * 500, b"\x61" + b"x" * 1099,
b"\x61" + b"y" * 1100]
packets = packetize_h264(nals)
assert max(map(len, packets)) <= RTP_PAYLOAD_BYTES
assert b"".join(h264.h264_depayload(packet) for packet in packets) == b"".join(b"\0\0\0\1" + nal for nal in nals)
assert h264.PACKET_MAX == 1300 # Other peers/codecs are untouched.