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/namespace.h>
17#include <promeki/queue.h>
21#include <promeki/string.h>
22
23PROMEKI_NAMESPACE_BEGIN
24
25class RtpPayloadAnc;
26
46struct RtpAncPacketizerContext {
52 size_t streamIdx = 0;
53
58 uint32_t clockRateHz = 90000;
59
62 RtpPayloadAnc *payload = nullptr;
63
68 Queue<RtpPacketBatch> *txPacketQueue = nullptr;
69
82 RtpPayloadAnc::FieldIndication keepAliveField =
83 RtpPayloadAnc::FieldIndication::Progressive;
84};
85
118class RtpAncPacketizerThread : public RtpPacketizerThread {
119 public:
132 RtpAncPacketizerThread(
133 RtpAncPacketizerContext ctx,
134 const String &name = String("RtpAncPkt"),
135 size_t depth = DefaultPayloadQueueDepth);
136
137 ~RtpAncPacketizerThread() override;
138
139 RtpAncPacketizerThread(const RtpAncPacketizerThread &) = delete;
140 RtpAncPacketizerThread &operator=(const RtpAncPacketizerThread &) = delete;
141
144 void packetizeForTest(const RtpFrameWork &work) { packetize(work); }
145
147 const RtpAncPacketizerContext &context() const { return _ctx; }
148
149 protected:
150 void packetize(const RtpFrameWork &work) override;
151
152 private:
153 RtpAncPacketizerContext _ctx;
154};
155
156PROMEKI_NAMESPACE_END
157
158#endif // PROMEKI_ENABLE_NETWORK