Go to the documentation of this file.
44 #ifndef CCXX_RTP_OQUEUE_H_
45 #define CCXX_RTP_OQUEUE_H_
81 {
return (1 == destList.size()); }
84 {
return destList.front(); }
87 { destinationLock.readLock(); }
90 { destinationLock.unlock(); }
94 { destinationLock.writeLock(); }
108 tpport_t controlPort);
113 networkAddress(na), dataTransportPort(dtp),
114 controlTransportPort(ctp)
118 {
return networkAddress; }
121 {
return dataTransportPort; }
124 {
return controlTransportPort; }
131 mutable ThreadLock destinationLock;
143 class __EXPORT DestinationListHandlerIPV6
146 struct TransportAddressIPV6;
147 std::list<TransportAddressIPV6*> destListIPV6;
150 DestinationListHandlerIPV6();
152 ~DestinationListHandlerIPV6();
157 inline bool isSingleDestinationIPV6()
const
158 {
return (1 == destListIPV6.size()); }
160 inline TransportAddressIPV6* getFirstDestinationIPV6()
const
161 {
return destListIPV6.front(); }
163 inline void lockDestinationListIPV6()
const
164 { destinationLock.readLock(); }
166 inline void unlockDestinationListIPV6()
const
167 { destinationLock.unlock(); }
170 inline void writeLockDestinationListIPV6()
const
171 { destinationLock.writeLock(); }
177 addDestinationToListIPV6(
const IPV6Address& ia, tpport_t data,
183 bool removeDestinationFromListIPV6(
const IPV6Address& ia,
185 tpport_t controlPort);
187 struct TransportAddressIPV6
189 TransportAddressIPV6(IPV6Address na, tpport_t dtp, tpport_t ctp) :
190 networkAddress(na), dataTransportPort(dtp),
191 controlTransportPort(ctp)
194 inline const IPV6Address& getNetworkAddress()
const
195 {
return networkAddress; }
197 inline tpport_t getDataTransportPort()
const
198 {
return dataTransportPort; }
200 inline tpport_t getControlTransportPort()
const
201 {
return controlTransportPort; }
203 IPV6Address networkAddress;
204 tpport_t dataTransportPort, controlTransportPort;
208 mutable ThreadLock destinationLock;
223 protected DestinationListHandlerIPV6,
230 addDestination(
const IPV6Address& ia,
232 tpport_t controlPort = 0);
235 forgetDestination(
const IPV6Address& ia,
237 tpport_t controlPort = 0);
244 tpport_t controlPort = 0);
249 tpport_t controlPort = 0);
254 tpport_t controlPort = 0);
259 tpport_t controlPort = 0);
297 putData(uint32 stamp,
const unsigned char* data = NULL,
size_t len = 0);
312 sendImmediate(uint32 stamp,
const unsigned char* data = NULL,
size_t len = 0);
322 { sendInfo.paddinglen = paddinglen; }
333 { sendInfo.marked = mark; }
339 {
return sendInfo.marked; }
352 setPartial(uint32 timestamp,
unsigned char* data,
size_t offset,
size_t max);
356 {
return defaultSchedulingTimeout; }
366 { schedulingTimeout = to; }
370 {
return defaultExpireTimeout; }
381 { expireTimeout = to; }
384 {
return expireTimeout; }
393 {
return sendInfo.packetCount; }
402 {
return sendInfo.octetCount; }
411 {
return sendInfo.sendSeq; }
457 packet(pkt), prev(p), next(n) { }
520 { sendInfo.sendSeq = seqNum; }
524 {
return sendInfo.sendSeq; }
530 { initialTimestamp = ts; }
536 {
return initialTimestamp; }
545 setControlPeerIPV6(
const IPV6Address &host, tpport_t port) {}
562 setDataPeer(
const InetAddress &host, tpport_t port) {}
566 setDataPeerIPV6(
const IPV6Address &host, tpport_t port) {}
579 sendData(
const unsigned char*
const buffer,
size_t len) {
return 0;}
583 sendDataIPV6(
const unsigned char*
const buffer,
size_t len) {
return 0;}
588 mutable ThreadLock sendLock;
590 OutgoingRTPPktLink* sendFirst, * sendLast;
591 uint32 initialTimestamp;
606 uint32 sendSources[16];
618 uint32 initialTimestamp;
629 #endif //CCXX_RTP_OQUEUE_H_
void sendImmediate(uint32 stamp, const unsigned char *data=NULL, size_t len=0)
This is used to create a data packet and send it immediately.
std::list< TransportAddress * > destList
Definition: oqueue.h:69
virtual ~OutgoingDataQueue()
Definition: oqueue.h:449
const tpport_t DefaultRTPDataPort
registered default RTP data transport port
Definition: base.h:110
void setPadding(uint8 paddinglen)
Set padding.
Definition: oqueue.h:321
bool addDestination(const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
void setNext(OutgoingRTPPktLink *n)
Definition: oqueue.h:471
Base classes for RTP queues.
void unlockDestinationList() const
Definition: oqueue.h:89
bool removeDestinationFromList(const InetAddress &ia, tpport_t dataPort, tpport_t controlPort)
Locks the object before modifying it.
microtimeout_t getExpireTimeout() const
Definition: oqueue.h:383
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:83
size_t setPartial(uint32 timestamp, unsigned char *data, size_t offset, size_t max)
Set partial data for an already queued packet.
OutgoingRTPPktLink * getNext()
Definition: oqueue.h:469
OutgoingRTPPkt * packet
Definition: oqueue.h:474
void putData(uint32 stamp, const unsigned char *data=NULL, size_t len=0)
This is used to create a data packet in the send queue.
uint32 microtimeout_t
Time interval expressed in microseconds.
Definition: base.h:68
~OutgoingRTPPktLink()
Definition: oqueue.h:459
void setNextSeqNum(uint32 seqNum)
For thoses cases in which the application requires a method to set the sequence number for the outgoi...
Definition: oqueue.h:519
bool forgetDestination(const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
TransportAddress(InetAddress na, tpport_t dtp, tpport_t ctp)
Definition: oqueue.h:112
microtimeout_t getSchedulingTimeout()
This computes the timeout period for scheduling transmission of the next packet at the "head" of the ...
bool removeContributor(uint32 csrc)
Remove CSRC from the list of contributors.
bool marked
Definition: oqueue.h:614
void purgeOutgoingQueue()
uint32 getSendPacketCount() const
Get the total number of packets sent so far.
Definition: oqueue.h:392
uint32 packetCount
Definition: oqueue.h:600
bool isSingleDestination() const
Get whether there is only a destination in the list.
Definition: oqueue.h:80
timeval overflowTime
Definition: oqueue.h:621
void writeLockDestinationList() const
Definition: oqueue.h:93
void lockDestinationList() const
Definition: oqueue.h:86
void removeOutQueueCryptoContext(CryptoContext *cc)
Remove output queue CryptoContext.
InetAddress networkAddress
Definition: oqueue.h:126
bool addDestination(const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
bool getMark() const
Get wheter the mark bit will be set in the next packet.
Definition: oqueue.h:338
A generic outgoing RTP data queue supporting multiple destinations.
Definition: oqueue.h:226
uint8 paddinglen
Definition: oqueue.h:610
size_t dispatchDataPacket()
This function is used by the service thread to process the next outgoing packet pending in the sendin...
Mutex cryptoMutex
Definition: oqueue.h:549
uint32 getCurrentSeqNum(void)
Definition: oqueue.h:523
RTP packets being sent.
Definition: rtppkt.h:509
OutgoingRTPPktLink * getPrev()
Definition: oqueue.h:465
bool isSending() const
Determine if outgoing packets are waiting to send.
void setExpireTimeout(microtimeout_t to)
Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are...
Definition: oqueue.h:380
Definition: queuebase.h:257
CryptoContext * getOutQueueCryptoContext(uint32 ssrc)
Get an output queue CryptoContext identified by SSRC.
uint16 sendCC
Definition: oqueue.h:608
void setSchedulingTimeout(microtimeout_t to)
Set the default scheduling timeout to use when no data packets are waiting to be sent.
Definition: oqueue.h:365
microtimeout_t getDefaultExpireTimeout() const
Definition: oqueue.h:369
bool complete
Definition: oqueue.h:616
uint16 getSequenceNumber() const
Get the sequence number of the next outgoing packet.
Definition: oqueue.h:410
OutgoingRTPPkt * getPacket()
Definition: oqueue.h:461
void setMark(bool mark)
Set marker bit for the packet in which the next data provided will be send.
Definition: oqueue.h:332
void addContributor(uint32 csrc)
Add csrc as the CSRC identifier of a new contributor.
tpport_t getDataTransportPort() const
Definition: oqueue.h:120
tpport_t getControlTransportPort() const
Definition: oqueue.h:123
void setInitialTimestamp(uint32 ts)
Definition: oqueue.h:529
~DestinationListHandler()
OutgoingRTPPktLink * prev
Definition: oqueue.h:476
uint16 sendSeq
Definition: oqueue.h:604
void setOutQueueCryptoContext(CryptoContext *cc)
Set ouput queue CryptoContext.
bool addDestinationToList(const InetAddress &ia, tpport_t data, tpport_t control)
Locks the object before modifying it.
uint32 octetCount
Definition: oqueue.h:602
void setPrev(OutgoingRTPPktLink *p)
Definition: oqueue.h:467
microtimeout_t getDefaultSchedulingTimeout() const
Definition: oqueue.h:355
uint32 getSendOctetCount() const
Get the total number of octets (payload only) sent so far.
Definition: oqueue.h:401
uint32 getInitialTimestamp()
Definition: oqueue.h:535
tpport_t dataTransportPort
Definition: oqueue.h:127
virtual void setControlPeer(const InetAddress &host, tpport_t port)
Definition: oqueue.h:541
OutgoingRTPPktLink(OutgoingRTPPkt *pkt, OutgoingRTPPktLink *p, OutgoingRTPPktLink *n)
Definition: oqueue.h:454
void setPacket(OutgoingRTPPkt *pkt)
Definition: oqueue.h:463
This class handles a list of destination addresses.
Definition: oqueue.h:67
bool forgetDestination(const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
void dispatchImmediate(OutgoingRTPPkt *packet)
This is used to write the RTP data packet to one or more destinations.
std::list< CryptoContext * > cryptoContexts
Definition: oqueue.h:550
const InetAddress & getNetworkAddress() const
Definition: oqueue.h:117
TransportAddress * getFirstDestination() const
Definition: oqueue.h:83