#include <cqueue.h>
Public Member Functions | |
RTCPSenderInfo * | getMRSenderInfo (SyncSource &src) |
Get the most recent sender report received from a synchronization source. | |
RTCPReceiverInfo * | getMRReceiverInfo (SyncSource &srcFrom) |
Ask for the info in the most recent receiver report about the local source received from the source given as parameter. | |
void | setLeavingDelay (microtimeout_t delay) |
Set how much time the stack will wait before deleting a synchronization source that has sent an RTCP BYE packet. | |
void | setEnd2EndDelay (microtimeout_t t) |
This method sets the maximum end to end delay allowed. | |
microtimeout_t | getDefaultEnd2EndDelay () const |
microtimeout_t | getEnd2EndDelay () const |
void | setSendersControlFraction (float fraction) |
Specify the fraction of the total control bandwith to be dedicated to senders reports. | |
void | setMinRTCPInterval (microtimeout_t interval) |
Manually set the minimum interval for sending RTP compound packets. | |
uint32 | getSendRTCPPacketCount () const |
Get the total number of RTCP packets sent until now. | |
Protected Member Functions | |
QueueRTCPManager (uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) | |
QueueRTCPManager (uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) | |
virtual | ~QueueRTCPManager () |
const RTPApplication & | getApplication () |
void | setControlBandwidth (float fraction) |
float | getControlBandwidth () const |
void | controlTransmissionService () |
Build and send RTCP packets following timing rules (including the "timer reconsideration" algorithm). | |
void | controlReceptionService () |
Process incoming RTCP packets pending in the control reception socket. | |
bool | checkSSRCInRTCPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp) |
Appy collision and loop detection and correction algorithm when receiving RTCP packets. | |
void | endQueueRTCPManager () |
virtual void | onGotSR (SyncSource &source, SendReport &SR, uint8 blocks) |
Plug-in for processing (acquire information carried in) an incoming RTCP Sender Report. | |
virtual void | onGotRR (SyncSource &source, RecvReport &RR, uint8 blocks) |
Plug-in for processing (acquire information carried in) an incoming RTCP Receiver Report. | |
bool | onGotSDES (SyncSource &source, RTCPPacket &pkt) |
virtual bool | onGotSDESChunk (SyncSource &source, SDESChunk &chunk, size_t len) |
Plug-in for handling of SDES chunks. | |
virtual void | onGotAPP (SyncSource &, RTCPCompoundHandler::APPPacket &, size_t) |
Plug-in for handling of APP (application specific) RTCP packets. | |
timeval | getRTCPCheckInterval () |
uint32 | getLastSendPacketCount () const |
Get the number of data packets sent at the time the last SR was generated. | |
void | setPrevMembersNum (uint32 n) |
uint32 | getPrevMembersCount () const |
size_t | dispatchBYE (const std::string &reason) |
This method is used to send an RTCP BYE packet. | |
size_t | sendControlToDestinations (unsigned char *buffer, size_t len) |
Extends an RTP data i/o queue adding management of RTCP functions:
Provide feedback on the quality of the data distribution.
Convey the CNAME (persistent transport-level identifier) for every RTP source.
Control the sending rate of RTCP packets
Convey minimal control information about the participants
This class implements generic RTCP behaviour (as specified in RFC 1889/draft-ietf-avt-rtp-new) and may be specialized for specific profiles (see AVPQueue) or particular RTCP extensions.
QueueRTCPManager::QueueRTCPManager | ( | uint32 | size = RTPDataQueue::defaultMembersHashSize , |
|
RTPApplication & | app = defaultApplication() | |||
) | [protected] |
QueueRTCPManager::QueueRTCPManager | ( | uint32 | ssrc, | |
uint32 | size = RTPDataQueue::defaultMembersHashSize , |
|||
RTPApplication & | app = defaultApplication() | |||
) | [protected] |
virtual QueueRTCPManager::~QueueRTCPManager | ( | ) | [protected, virtual] |
RTCPSenderInfo* QueueRTCPManager::getMRSenderInfo | ( | SyncSource & | src | ) |
Get the most recent sender report received from a synchronization source.
src | Synchronization source of the sender info. |
NULL | when no sender report has been received from the specified source. |
RTCPReceiverInfo* QueueRTCPManager::getMRReceiverInfo | ( | SyncSource & | srcFrom | ) |
Ask for the info in the most recent receiver report about the local source received from the source given as parameter.
srcFrom | Source of the receiver info. |
NULL | when no receiver report has been received from the specified source. |
void QueueRTCPManager::setLeavingDelay | ( | microtimeout_t | delay | ) | [inline] |
Set how much time the stack will wait before deleting a synchronization source that has sent an RTCP BYE packet.
delay | delay in microseconds. |
void QueueRTCPManager::setEnd2EndDelay | ( | microtimeout_t | t | ) | [inline] |
This method sets the maximum end to end delay allowed.
If the processing delay plus the trip time for a packet is greater than the end to end delay, the packet is discarded, and the application cannot get it.
This is a way of setting an upper bound to the end to end delay, computed as the elapsed time between the packet timestamping at the sender side, and the picking of the packet at the receiver side.
t | maximum end to end delay allowed. A value of 0 implies there is no limit and is the default |
microtimeout_t QueueRTCPManager::getDefaultEnd2EndDelay | ( | ) | const [inline] |
microtimeout_t QueueRTCPManager::getEnd2EndDelay | ( | ) | const [inline] |
void QueueRTCPManager::setSendersControlFraction | ( | float | fraction | ) | [inline] |
Specify the fraction of the total control bandwith to be dedicated to senders reports.
fraction | fraction of bandwidth, must be between 0 an 1. |
1 - fraction
will be dedicated to receivers reports.
void QueueRTCPManager::setMinRTCPInterval | ( | microtimeout_t | interval | ) | [inline] |
Manually set the minimum interval for sending RTP compound packets.
interval | minimum interval between RTCP packets, in microseconds. |
uint32 QueueRTCPManager::getSendRTCPPacketCount | ( | ) | const [inline] |
Get the total number of RTCP packets sent until now.
const RTPApplication& QueueRTCPManager::getApplication | ( | ) | [inline, protected] |
void QueueRTCPManager::setControlBandwidth | ( | float | fraction | ) | [inline, protected] |
Reimplemented in AVPQueue.
float QueueRTCPManager::getControlBandwidth | ( | ) | const [inline, protected] |
Reimplemented in AVPQueue.
void QueueRTCPManager::controlTransmissionService | ( | ) | [protected] |
Build and send RTCP packets following timing rules (including the "timer reconsideration" algorithm).
void QueueRTCPManager::controlReceptionService | ( | ) | [protected] |
Process incoming RTCP packets pending in the control reception socket.
bool QueueRTCPManager::checkSSRCInRTCPPkt | ( | SyncSourceLink & | sourceLink, | |
bool | is_new, | |||
InetAddress & | na, | |||
tpport_t | tp | |||
) | [protected] |
Appy collision and loop detection and correction algorithm when receiving RTCP packets.
Follows section 8.2 in draft-ietf-avp-rtp-new.
sourceLink | link to the source object. | |
is_new | whether the source has been just recorded. | |
na | RTCP packet network address. | |
tp | RTCP packet source transport port. |
void QueueRTCPManager::endQueueRTCPManager | ( | ) | [protected] |
virtual void QueueRTCPManager::onGotSR | ( | SyncSource & | source, | |
SendReport & | SR, | |||
uint8 | blocks | |||
) | [protected, virtual] |
Plug-in for processing (acquire information carried in) an incoming RTCP Sender Report.
The default implementation in this class only processes the sender information and the receiver report blocks about the local source.
source | Synchronization source this report comes from. | |
SR | Sender report structure. | |
blocks | Number of report blocks in the packet. |
virtual void QueueRTCPManager::onGotRR | ( | SyncSource & | source, | |
RecvReport & | RR, | |||
uint8 | blocks | |||
) | [protected, virtual] |
Plug-in for processing (acquire information carried in) an incoming RTCP Receiver Report.
The default implementation in this class only processes the receiver report blocks about the local source.
source | Synchronization source this report comes from. | |
RR | Receiver report structure | |
blocks | Number of report blocks in the packet |
bool QueueRTCPManager::onGotSDES | ( | SyncSource & | source, | |
RTCPPacket & | pkt | |||
) | [protected] |
source | Synchronization source of SDES RTCP packet. | |
pkt | SDES RTCP packet received. |
virtual bool QueueRTCPManager::onGotSDESChunk | ( | SyncSource & | source, | |
SDESChunk & | chunk, | |||
size_t | len | |||
) | [protected, virtual] |
Plug-in for handling of SDES chunks.
source | Synchronization source of SDES chunk. | |
chunk | SDES chunk structure. | |
len | Length of chunk, in octets. |
virtual void QueueRTCPManager::onGotAPP | ( | SyncSource & | , | |
RTCPCompoundHandler::APPPacket & | , | |||
size_t | ||||
) | [inline, protected, virtual] |
Plug-in for handling of APP (application specific) RTCP packets.
- | Synchronization source of this packet. | |
- | RTCP APP packet struct. | |
- | Length of the app data packet, including ssrc. name and app. specific data. |
timeval QueueRTCPManager::getRTCPCheckInterval | ( | ) | [inline, protected] |
uint32 QueueRTCPManager::getLastSendPacketCount | ( | ) | const [inline, protected] |
Get the number of data packets sent at the time the last SR was generated.
void QueueRTCPManager::setPrevMembersNum | ( | uint32 | n | ) | [inline, protected] |
n | Number of members. |
uint32 QueueRTCPManager::getPrevMembersCount | ( | ) | const [inline, protected] |
size_t QueueRTCPManager::dispatchBYE | ( | const std::string & | reason | ) | [protected, virtual] |
This method is used to send an RTCP BYE packet.
An RTCP BYE packet is sent when one of the the following circumstances occur:
Try to post a BYE message. It will send a BYE packet as long as at least one RTP or RTCP packet has been sent before. If the number of members in the session is more than 50, the algorithm described in section 6.3.7 of RFC 3550 is applied in order to avoid a flood of BYE messages.
reason | reason to specify in the BYE packet. |
Reimplemented from RTPQueueBase.
size_t QueueRTCPManager::sendControlToDestinations | ( | unsigned char * | buffer, | |
size_t | len | |||
) | [protected] |
timeval QueueRTCPManager::rtcpTp |
timeval QueueRTCPManager::rtcpTc |
timeval QueueRTCPManager::rtcpTn |