Expand description
Cross-protocol voice-frame transcoding.
When cross_protocol_forwarding is enabled in ReflectorConfig,
a voice frame received on one protocol’s endpoint may need to be
re-broadcast on a different protocol’s endpoint. This module owns
the re-encoding step and the CrossProtocolEvent broadcast
envelope the Reflector uses to plumb events between endpoints.
The transcoding is NOT loss-free across all protocol/frame type combinations. Specifically:
DPlus/DExtraheader frames encode the same 41-byte D-STAR header and can be copied directly after protocol-specific framing.DCSvoice frames include the D-STAR header embedded in every packet — when transcodingDCS→DPlus/DExtra, the endpoint emits a synthetic header frame on the firstDCSpacket of a stream and data frames for subsequent packets.DPlus/DExtra→DCSrequires building a 100-byte DCS voice frame for every data packet, with the cached header embedded.
The function is deliberately sans-io: it only touches the
caller-supplied scratch buffer and reads from the caller-supplied
VoiceEvent / cached header. The caller is responsible for
maintaining the StreamCache that holds cached headers across
voice-data packets.
Structs§
- Cross
Protocol Event - Broadcast envelope pushed onto the
Reflector’s cross-protocol voice bus whencross_protocol_forwardingis enabled.
Enums§
- Transcode
Error - Errors returned by
transcode_voice. - Voice
Event - A decoded voice event ready for cross-protocol fan-out.
Functions§
- transcode_
voice - Encode a voice event in the given target protocol’s wire format.