A generic outgoing RTP data queue supporting multiple destinations.
More...
#include <oqueue.h>
Inheritance diagram for OutgoingDataQueue:
Collaboration diagram for OutgoingDataQueue:
Data Structures
Public Member Functions
Add csrc as the CSRC identifier of a new contributor.
More...
Remove CSRC from the list of contributors.
More...
Determine if outgoing packets are waiting to send.
More...
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.
More...
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.
More...
Set marker bit for the packet in which the next data provided will be send.
More...
Get wheter the mark bit will be set in the next packet.
More...
size_t
setPartial (uint32 timestamp, unsigned char *data, size_t offset, size_t max)
Set partial data for an already queued packet.
More...
Set the default scheduling timeout to use when no data packets are waiting to be sent.
More...
Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are already "too late" to be sent now.
More...
Get the total number of packets sent so far.
More...
Get the total number of octets (payload only) sent so far.
More...
Get the sequence number of the next outgoing packet.
More...
Set maximum payload segment size before fragmenting sends.
More...
Set the payload format in use, for timing and payload type identification purposes.
More...
Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T).
More...
Protected Member Functions
This is used to write the RTP data packet to one or more destinations.
More...
This computes the timeout period for scheduling transmission of the next packet at the "head" of the send buffer.
More...
This function is used by the service thread to process the next outgoing packet pending in the sending queue.
More...
For thoses cases in which the application requires a method to set the sequence number for the outgoing stream (such as for implementing the RTSP PLAY command).
More...
A plugin point for posting of BYE messages.
More...
Get whether there is only a destination in the list.
More...
Locks the object before modifying it.
More...
Locks the object before modifying it.
More...
Protected Attributes
Private Member Functions
A hook to filter packets being sent that have been expired.
More...
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.
More...
Private Attributes
struct {
Static Private Attributes
Detailed Description
Constructor & Destructor Documentation
OutgoingDataQueue::OutgoingDataQueue
(
)
protected
virtual OutgoingDataQueue::~OutgoingDataQueue
(
)
inlineprotectedvirtual
Member Function Documentation
void OutgoingDataQueue::addContributor
(
uint32
csrc )
Add csrc as the CSRC identifier of a new contributor.
This method adds the CSRC identifier to a list of contributors that will be inserted in every packet enqueued from now on.
bool DestinationListHandler::addDestinationToList
(
const
InetAddress &
ia,
)
protectedinherited
Locks the object before modifying it.
virtual size_t RTPQueueBase::dispatchBYE
(
const std::string &
)
inlineprotectedvirtualinherited
A plugin point for posting of BYE messages.
- Parameters
-
- reason to leave the RTP session.
- Returns
- number of octets sent.
Reimplemented in QueueRTCPManager.
Definition at line 231 of file queuebase.h.
size_t OutgoingDataQueue::dispatchDataPacket
(
)
protected
This function is used by the service thread to process the next outgoing packet pending in the sending queue.
- Returns
- number of bytes sent. 0 if silent, <0 if error.
This is used to write the RTP data packet to one or more destinations.
It is used by both sendImmediate and by dispatchDataPacket.
- Parameters
-
RTP packet to send.
PayloadType RTPQueueBase::getCurrentPayloadType
(
)
const
inlineinherited
uint32 RTPQueueBase::getCurrentRTPClockRate
(
)
const
inlineinherited
Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T).
This value depends on what payload format has been selected using setPayloadFormat().
- Returns
- clock rate in RTP clock units.
Definition at line 198 of file queuebase.h.
uint32 OutgoingDataQueue::getCurrentSeqNum
(
void
)
inlineprotected
size_t OutgoingDataQueueBase::getDefaultMaxSendSegmentSize
(
)
inlineinherited
microtimeout_t OutgoingDataQueue::getDefaultSchedulingTimeout
(
)
const
inline
timeval RTPQueueBase::getInitialTime
(
)
const
inlineinherited
uint32 OutgoingDataQueue::getInitialTimestamp
(
)
inlineprotected
uint32 RTPQueueBase::getLocalSSRC
(
)
const
inlineinherited
uint32 RTPQueueBase::getLocalSSRCNetwork
(
)
const
inlineprotectedinherited
bool OutgoingDataQueue::getMark
(
)
const
inline
Get wheter the mark bit will be set in the next packet.
Definition at line 340 of file oqueue.h.
size_t OutgoingDataQueueBase::getMaxSendSegmentSize
(
)
inlineinherited
CryptoContext* OutgoingDataQueue::getOutQueueCryptoContext
(
uint32
ssrc )
This computes the timeout period for scheduling transmission of the next packet at the "head" of the send buffer.
If no packets are waiting, a default timeout is used. This actually forms the "isPending()" timeout of the rtp receiver in the service thread.
- Returns
- timeout until next packet is scheduled to send.
uint32 OutgoingDataQueue::getSendOctetCount
(
)
const
inline
Get the total number of octets (payload only) sent so far.
- Returns
- total number of payload octets sent in RTP packets.
Definition at line 403 of file oqueue.h.
uint32 OutgoingDataQueue::getSendPacketCount
(
)
const
inline
Get the total number of packets sent so far.
- Returns
- total number of packets sent
Definition at line 394 of file oqueue.h.
uint16 OutgoingDataQueue::getSequenceNumber
(
)
const
inline
Get the sequence number of the next outgoing packet.
- Returns
- the 16 bit sequence number.
Definition at line 412 of file oqueue.h.
bool OutgoingDataQueue::isSending
(
)
const
Determine if outgoing packets are waiting to send.
- Returns
- true if there are packets waiting to be send.
bool DestinationListHandler::isSingleDestination
(
)
const
inlineinherited
Get whether there is only a destination in the list.
Definition at line 82 of file oqueue.h.
void DestinationListHandler::lockDestinationList
(
)
const
inlineinherited
A hook to filter packets being sent that have been expired.
- Parameters
-
- expired packet from the send queue.
Definition at line 560 of file oqueue.h.
void OutgoingDataQueue::purgeOutgoingQueue
(
)
protected
void OutgoingDataQueue::putData
(
uint32
stamp,
const unsigned char *
data = NULL
,
size_t
len = 0
)
This is used to create a data packet in the send queue.
Sometimes a "NULL" or empty packet will be used instead, and these are known as "silent" packets. "Silent" packets are used simply to "push" the scheduler along more accurately by giving the appearence that a next packet is waiting to be sent and to provide a valid timestamp for that packet.
- Parameters
-
stamp Timestamp for expected send time of packet.
data Value or NULL if special "silent" packet.
len May be 0 to indicate a default by payload type.
bool OutgoingDataQueue::removeContributor
(
uint32
csrc )
Remove CSRC from the list of contributors.
bool DestinationListHandler::removeDestinationFromList
(
const
InetAddress &
ia,
)
protectedinherited
Locks the object before modifying it.
void OutgoingDataQueue::removeOutQueueCryptoContext
(
CryptoContext *
cc )
Remove output queue CryptoContext.
The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.
- Parameters
-
virtual void RTPQueueBase::renewLocalSSRC
(
)
inlineprotectedvirtualinherited
virtual size_t OutgoingDataQueue::sendData
(
const unsigned char *const
buffer,
size_t
len
)
inlineprivatevirtual
This function performs the physical I/O for writing a packet to the destination.
It is a virtual that is overriden in the derived class.
- Parameters
-
len Length of data to write.
- Returns
- number of bytes sent.
Reimplemented in RTPDuplex.
Definition at line 581 of file oqueue.h.
void OutgoingDataQueue::sendImmediate
(
uint32
stamp,
const unsigned char *
data = NULL
,
size_t
len = 0
)
This is used to create a data packet and send it immediately.
Sometimes a "NULL" or empty packet will be used instead, and these are known as "silent" packets. "Silent" packets are used simply to "push" the scheduler along more accurately by giving the appearence that a next packet is waiting to be sent and to provide a valid timestamp for that packet.
- Parameters
-
stamp Timestamp immediate send time of packet.
data Value or NULL if special "silent" packet.
len May be 0 to indicate a default by payload type.
virtual void OutgoingDataQueue::setControlPeer
(
const
InetAddress &
host,
)
inlineprotectedvirtual
virtual void OutgoingDataQueue::setDataPeer
(
const
InetAddress &
host,
)
inlineprivatevirtual
Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are already "too late" to be sent now.
- Parameters
-
to timeout to expire unsent packets in milliseconds.
Definition at line 382 of file oqueue.h.
void OutgoingDataQueue::setInitialTimestamp
(
uint32
ts )
inlineprotected
void RTPQueueBase::setLocalSSRC
(
uint32
ssrc )
inlineprotectedinherited
void OutgoingDataQueue::setMark
(
bool
mark )
inline
Set marker bit for the packet in which the next data provided will be send.
When transmitting audio, should be set for the first packet of a talk spurt. When transmitting video, should be set for the last packet for a video frame.
- Parameters
-
mark Marker bit value for next packet.
Definition at line 334 of file oqueue.h.
void OutgoingDataQueueBase::setMaxSendSegmentSize
(
size_t
size )
inlineinherited
Set maximum payload segment size before fragmenting sends.
- Parameters
-
size Maximum payload size.
- Returns
- Whether segment size was successfully set.
Definition at line 272 of file queuebase.h.
void OutgoingDataQueue::setNextSeqNum
(
uint32
seqNum )
inlineprotected
For thoses cases in which the application requires a method to set the sequence number for the outgoing stream (such as for implementing the RTSP PLAY command).
- Parameters
-
seqNum next sequence number to be used for outgoing packets.
Definition at line 521 of file oqueue.h.
void OutgoingDataQueue::setOutQueueCryptoContext
(
CryptoContext *
cc )
Set ouput queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
- Parameters
-
void OutgoingDataQueue::setPadding
(
uint8
paddinglen )
inline
Set padding.
All outgoing packets will be transparently padded to a multiple of paddinglen.
- Parameters
-
paddinglen pad packets to a length multiple of paddinglen.
Definition at line 323 of file oqueue.h.
size_t OutgoingDataQueue::setPartial
(
uint32
timestamp,
unsigned char *
data,
size_t
offset,
size_t
max
)
Set partial data for an already queued packet.
This is often used for multichannel data.
- Parameters
-
timestamp Timestamp of packet.
offset Offset to copy from.
max Maximum data size.
- Returns
- Number of packet data bytes set.
Set the payload format in use, for timing and payload type identification purposes.
- Parameters
-
pf payload format to use from now on.
- Returns
- whether the payload format has been successfully set.
Definition at line 180 of file queuebase.h.
Set the default scheduling timeout to use when no data packets are waiting to be sent.
- Parameters
-
to timeout in milliseconds.
Definition at line 367 of file oqueue.h.
void DestinationListHandler::unlockDestinationList
(
)
const
inlineinherited
void DestinationListHandler::writeLockDestinationList
(
)
const
inlineprotectedinherited
Field Documentation
bool OutgoingDataQueue::complete
Mutex OutgoingDataQueue::cryptoMutex
mutableprotected
uint32 OutgoingDataQueue::initialTimestamp
private
bool OutgoingDataQueue::marked
uint32 OutgoingDataQueue::octetCount
timeval OutgoingDataQueue::overflowTime
uint32 OutgoingDataQueue::packetCount
uint8 OutgoingDataQueue::paddinglen
uint16 OutgoingDataQueue::sendCC
struct { ... } OutgoingDataQueue::sendInfo
uint16 OutgoingDataQueue::sendSeq
uint32 OutgoingDataQueue::sendSources[16]
The documentation for this class was generated from the following file: