libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
rtpancpacketizerthread.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_NETWORK
13#include <cstddef>
14#include <cstdint>
15#include <promeki/ancpacket.h>
16#include <promeki/duration.h>
17#include <promeki/namespace.h>
18#include <promeki/queue.h>
23#include <promeki/string.h>
24
25PROMEKI_NAMESPACE_BEGIN
26
27class RtpPayloadAnc;
28
48struct RtpAncPacketizerContext {
54 size_t streamIdx = 0;
55
60 uint32_t clockRateHz = 90000;
61
64 RtpPayloadAnc *payload = nullptr;
65
70 Queue<RtpPacketBatch> *txPacketQueue = nullptr;
71
84 RtpPayloadAnc::FieldIndication keepAliveField =
85 RtpPayloadAnc::FieldIndication::Progressive;
86
100 bool lltmEnabled = false;
101
111 const RtpMediaClock *mediaClock = nullptr;
112
120 Duration trOffset = Duration::zero();
121
132 Duration tD = Duration::zero();
133};
134
167class RtpAncPacketizerThread : public RtpPacketizerThread {
168 public:
181 RtpAncPacketizerThread(
182 RtpAncPacketizerContext ctx,
183 const String &name = String("RtpAncPkt"),
184 size_t depth = DefaultPayloadQueueDepth);
185
186 ~RtpAncPacketizerThread() override;
187
188 RtpAncPacketizerThread(const RtpAncPacketizerThread &) = delete;
189 RtpAncPacketizerThread &operator=(const RtpAncPacketizerThread &) = delete;
190
193 void packetizeForTest(const RtpFrameWork &work) { packetize(work); }
194
196 const RtpAncPacketizerContext &context() const { return _ctx; }
197
198 protected:
199 void packetize(const RtpFrameWork &work) override;
200
201 private:
202 RtpAncPacketizerContext _ctx;
203};
204
205PROMEKI_NAMESPACE_END
206
207#endif // PROMEKI_ENABLE_NETWORK