11#include <promeki/config.h>
12#if PROMEKI_ENABLE_NETWORK
28PROMEKI_NAMESPACE_BEGIN
46struct RtpAncDepacketizerContext {
49 Queue<RxAncFrame> *payloadQueue =
nullptr;
55 const Atomic<uint32_t> *resetEpoch =
nullptr;
60 const bool *active =
nullptr;
64 RtpPayloadAnc *payload =
nullptr;
76 ClockDomain clockDomain;
80 const bool *hasSr =
nullptr;
83 const RtpStreamClock *streamClock =
nullptr;
87 Atomic<int64_t> *packetsReceived =
nullptr;
88 Atomic<int64_t> *bytesReceived =
nullptr;
89 Atomic<int64_t> *lastPacketArrivalNs =
nullptr;
90 Atomic<int64_t> *framesReassembled =
nullptr;
91 Atomic<int64_t> *framesDroppedSsrcReset =
nullptr;
95 Function<void()> noteFrameReceived;
99 Function<void()> refreshStreamClock;
105 Function<TimeStamp(
const NtpTime &)> ntpToSteady;
124class RtpAncDepacketizerThread :
public RtpDepacketizerThread {
134 RtpAncDepacketizerThread(RtpAncDepacketizerContext ctx,
136 uint32_t clockRateHz);
138 ~RtpAncDepacketizerThread()
override;
140 RtpAncDepacketizerThread(
const RtpAncDepacketizerThread &) =
delete;
141 RtpAncDepacketizerThread &operator=(
const RtpAncDepacketizerThread &) =
delete;
145 void handlePacketForTest(
const RtpPacket &pkt) { handlePacket(pkt); }
151 void flushForTest() { emitFrame(); }
154 void handlePacket(
const RtpPacket &pkt)
override;
155 void onStop()
override;
160 RtpAncDepacketizerContext _ctx;
161 RtpPacket::List _reasmPackets;
162 uint32_t _reasmTimestamp = 0;
163 bool _reasmHasTimestamp =
false;
164 uint32_t _lastEpoch = 0;