44 #ifndef CCXX_RTP_OQUEUE_H_
45 #define CCXX_RTP_OQUEUE_H_
51 #ifdef CCXX_NAMESPACES
72 std::list<TransportAddress*>
destList;
82 inline bool isSingleDestination()
const
83 {
return (1 == destList.size()); }
86 {
return destList.front(); }
88 inline void lockDestinationList()
const
89 { destinationLock.readLock(); }
91 inline void unlockDestinationList()
const
92 { destinationLock.unlock(); }
95 inline void writeLockDestinationList()
const
96 { destinationLock.writeLock(); }
102 addDestinationToList(
const InetAddress& ia, tpport_t data,
108 bool removeDestinationFromList(
const InetAddress& ia,
110 tpport_t controlPort);
115 networkAddress(na), dataTransportPort(dtp),
116 controlTransportPort(ctp)
119 inline const InetAddress& getNetworkAddress()
const
120 {
return networkAddress; }
122 inline tpport_t getDataTransportPort()
const
123 {
return dataTransportPort; }
125 inline tpport_t getControlTransportPort()
const
126 {
return controlTransportPort; }
133 mutable ThreadLock destinationLock;
145 class __EXPORT DestinationListHandlerIPV6
148 struct TransportAddressIPV6;
149 std::list<TransportAddressIPV6*> destListIPV6;
152 DestinationListHandlerIPV6();
154 ~DestinationListHandlerIPV6();
159 inline bool isSingleDestinationIPV6()
const
160 {
return (1 == destListIPV6.size()); }
162 inline TransportAddressIPV6* getFirstDestinationIPV6()
const
163 {
return destListIPV6.front(); }
165 inline void lockDestinationListIPV6()
const
166 { destinationLock.readLock(); }
168 inline void unlockDestinationListIPV6()
const
169 { destinationLock.unlock(); }
172 inline void writeLockDestinationListIPV6()
const
173 { destinationLock.writeLock(); }
179 addDestinationToListIPV6(
const IPV6Address& ia, tpport_t data,
185 bool removeDestinationFromListIPV6(
const IPV6Address& ia,
187 tpport_t controlPort);
189 struct TransportAddressIPV6
191 TransportAddressIPV6(IPV6Address na, tpport_t dtp, tpport_t ctp) :
192 networkAddress(na), dataTransportPort(dtp),
193 controlTransportPort(ctp)
196 inline const IPV6Address& getNetworkAddress()
const
197 {
return networkAddress; }
199 inline tpport_t getDataTransportPort()
const
200 {
return dataTransportPort; }
202 inline tpport_t getControlTransportPort()
const
203 {
return controlTransportPort; }
205 IPV6Address networkAddress;
206 tpport_t dataTransportPort, controlTransportPort;
210 mutable ThreadLock destinationLock;
225 protected DestinationListHandlerIPV6,
232 addDestination(
const IPV6Address& ia,
234 tpport_t controlPort = 0);
237 forgetDestination(
const IPV6Address& ia,
239 tpport_t controlPort = 0);
244 addDestination(
const InetHostAddress& ia,
246 tpport_t controlPort = 0);
249 addDestination(
const InetMcastAddress& ia,
251 tpport_t controlPort = 0);
254 forgetDestination(
const InetHostAddress& ia,
256 tpport_t controlPort = 0);
259 forgetDestination(
const InetMcastAddress& ia,
261 tpport_t controlPort = 0);
269 addContributor(uint32 csrc);
275 removeContributor(uint32 csrc);
299 putData(uint32 stamp,
const unsigned char* data = NULL,
size_t len = 0);
314 sendImmediate(uint32 stamp,
const unsigned char* data = NULL,
size_t len = 0);
323 void setPadding(uint8 paddinglen)
324 { sendInfo.paddinglen = paddinglen; }
334 void setMark(
bool mark)
335 { sendInfo.marked = mark; }
340 inline bool getMark()
const
341 {
return sendInfo.marked; }
354 setPartial(uint32 timestamp,
unsigned char* data,
size_t offset,
size_t max);
357 getDefaultSchedulingTimeout()
const
358 {
return defaultSchedulingTimeout; }
368 { schedulingTimeout = to; }
371 getDefaultExpireTimeout()
const
372 {
return defaultExpireTimeout; }
383 { expireTimeout = to; }
386 {
return expireTimeout; }
394 getSendPacketCount()
const
395 {
return sendInfo.packetCount; }
403 getSendOctetCount()
const
404 {
return sendInfo.octetCount; }
412 getSequenceNumber()
const
413 {
return sendInfo.sendSeq; }
445 getOutQueueCryptoContext(uint32 ssrc);
459 packet(pkt), prev(p), next(n) { }
501 getSchedulingTimeout();
510 dispatchDataPacket();
521 setNextSeqNum(uint32 seqNum)
522 { sendInfo.sendSeq = seqNum; }
525 getCurrentSeqNum(
void)
526 {
return sendInfo.sendSeq; }
531 setInitialTimestamp(uint32 ts)
532 { initialTimestamp = ts; }
537 getInitialTimestamp()
538 {
return initialTimestamp; }
540 void purgeOutgoingQueue();
547 setControlPeerIPV6(
const IPV6Address &host, tpport_t port) {}
564 setDataPeer(
const InetAddress &host, tpport_t port) {}
568 setDataPeerIPV6(
const IPV6Address &host, tpport_t port) {}
581 sendData(
const unsigned char*
const buffer,
size_t len) {
return 0;}
585 sendDataIPV6(
const unsigned char*
const buffer,
size_t len) {
return 0;}
590 mutable ThreadLock sendLock;
592 OutgoingRTPPktLink* sendFirst, * sendLast;
593 uint32 initialTimestamp;
608 uint32 sendSources[16];
620 uint32 initialTimestamp;
629 #ifdef CCXX_NAMESPACES
633 #endif //CCXX_RTP_OQUEUE_H_