44 #ifndef CCXX_RTP_OQUEUE_H_
45 #define CCXX_RTP_OQUEUE_H_
51 #ifdef CCXX_NAMESPACES
72 std::list<TransportAddress*>
destList;
83 {
return (1 == destList.size()); }
86 {
return destList.front(); }
89 { destinationLock.readLock(); }
92 { destinationLock.unlock(); }
96 { destinationLock.writeLock(); }
108 bool removeDestinationFromList(
const InetAddress& ia,
115 networkAddress(na), dataTransportPort(dtp),
116 controlTransportPort(ctp)
120 {
return networkAddress; }
123 {
return dataTransportPort; }
126 {
return controlTransportPort; }
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,
189 struct TransportAddressIPV6
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;
225 protected DestinationListHandlerIPV6,
232 addDestination(
const IPV6Address& ia,
237 forgetDestination(
const IPV6Address& ia,
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);
324 { sendInfo.paddinglen = paddinglen; }
335 { sendInfo.marked = mark; }
341 {
return sendInfo.marked; }
354 setPartial(uint32 timestamp,
unsigned char* data,
size_t offset,
size_t max);
358 {
return defaultSchedulingTimeout; }
368 { schedulingTimeout = to; }
372 {
return defaultExpireTimeout; }
383 { expireTimeout = to; }
386 {
return expireTimeout; }
395 {
return sendInfo.packetCount; }
404 {
return sendInfo.octetCount; }
413 {
return sendInfo.sendSeq; }
445 getOutQueueCryptoContext(uint32 ssrc);
459 packet(pkt), prev(p), next(n) { }
501 getSchedulingTimeout();
510 dispatchDataPacket();
522 { sendInfo.sendSeq = seqNum; }
526 {
return sendInfo.sendSeq; }
532 { initialTimestamp = ts; }
538 {
return initialTimestamp; }
540 void purgeOutgoingQueue();
547 setControlPeerIPV6(
const IPV6Address &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;}
608 uint32 sendSources[16];
620 uint32 initialTimestamp;
629 #ifdef CCXX_NAMESPACES
633 #endif //CCXX_RTP_OQUEUE_H_
uint32 getSendPacketCount() const
Get the total number of packets sent so far.
uint32 getSendOctetCount() const
Get the total number of octets (payload only) sent so far.
void setPrev(OutgoingRTPPktLink *p)
void setMark(bool mark)
Set marker bit for the packet in which the next data provided will be send.
virtual size_t sendData(const unsigned char *const buffer, size_t len)
This function performs the physical I/O for writing a packet to the destination.
void setSchedulingTimeout(microtimeout_t to)
Set the default scheduling timeout to use when no data packets are waiting to be sent.
void setNext(OutgoingRTPPktLink *n)
bool getMark() const
Get wheter the mark bit will be set in the next packet.
The implementation for a SRTP cryptographic context.
ThreadLock destinationLock
void writeLockDestinationList() const
uint32 microtimeout_t
Time interval expressed in microseconds.
uint32 getCurrentSeqNum(void)
unsigned short tpport_t
Transport Protocol Ports.
tpport_t dataTransportPort
std::list< TransportAddress * > destList
microtimeout_t expireTimeout
OutgoingRTPPkt * getPacket()
The Mutex class is used to protect a section of code so that at any given time only a single thread c...
This class handles a list of destination addresses.
void lockDestinationList() const
microtimeout_t getDefaultExpireTimeout() const
void setNextSeqNum(uint32 seqNum)
For thoses cases in which the application requires a method to set the sequence number for the outgoi...
std::list< CryptoContext * > cryptoContexts
OutgoingRTPPktLink * getPrev()
TransportAddress * getFirstDestination() const
uint32 getInitialTimestamp()
virtual void onExpireSend(OutgoingRTPPkt &)
A hook to filter packets being sent that have been expired.
OutgoingRTPPktLink(OutgoingRTPPkt *pkt, OutgoingRTPPktLink *p, OutgoingRTPPktLink *n)
void setPadding(uint8 paddinglen)
Set padding.
OutgoingRTPPktLink * sendLast
Base classes for RTP queues.
microtimeout_t getDefaultSchedulingTimeout() const
InetAddress networkAddress
virtual void setControlPeer(const InetAddress &host, tpport_t port)
The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have ...
static const microtimeout_t defaultSchedulingTimeout
const tpport_t DefaultRTPDataPort
registered default RTP data transport port
microtimeout_t schedulingTimeout
void setInitialTimestamp(uint32 ts)
tpport_t getControlTransportPort() const
const InetAddress & getNetworkAddress() const
uint16 getSequenceNumber() const
Get the sequence number of the next outgoing packet.
tpport_t getDataTransportPort() const
virtual ~OutgoingDataQueue()
static const microtimeout_t defaultExpireTimeout
TransportAddress(InetAddress na, tpport_t dtp, tpport_t ctp)
void setExpireTimeout(microtimeout_t to)
Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are...
virtual void setDataPeer(const InetAddress &host, tpport_t port)
bool isSingleDestination() const
Get whether there is only a destination in the list.
OutgoingRTPPktLink * prev
void setPacket(OutgoingRTPPkt *pkt)
A generic outgoing RTP data queue supporting multiple destinations.
OutgoingRTPPktLink * getNext()
microtimeout_t getExpireTimeout() const
void unlockDestinationList() const