Expand description
Port of libopus src/repacketizer.c + the packet helpers from src/opus.c:
split Opus packets into frames and recombine/re-frame/pad them WITHOUT
re-encoding. Used to merge several packets into a longer one, split a
multi-frame packet, or pad a packet to a target size (e.g. for CBR
transport). All frames in a repacketizer must share the same TOC config
(mode/bandwidth/frame-size); only the code (0..3) and framing change.
Structs§
- Repacketizer
- opus_repacketizer: accumulate frames from one or more same-config packets, then emit them as a single re-framed packet.
Functions§
- pad_
packet - opus_packet_pad: grow
packetin place tonew_lenbytes by adding opus padding (no re-encode). No-op if alreadynew_len; errors ifnew_lenis smaller. - unpad_
packet - opus_packet_unpad: strip opus padding, returning the minimal packet.