ccRTP 2.1.2
|
Adds generic management of RTCP functions to an RTP data queue. More...
#include <cqueue.h>
Public Types | |
enum | Tos { tosBestEffort, tosEnhanced } |
rtp.h cc++/rtp.h More... | |
Public Member Functions | |
RTCPSenderInfo * | getMRSenderInfo (SyncSource &src) |
Get the most recent sender report received from a synchronization source. More... | |
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. More... | |
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. More... | |
void | setEnd2EndDelay (microtimeout_t t) |
This method sets the maximum end to end delay allowed. More... | |
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. More... | |
void | setMinRTCPInterval (microtimeout_t interval) |
Manually set the minimum interval for sending RTP compound packets. More... | |
uint32 | getSendRTCPPacketCount () const |
Get the total number of RTCP packets sent until now. More... | |
void | setOutQueueCryptoContextCtrl (CryptoContextCtrl *cc) |
Set ouput queue CryptoContext. More... | |
void | removeOutQueueCryptoContextCtrl (CryptoContextCtrl *cc) |
Remove output queue CryptoContext. More... | |
CryptoContextCtrl * | getOutQueueCryptoContextCtrl (uint32 ssrc) |
Get an output queue CryptoContext identified by SSRC. More... | |
void | setInQueueCryptoContextCtrl (CryptoContextCtrl *cc) |
Set input queue CryptoContext. More... | |
void | removeInQueueCryptoContextCtrl (CryptoContextCtrl *cc) |
Remove input queue CryptoContext. More... | |
CryptoContextCtrl * | getInQueueCryptoContextCtrl (uint32 ssrc) |
Get an input queue CryptoContext identified by SSRC. More... | |
void | setTypeOfService (Tos tos) |
Specify the kind of service the application expects to use. More... | |
void | enableStack () |
Enable packet queue processing in the stack. More... | |
void | disableStack () |
Disable packet queue processing in the stack. More... | |
bool | isActive () const |
Get active connection state flag. More... | |
uint32 | getCurrentTimestamp () const |
Get the timestamp that should be given for a packet whose payload sampling instant corresponds to the current system time. More... | |
void | setSessionBandwidth (uint32 bw) |
Specify the bandwidth of the current session. More... | |
uint32 | getDefaultSessionBandwidth () const |
uint32 | getSessionBandwidth () const |
void | setTimeclock () |
Set the packet timeclock for synchronizing timestamps. More... | |
timeout_t | getTimeclock () const |
Get the packet timeclock for synchronizing timestamps. More... | |
SyncSourcesIterator | begin () |
SyncSourcesIterator | end () |
const AppDataUnit * | getData (uint32 stamp, const SyncSource *src=NULL) |
Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer. More... | |
bool | isWaiting (const SyncSource *src=NULL) const |
Determine if packets are waiting in the reception queue. More... | |
uint32 | getFirstTimestamp (const SyncSource *src=NULL) const |
Get timestamp of first packet waiting in the queue. More... | |
void | setMinValidPacketSequence (uint8 packets) |
When receiving packets from a new source, it may be convenient to reject a first few packets before we are really sure the source is valid. More... | |
uint8 | getDefaultMinValidPacketSequence () const |
uint8 | getMinValidPacketSequence () const |
Get the minimun number of consecutive packets that must be received from a source before accepting its data packets. More... | |
void | setMaxPacketMisorder (uint16 packets) |
uint16 | getDefaultMaxPacketMisorder () const |
uint16 | getMaxPacketMisorder () const |
void | setMaxPacketDropout (uint16 packets) |
It also prevents packets sent after a restart of the source being immediately accepted. More... | |
uint16 | getDefaultMaxPacketDropout () const |
uint16 | getMaxPacketDropout () const |
void | setInQueueCryptoContext (CryptoContext *cc) |
Set input queue CryptoContext. More... | |
void | removeInQueueCryptoContext (CryptoContext *cc) |
Remove input queue CryptoContext. More... | |
CryptoContext * | getInQueueCryptoContext (uint32 ssrc) |
Get an input queue CryptoContext identified by SSRC. More... | |
size_t | getDefaultMaxRecvPacketSize () const |
size_t | getMaxRecvPacketSize () const |
void | setMaxRecvPacketSize (size_t maxsize) |
bool | setPayloadFormat (const PayloadFormat &pf) |
Set the payload format in use, for timing and payload type identification purposes. More... | |
uint32 | getLocalSSRC () const |
uint32 | getCurrentRTPClockRate () const |
Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T). More... | |
PayloadType | getCurrentPayloadType () const |
timeval | getInitialTime () const |
void | setSDESItem (Participant *part, SDESItemType item, const std::string &val) |
void | setPRIVPrefix (Participant *part, const std::string val) |
bool | addDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) |
bool | addDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) |
bool | forgetDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) |
bool | forgetDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) |
void | addContributor (uint32 csrc) |
Add csrc as the CSRC identifier of a new contributor. More... | |
bool | removeContributor (uint32 csrc) |
Remove CSRC from the list of contributors. More... | |
bool | isSending () const |
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... | |
void | setPadding (uint8 paddinglen) |
Set padding. More... | |
void | setMark (bool mark) |
Set marker bit for the packet in which the next data provided will be send. More... | |
bool | getMark () const |
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... | |
microtimeout_t | getDefaultSchedulingTimeout () const |
void | setSchedulingTimeout (microtimeout_t to) |
Set the default scheduling timeout to use when no data packets are waiting to be sent. More... | |
microtimeout_t | getDefaultExpireTimeout () const |
void | setExpireTimeout (microtimeout_t to) |
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... | |
microtimeout_t | getExpireTimeout () const |
uint32 | getSendPacketCount () const |
Get the total number of packets sent so far. More... | |
uint32 | getSendOctetCount () const |
Get the total number of octets (payload only) sent so far. More... | |
uint16 | getSequenceNumber () const |
Get the sequence number of the next outgoing packet. More... | |
void | setOutQueueCryptoContext (CryptoContext *cc) |
Set ouput queue CryptoContext. More... | |
void | removeOutQueueCryptoContext (CryptoContext *cc) |
Remove output queue CryptoContext. More... | |
CryptoContext * | getOutQueueCryptoContext (uint32 ssrc) |
Get an output queue CryptoContext identified by SSRC. More... | |
size_t | getDefaultMaxSendSegmentSize () |
void | setMaxSendSegmentSize (size_t size) |
Set maximum payload segment size before fragmenting sends. More... | |
size_t | getMaxSendSegmentSize () |
Static Public Member Functions | |
static size_t | getDefaultMembersSize () |
Protected Types | |
enum | { defaultPathMTU = 1500 } |
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). More... | |
void | controlReceptionService () |
Process incoming RTCP packets pending in the control reception socket. More... | |
bool | checkSSRCInRTCPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp) |
Appy collision and loop detection and correction algorithm when receiving RTCP packets. More... | |
void | endQueueRTCPManager () |
virtual void | onGotSR (SyncSource &source, SendReport &SR, uint8 blocks) |
Plug-in for processing (acquire information carried in) an incoming RTCP Sender Report. More... | |
virtual void | onGotRR (SyncSource &source, RecvReport &RR, uint8 blocks) |
Plug-in for processing (acquire information carried in) an incoming RTCP Receiver Report. More... | |
bool | onGotSDES (SyncSource &source, RTCPPacket &pkt) |
virtual bool | onGotSDESChunk (SyncSource &source, SDESChunk &chunk, size_t len) |
Plug-in for handling of SDES chunks. More... | |
virtual void | onGotAPP (SyncSource &, RTCPCompoundHandler::APPPacket &, size_t) |
Plug-in for handling of APP (application specific) RTCP packets. More... | |
timeval | getRTCPCheckInterval () |
uint32 | getLastSendPacketCount () const |
Get the number of data packets sent at the time the last SR was generated. More... | |
void | setPrevMembersNum (uint32 n) |
uint32 | getPrevMembersCount () const |
size_t | dispatchBYE (const std::string &reason) |
This method is used to send an RTCP BYE packet. More... | |
size_t | sendControlToDestinations (unsigned char *buffer, size_t len) |
virtual void | timerTick () |
A plugin point for timer tick driven events. More... | |
void | renewLocalSSRC () |
void | endQueue () |
This method ends the queue. More... | |
virtual bool | isPendingData (microtimeout_t timeout)=0 |
This function is used to check for and schedule against arriving packets based on the derived connection type. More... | |
bool | checkSSRCInIncomingRTPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp) |
Apply collision and loop detection and correction algorithm when receiving RTP data packets. More... | |
void | setSourceExpirationPeriod (uint8 intervals) |
Set the number of RTCP intervals that the stack will wait to change the state of a source from stateActive to stateInactive, or to delete the source after being in stateInactive. More... | |
virtual size_t | takeInDataPacket () |
This function is used by the service thread to process the next incoming packet and place it in the receive list. More... | |
IncomingDataQueue::IncomingRTPPktLink * | getWaiting (uint32 timestamp, const SyncSource *src=NULL) |
This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp. More... | |
bool | recordReception (SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime) |
Log reception of a new RTP packet from this source. More... | |
void | recordExtraction (const IncomingRTPPkt &pkt) |
Log extraction of a packet from this source from the scheduled reception queue. More... | |
void | purgeIncomingQueue () |
virtual void | onNewSyncSource (const SyncSource &) |
Virtual called when a new synchronization source has joined the session. More... | |
virtual bool | onRTPPacketRecv (IncomingRTPPkt &) |
A virtual function to support parsing of arriving packets to determine if they should be kept in the queue and to dispatch events. More... | |
virtual void | onExpireRecv (IncomingRTPPkt &) |
A hook to filter packets in the receive queue that are being expired. More... | |
virtual bool | onSRTPPacketError (IncomingRTPPkt &pkt, int32 errorCode) |
A hook that gets called if the decoding of an incoming SRTP was erroneous. More... | |
bool | insertRecvPacket (IncomingRTPPktLink *packetLink) |
Insert a just received packet in the queue (both general and source specific queues). More... | |
virtual size_t | recvData (unsigned char *buffer, size_t length, InetHostAddress &host, tpport_t &port)=0 |
This function performs the physical I/O for reading a packet from the source. More... | |
virtual size_t | getNextDataPacketSize () const =0 |
void | setLocalSSRC (uint32 ssrc) |
uint32 | getLocalSSRCNetwork () const |
size_t | getDefaultMembersHashSize () |
SyncSourceLink * | getLink (const SyncSource &source) const |
bool | isMine (const SyncSource &source) const |
Get whether a synchronization source is recorded in this membership controller. More... | |
bool | isRegistered (uint32 ssrc) |
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier. More... | |
SyncSourceLink * | getSourceBySSRC (uint32 ssrc, bool &created) |
Get the description of a source by its ssrc identifier. More... | |
bool | BYESource (uint32 ssrc) |
Mark the source identified by ssrc as having sent a BYE packet. More... | |
bool | removeSource (uint32 ssrc) |
Remove the description of the source identified by ssrc More... | |
SyncSourceLink * | getFirst () |
SyncSourceLink * | getLast () |
uint32 | getMembersCount () |
void | setMembersCount (uint32 n) |
uint32 | getSendersCount () |
void | setLink (SyncSource &source, void *link) |
void | setParticipant (SyncSource &source, Participant &p) |
void | setState (SyncSource &source, SyncSource::State ns) |
void | setSender (SyncSource &source, bool active) |
void | setDataTransportPort (SyncSource &source, tpport_t p) |
void | setControlTransportPort (SyncSource &source, tpport_t p) |
void | setNetworkAddress (SyncSource &source, InetAddress addr) |
void | addParticipant (RTPApplication &app, Participant &part) |
void | removeParticipant (RTPApplication &app, RTPApplication::ParticipantLink *pl) |
ConflictingTransportAddress * | searchDataConflict (InetAddress na, tpport_t dtp) |
ConflictingTransportAddress * | searchControlConflict (InetAddress na, tpport_t ctp) |
void | updateConflict (ConflictingTransportAddress &ca) |
void | addConflict (const InetAddress &na, tpport_t dtp, tpport_t ctp) |
void | dispatchImmediate (OutgoingRTPPkt *packet) |
This is used to write the RTP data packet to one or more destinations. More... | |
microtimeout_t | getSchedulingTimeout () |
This computes the timeout period for scheduling transmission of the next packet at the "head" of the send buffer. More... | |
size_t | dispatchDataPacket () |
This function is used by the service thread to process the next outgoing packet pending in the sending queue. More... | |
void | setNextSeqNum (uint32 seqNum) |
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... | |
uint32 | getCurrentSeqNum (void) |
void | setInitialTimestamp (uint32 ts) |
uint32 | getInitialTimestamp () |
void | purgeOutgoingQueue () |
virtual void | setControlPeer (const InetAddress &host, tpport_t port) |
bool | isSingleDestination () const |
Get whether there is only a destination in the list. More... | |
TransportAddress * | getFirstDestination () const |
void | lockDestinationList () const |
void | unlockDestinationList () const |
void | writeLockDestinationList () const |
bool | addDestinationToList (const InetAddress &ia, tpport_t data, tpport_t control) |
Locks the object before modifying it. More... | |
bool | removeDestinationFromList (const InetAddress &ia, tpport_t dataPort, tpport_t controlPort) |
Locks the object before modifying it. More... | |
void | setPathMTU (uint16 mtu) |
uint16 | getPathMTU () |
bool | checkCompoundRTCPHeader (size_t len) |
Perform RTCP compound packet header validity check as specified in draft-ietv-avt-rtp-new. More... | |
Protected Attributes | |
ThreadLock | recvLock |
IncomingRTPPktLink * | recvFirst |
IncomingRTPPktLink * | recvLast |
uint8 | minValidPacketSequence |
uint16 | maxPacketMisorder |
uint16 | maxPacketDropout |
uint8 | sourceExpirationPeriod |
Mutex | cryptoMutex |
Mutex | cryptoMutex |
std::list< CryptoContext * > | cryptoContexts |
std::list< CryptoContext * > | cryptoContexts |
ConflictingTransportAddress * | firstConflict |
ConflictingTransportAddress * | lastConflict |
std::list< TransportAddress * > | destList |
unsigned char * | rtcpSendBuffer |
unsigned char * | rtcpRecvBuffer |
Static Protected Attributes | |
static const uint8 | defaultMinValidPacketSequence = 0 |
static const uint16 | defaultMaxPacketMisorder = 0 |
static const uint16 | defaultMaxPacketDropout = 3000 |
static const size_t | defaultMembersSize |
static const size_t | defaultMembersHashSize = 11 |
static const uint32 | SEQNUMMOD = (1<<16) |
Private Member Functions | |
QueueRTCPManager (const QueueRTCPManager &o) | |
QueueRTCPManager & | operator= (const QueueRTCPManager &o) |
size_t | dispatchControlPacket () |
Posting of RTCP messages. More... | |
void | takeInControlPacket () |
For picking up incoming RTCP packets if they are waiting. More... | |
virtual timeval | computeRTCPInterval () |
Computes the interval for sending RTCP compound packets, based on the average size of RTCP packets sent and received, and the current estimated number of participants in the session. More... | |
virtual SDESItemType | scheduleSDESItem () |
Choose which should be the type of the next SDES item sent. More... | |
virtual void | onSSRCCollision (const SyncSource &) |
Plug-in for SSRC collision handling. More... | |
virtual bool | end2EndDelayed (IncomingRTPPktLink &p) |
Virtual reimplemented from RTPDataQueue. More... | |
virtual void | onGotRRSRExtension (unsigned char *, size_t) |
Plug-in for processing of SR/RR RTCP packet profile-specific extensions (third part of SR reports or second part of RR reports). More... | |
virtual void | onGotGoodbye (const SyncSource &, const std::string &) |
A plugin point for goodbye message. More... | |
bool | getBYE (RTCPPacket &pkt, size_t &pointer, size_t len) |
Process a BYE packet just received and identified. More... | |
uint8 | packReportBlocks (RRBlock *blocks, uint16 &len, uint16 &available) |
void | packSDES (uint16 &len) |
Builds an SDES RTCP packet. More... | |
void | updateAvgRTCPSize (size_t len) |
This must be called in order to update the average RTCP compound packet size estimation when: More... | |
void | reverseReconsideration () |
Apply reverse reconsideration adjustment to timing parameters when receiving BYE packets and not waiting to send a BYE. More... | |
bool | timerReconsideration () |
void | expireSSRCs () |
Purge sources that do not seem active any more. More... | |
void | getOnlyBye () |
To be executed when whe are leaving the session. More... | |
void | setSDESItem (Participant *part, SDESItemType type, const char *const value, size_t len) |
Set item value from a string without null termination (as it is transported in RTCP packets). More... | |
void | setPRIVPrefix (Participant *part, const char *const value, size_t len) |
Set PRIV item previx value from a string without null termination (as it is transported in RTCP packets). More... | |
virtual uint16 | networkHeaderSize () |
For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed. More... | |
virtual uint16 | transportHeaderSize () |
For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed. More... | |
int32 | protect (uint8 *pkt, size_t len, CryptoContextCtrl *cc) |
int32 | unprotect (uint8 *pkt, size_t len, CryptoContextCtrl *cc) |
SDESItemType | nextSDESType (SDESItemType t) |
virtual size_t | sendControl (const unsigned char *const buffer, size_t len)=0 |
virtual size_t | recvControl (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)=0 |
virtual bool | isPendingControl (microtimeout_t timeout)=0 |
Private Attributes | |
volatile bool | controlServiceActive |
float | controlBwFract |
float | sendControlBwFract |
float | recvControlBwFract |
uint32 | ctrlSendCount |
uint16 | lowerHeadersSize |
SDESItemType | nextScheduledSDESItem |
struct { | |
timeval rtcpTp | |
timeval rtcpTc | |
timeval rtcpTn | |
uint32 rtcpPMembers | |
} | reconsInfo |
bool | rtcpWeSent |
uint16 | rtcpAvgSize |
bool | rtcpInitial |
timeval | rtcpLastCheck |
timeval | rtcpCheckInterval |
timeval | rtcpNextCheck |
uint32 | lastSendPacketCount |
microtimeout_t | rtcpMinInterval |
microtimeout_t | leavingDelay |
microtimeout_t | end2EndDelay |
RTPApplication & | queueApplication |
Mutex | outCryptoMutex |
std::list< CryptoContextCtrl * > | outCryptoContexts |
uint32 | srtcpIndex |
Mutex | inCryptoMutex |
std::list< CryptoContextCtrl * > | inCryptoContexts |
Static Private Attributes | |
static const SDESItemType | firstSchedulable = SDESItemTypeNAME |
static const SDESItemType | lastSchedulable = SDESItemTypePRIV |
static const microtimeout_t | defaultEnd2EndDelay = 0 |
maximum end to end delay: unlimited More... | |
static const uint16 | TIMEOUT_MULTIPLIER = 5 |
static const double | RECONSIDERATION_COMPENSATION = 2.718281828 - 1.5 |
Adds generic management of RTCP functions to an RTP data queue.
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.
|
protectedinherited |
|
inherited |
rtp.h cc++/rtp.h
Type of network service the application uses.
If the application uses enhanced network service, for instance Integrated Services or Differentiated Services, it has not to ensure fair competition with TCP, provided that the requested service is actually being delivered. Whenever the application uses best-effort service or the requested enhanced service is not actually being delivered, it has to ensure fair competition with TCP. By default, best-effot is assumed.
Enumerator | |
---|---|
tosBestEffort |
Best-effort network service. |
tosEnhanced |
Enhanced network service. |
|
protected |
Definition at line 61 of file control.cpp.
|
protected |
Definition at line 111 of file control.cpp.
|
protectedvirtual |
Definition at line 162 of file control.cpp.
|
private |
|
inherited |
Definition at line 75 of file incqueue.cpp.
|
inherited |
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.
|
inherited |
Definition at line 219 of file outqueue.cpp.
|
inherited |
Definition at line 233 of file outqueue.cpp.
|
protectedinherited |
Locks the object before modifying it.
Definition at line 74 of file outqueue.cpp.
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
Mark the source identified by ssrc
as having sent a BYE packet.
It is not deleted until a timeout expires, so that in case some packets from this source arrive a bit later the source is not inserted again in the table of known sources.
Definition at line 282 of file members.cpp.
|
protectedinherited |
Perform RTCP compound packet header validity check as specified in draft-ietv-avt-rtp-new.
This method follows appendix A.2. Correct version, payload type, padding bit and length of every RTCP packet in the compound are verified.
len | length of the RTCP compound packet in the reception buffer |
Definition at line 107 of file rtcppkt.cpp.
|
protectedinherited |
Apply collision and loop detection and correction algorithm when receiving RTP data packets.
Follows section 8.2 in draft-ietf-avt-rtp-new.
sourceLink | link to the source object. |
is_new | whether the source has been just recorded. |
na | data packet network address. |
tp | data packet source transport port. |
Definition at line 299 of file incqueue.cpp.
|
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. |
Definition at line 176 of file control.cpp.
|
privatevirtual |
Computes the interval for sending RTCP compound packets, based on the average size of RTCP packets sent and received, and the current estimated number of participants in the session.
Definition at line 698 of file control.cpp.
|
protected |
Process incoming RTCP packets pending in the control reception socket.
Definition at line 242 of file control.cpp.
|
protected |
Build and send RTCP packets following timing rules (including the "timer reconsideration" algorithm).
Definition at line 264 of file control.cpp.
|
inlineinherited |
|
protectedvirtual |
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.
Definition at line 745 of file control.cpp.
|
private |
Posting of RTCP messages.
Definition at line 858 of file control.cpp.
|
protectedinherited |
This function is used by the service thread to process the next outgoing packet pending in the sending queue.
Definition at line 549 of file outqueue.cpp.
|
protectedinherited |
This is used to write the RTP data packet to one or more destinations.
It is used by both sendImmediate and by dispatchDataPacket.
RTP | packet to send. |
Definition at line 505 of file outqueue.cpp.
|
inlineinherited |
|
inlineinherited |
|
privatevirtual |
Virtual reimplemented from RTPDataQueue.
Reimplemented from IncomingDataQueue.
Definition at line 471 of file control.cpp.
|
protectedinherited |
|
protected |
Definition at line 167 of file control.cpp.
|
private |
Purge sources that do not seem active any more.
Definition at line 310 of file control.cpp.
|
inherited |
Definition at line 247 of file outqueue.cpp.
|
inherited |
Definition at line 257 of file outqueue.cpp.
|
inlineprotected |
|
private |
Process a BYE packet just received and identified.
pkt | previously identified RTCP BYE packet |
pointer | octet number in the RTCP reception buffer where the packet is stored |
len | total length of the compount RTCP packet the BYE packet to process is contained |
Definition at line 529 of file control.cpp.
|
inlineprotected |
|
inlineinherited |
Definition at line 198 of file queuebase.h.
|
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().
Definition at line 195 of file queuebase.h.
|
inlineprotectedinherited |
|
inherited |
Get the timestamp that should be given for a packet whose payload sampling instant corresponds to the current system time.
The timestamp applications should provide for each packet represents the sampling instant of its payload and should not be a reading of the system clock. Nevertheless, the internal operation of the RTP stack relies on the accuracy of the provided timestamp, since several computations assume that there is a certain degree of correspondence between the timestamp and the system clock.
It is recommended that applications use this method in order to periodically adjust the RTP timestamp.
In particular, it is advisable getting the timestamp corresponding to the first sampling instant or any instant after a period of inactivity through a call to this method.
Applications should use the nominal sampling or any other value provided by the coder in order to compute the next timestamps with minimum computational requirement.
For instance, an application using an RTP profile that specifies a fixed sampling rate of 8 Khz with eight bits per sample, continuously transmitting audio blocks 80 octets long, would transmit 100 packets every second. Every packet would carry a timestamp 80 units greater than the previous one. So, the first timestamp would be obtained from this method, whereas the following ones would be computed adding 80 every time. Also the timestamp should be increased for every block whether it is put in the queue or dropped.
The aforementioned increment can be obtained from the RTPDataQueue::getTimestampIncrement() method rather than computing it by hand in the application.
|
inherited |
Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer.
stamp | Data unit timestamp. |
src | Optional synchronization source selector. |
null | pointer if no packet with such timestamp is available. |
Definition at line 472 of file incqueue.cpp.
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 298 of file queuebase.h.
|
inlineinherited |
Definition at line 259 of file queuebase.h.
|
inlineinherited |
|
inlinestaticinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineinherited |
|
inherited |
Get timestamp of first packet waiting in the queue.
src | optional source selector. |
Definition at line 158 of file incqueue.cpp.
|
inlineinherited |
Definition at line 201 of file queuebase.h.
|
inlineprotectedinherited |
|
inherited |
Get an input queue CryptoContext identified by SSRC.
ssrc | Request CryptoContext for this incoming SSRC |
Definition at line 773 of file incqueue.cpp.
CryptoContextCtrl * QueueRTCPManager::getInQueueCryptoContextCtrl | ( | uint32 | ssrc | ) |
Get an input queue CryptoContext identified by SSRC.
ssrc | Request CryptoContext for this incoming SSRC |
Definition at line 1339 of file control.cpp.
|
inlineprotectedinherited |
|
inlineprotected |
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 184 of file queuebase.h.
|
inlineprotectedinherited |
Definition at line 214 of file queuebase.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 302 of file queuebase.h.
|
inlineinherited |
Definition at line 273 of file queuebase.h.
|
inlineprotectedinherited |
|
inlineinherited |
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. |
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. |
|
protectedpure virtualinherited |
Implemented in RTPDuplex.
|
private |
To be executed when whe are leaving the session.
Definition at line 816 of file control.cpp.
|
inherited |
Get an output queue CryptoContext identified by SSRC.
ssrc | Request CryptoContext for this incoming SSRC |
Definition at line 661 of file outqueue.cpp.
CryptoContextCtrl * QueueRTCPManager::getOutQueueCryptoContextCtrl | ( | uint32 | ssrc | ) |
Get an output queue CryptoContext identified by SSRC.
ssrc | Request CryptoContext for this incoming SSRC |
Definition at line 1281 of file control.cpp.
|
inlineprotected |
|
inlineprotected |
|
protectedinherited |
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.
Definition at line 303 of file outqueue.cpp.
|
inlineprotectedinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
protectedinherited |
Get the description of a source by its ssrc
identifier.
ssrc | SSRC identifier, in host order. |
created | whether a new source has been created. |
ssrc
. Definition at line 226 of file members.cpp.
|
inlineinherited |
|
protectedinherited |
This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp.
timestamp | timestamp requested. |
src | optional source selector |
Definition at line 496 of file incqueue.cpp.
|
protectedinherited |
Insert a just received packet in the queue (both general and source specific queues).
If the packet was already in the queue (same SSRC and sequence number), it is not inserted but deleted.
packetLink | link to a packet just received and generally validated and processed by onRTPPacketRecv. |
false | when the packet is duplicated (there is already a packet from the same source with the same timestamp). |
true | when the packet is not duplicated. |
Definition at line 369 of file incqueue.cpp.
|
inlineinherited |
|
inlineprotectedinherited |
|
privatepure virtual |
|
protectedpure virtualinherited |
This function is used to check for and schedule against arriving packets based on the derived connection type.
number | of microseconds to wait. |
Implemented in RTPDuplex.
|
protectedinherited |
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
Definition at line 205 of file members.cpp.
|
inherited |
Determine if outgoing packets are waiting to send.
Definition at line 294 of file outqueue.cpp.
|
inlineinherited |
|
inherited |
Determine if packets are waiting in the reception queue.
src | Optional synchronization source selector. |
Definition at line 144 of file incqueue.cpp.
|
inlineinherited |
|
inlineprivatevirtual |
For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed.
This method provides the size of the network level header for the default case of IP (20 octets). In case other protocol with different header size is used, this method should be redefined in a new specialized class.
|
private |
Definition at line 1116 of file control.cpp.
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtual |
|
inlineprivatevirtual |
|
protectedvirtual |
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 |
Definition at line 509 of file control.cpp.
|
inlineprivatevirtual |
|
protected |
source | Synchronization source of SDES RTCP packet. |
pkt | SDES RTCP packet received. |
Definition at line 597 of file control.cpp.
|
protectedvirtual |
Plug-in for handling of SDES chunks.
source | Synchronization source of SDES chunk. |
chunk | SDES chunk structure. |
len | Length of chunk, in octets. |
Definition at line 629 of file control.cpp.
|
protectedvirtual |
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. |
Definition at line 502 of file control.cpp.
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtualinherited |
A virtual function to support parsing of arriving packets to determine if they should be kept in the queue and to dispatch events.
A generic header validity check (as specified in RFC 1889) is performed on every incoming packet. If the generic check completes succesfully, this method is called before the packet is actually inserted into the reception queue.
May be used to perform additional validity checks or to do some application specific processing.
- | packet just received. |
|
inlineprotectedvirtualinherited |
A hook that gets called if the decoding of an incoming SRTP was erroneous.
pkt | The SRTP packet with error. |
errorCode | The error code: -1 - SRTP authentication failure, -2 - replay check failed |
Reimplemented in ZrtpQueue.
|
inlineprivatevirtual |
|
private |
|
private |
Definition at line 1030 of file control.cpp.
|
private |
Builds an SDES RTCP packet.
Each chunk is built following appendix A.4 in draft-ietf-avt-rtp-new.
len | provisionary length of the RTCP compound packet |
Definition at line 977 of file control.cpp.
|
private |
Definition at line 1168 of file control.cpp.
|
protectedinherited |
Definition at line 105 of file incqueue.cpp.
|
protectedinherited |
Definition at line 203 of file outqueue.cpp.
|
inherited |
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.
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. |
Definition at line 404 of file outqueue.cpp.
|
protectedinherited |
Log extraction of a packet from this source from the scheduled reception queue.
pkt | Packet extracted from the queue. |
Definition at line 725 of file incqueue.cpp.
|
protectedinherited |
Log reception of a new RTP packet from this source.
Usually updates data such as the packet counter, the expected sequence number for the next packet and the time the last packet was received at.
srcLink | Link structure for the synchronization source of this packet. |
pkt | Packet just created and to be logged. |
recvtime | Reception time. |
Definition at line 632 of file incqueue.cpp.
|
privatepure virtual |
|
protectedpure virtualinherited |
This function performs the physical I/O for reading a packet from the source.
It is a virtual that is overriden in the derived class.
buffer | of read packet. |
length | of data to read. |
host | address of source. |
port | number of source. |
Implemented in RTPDuplex.
|
inherited |
Remove CSRC from the list of contributors.
|
protectedinherited |
Locks the object before modifying it.
Definition at line 85 of file outqueue.cpp.
|
inherited |
Remove input queue CryptoContext.
The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext to remove. If pointer if NULL then delete the whole queue |
Definition at line 748 of file incqueue.cpp.
void QueueRTCPManager::removeInQueueCryptoContextCtrl | ( | CryptoContextCtrl * | cc | ) |
Remove input queue CryptoContext.
The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext to remove. If pointer if NULL then delete the whole queue |
Definition at line 1314 of file control.cpp.
|
inherited |
Remove output queue CryptoContext.
The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext to remove. |
Definition at line 636 of file outqueue.cpp.
void QueueRTCPManager::removeOutQueueCryptoContextCtrl | ( | CryptoContextCtrl * | cc | ) |
Remove output queue CryptoContext.
The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext to remove. |
Definition at line 1256 of file control.cpp.
|
inlineinherited |
|
protectedinherited |
Remove the description of the source identified by ssrc
Definition at line 295 of file members.cpp.
|
inlineprotectedvirtualinherited |
Reimplemented from RTPQueueBase.
|
private |
Apply reverse reconsideration adjustment to timing parameters when receiving BYE packets and not waiting to send a BYE.
Definition at line 568 of file control.cpp.
|
privatevirtual |
Choose which should be the type of the next SDES item sent.
This method is called when packing SDES chunks in a new RTCP packet.
Definition at line 1095 of file control.cpp.
|
inherited |
na | Inet network address. |
ctp | Data transport port. |
Definition at line 64 of file incqueue.cpp.
|
inherited |
na | Inet network address. |
dtp | Data transport port. |
Definition at line 54 of file incqueue.cpp.
|
privatepure virtual |
|
protected |
Definition at line 1124 of file control.cpp.
|
inherited |
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.
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. |
Definition at line 464 of file outqueue.cpp.
|
inlineprotected |
|
inlineprotectedvirtualinherited |
|
inlineinherited |
|
inlineinherited |
|
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 |
|
inlineinherited |
|
inlineprotectedinherited |
|
inherited |
Set input queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext. |
Definition at line 729 of file incqueue.cpp.
void QueueRTCPManager::setInQueueCryptoContextCtrl | ( | CryptoContextCtrl * | cc | ) |
Set input queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext. |
Definition at line 1295 of file control.cpp.
|
inline |
|
inlineinherited |
|
inlineprotectedinherited |
Definition at line 211 of file queuebase.h.
|
inlineinherited |
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.
mark | Marker bit value for next packet. |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
maxsize | maximum length of received RTP data packets, in octets. Defaults to the value returned by getDefaultMaxRecvPacketSize(). |
Definition at line 316 of file queuebase.h.
|
inlineinherited |
Set maximum payload segment size before fragmenting sends.
size | Maximum payload size. |
Definition at line 269 of file queuebase.h.
|
inlineprotectedinherited |
|
inline |
Manually set the minimum interval for sending RTP compound packets.
interval | minimum interval between RTCP packets, in microseconds. |
|
inlineinherited |
When receiving packets from a new source, it may be convenient to reject a first few packets before we are really sure the source is valid.
This method sets how many data packets must be received in sequence before the source is considered valid and the stack starts to accept its packets.
packets | number of sequential packet required |
|
inlineinherited |
|
inlineprotectedinherited |
|
inherited |
Set ouput queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext. |
Definition at line 617 of file outqueue.cpp.
void QueueRTCPManager::setOutQueueCryptoContextCtrl | ( | CryptoContextCtrl * | cc | ) |
Set ouput queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
cc | Pointer to initialized CryptoContext. |
Definition at line 1237 of file control.cpp.
|
inlineinherited |
|
inherited |
Set partial data for an already queued packet.
This is often used for multichannel data.
timestamp | Timestamp of packet. |
data | Buffer to copy from. |
offset | Offset to copy from. |
max | Maximum data size. |
Definition at line 581 of file outqueue.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Set the payload format in use, for timing and payload type identification purposes.
pf | payload format to use from now on. |
Definition at line 177 of file queuebase.h.
|
inlineprotected |
|
inlineinherited |
|
private |
Set PRIV item previx value from a string without null termination (as it is transported in RTCP packets).
Definition at line 1086 of file control.cpp.
|
inlineinherited |
|
inlineinherited |
|
private |
Set item value from a string without null termination (as it is transported in RTCP packets).
Definition at line 1076 of file control.cpp.
|
inlineinherited |
|
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. |
This method sets the fraction of the global control bandwidth that will be dedicated to senders reports. Of course, 1 - fraction
will be dedicated to receivers reports.
|
inlineinherited |
Specify the bandwidth of the current session.
bw | bandwidth of the current session, in bits/s. |
|
inlineprotectedinherited |
Set the number of RTCP intervals that the stack will wait to change the state of a source from stateActive to stateInactive, or to delete the source after being in stateInactive.
Note that this value should be uniform accross all participants and SHOULD be fixed for a particular profile.
intervals | number of RTCP report intervals |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Specify the kind of service the application expects to use.
tos | type of service the application expects to use |
|
private |
For picking up incoming RTCP packets if they are waiting.
A timeout for the maximum interval since the last RTCP packet had been received is also returned. This is checked every rtcpCheckInterval seconds.
This method decomposes all incoming RTCP compound packets pending in the control socket and processes each RTCP packet.
Definition at line 314 of file control.cpp.
|
protectedvirtualinherited |
This function is used by the service thread to process the next incoming packet and place it in the receive list.
Reimplemented in ZrtpQueue.
Definition at line 181 of file incqueue.cpp.
|
private |
Definition at line 294 of file control.cpp.
|
inlineprotectedvirtualinherited |
|
inlineprivatevirtual |
For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed.
This method provides the size of the transport level header for the default case of UDP (8 octets). In case other protocol with different header size is used, this method should be redefined in a new specialized class.
return size of the headers of the transport level. UDP (8) by default
|
inlineinherited |
|
private |
Definition at line 1194 of file control.cpp.
|
private |
This must be called in order to update the average RTCP compound packet size estimation when:
a compoung RTCP packet is received (6.3.3).
a compound RTCP packet is transmitted (6.3.6).
len | length in octets of the compound RTCP packet just received/transmitted. |
Definition at line 522 of file control.cpp.
|
inlineinherited |
|
inlineprotectedinherited |
|
private |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
mutableprotectedinherited |
|
staticprivate |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
private |
|
protectedinherited |
|
staticprivate |
|
private |
|
protectedinherited |
|
staticprivate |
|
private |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
|
private |
|
private |
|
staticprivate |
struct { ... } QueueRTCPManager::reconsInfo |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
private |
|
protectedinherited |
|
protectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
staticprivate |