ccRTP 2.1.2
|
Queue for incoming RTP data packets in an RTP session. More...
#include <iqueue.h>
Data Structures | |
class | SyncSourcesIterator |
iterator through the list of synchronizations sources in this session More... | |
Public Member Functions | |
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 |
Static Public Member Functions | |
static size_t | getDefaultMembersSize () |
Protected Member Functions | |
IncomingDataQueue (uint32 size) | |
virtual | ~IncomingDataQueue () |
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... | |
void | renewLocalSSRC () |
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... | |
virtual bool | end2EndDelayed (IncomingRTPPktLink &) |
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 |
virtual size_t | dispatchBYE (const std::string &) |
A plugin point for posting of BYE messages. More... | |
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 | setSDESItem (Participant *part, SDESItemType item, const std::string &val) |
void | setPRIVPrefix (Participant *part, const std::string val) |
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) |
Protected Attributes | |
ThreadLock | recvLock |
IncomingRTPPktLink * | recvFirst |
IncomingRTPPktLink * | recvLast |
uint8 | minValidPacketSequence |
uint16 | maxPacketMisorder |
uint16 | maxPacketDropout |
uint8 | sourceExpirationPeriod |
Mutex | cryptoMutex |
std::list< CryptoContext * > | cryptoContexts |
ConflictingTransportAddress * | firstConflict |
ConflictingTransportAddress * | lastConflict |
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) |
|
protected |
size | initial size of the membership table. |
Definition at line 94 of file incqueue.cpp.
|
inlineprotectedvirtual |
|
inherited |
Definition at line 75 of file incqueue.cpp.
|
inlineinherited |
|
inline |
|
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.
|
protected |
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.
|
inlineprotectedvirtualinherited |
A plugin point for posting of BYE messages.
- | reason to leave the RTP session. |
Reimplemented in QueueRTCPManager.
Definition at line 228 of file queuebase.h.
|
inline |
|
inlineprotectedvirtual |
Reimplemented in QueueRTCPManager.
|
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.
const AppDataUnit * IncomingDataQueue::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.
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 |
|
inline |
|
inlineinherited |
Definition at line 298 of file queuebase.h.
|
inlineinherited |
|
inlinestatic |
|
inline |
|
inlineprotectedinherited |
uint32 IncomingDataQueue::getFirstTimestamp | ( | const SyncSource * | src = NULL | ) | const |
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.
CryptoContext * IncomingDataQueue::getInQueueCryptoContext | ( | uint32 | ssrc | ) |
Get an input queue CryptoContext identified by SSRC.
ssrc | Request CryptoContext for this incoming SSRC |
Definition at line 773 of file incqueue.cpp.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 184 of file queuebase.h.
|
inlineprotectedinherited |
Definition at line 214 of file queuebase.h.
|
inline |
|
inline |
|
inlineinherited |
Definition at line 302 of file queuebase.h.
|
inlineprotectedinherited |
|
inline |
|
protectedpure virtual |
Implemented in RTPDuplex.
|
inlineprotectedinherited |
|
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.
|
protected |
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.
|
protected |
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.
|
inlineprotectedinherited |
|
protectedinherited |
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
Definition at line 205 of file members.cpp.
bool IncomingDataQueue::isWaiting | ( | const SyncSource * | src = NULL | ) | const |
Determine if packets are waiting in the reception queue.
src | Optional synchronization source selector. |
Definition at line 144 of file incqueue.cpp.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
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. |
|
inlineprotectedvirtual |
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.
|
protected |
Definition at line 105 of file incqueue.cpp.
|
protected |
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.
|
protected |
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.
|
protectedpure virtual |
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.
void IncomingDataQueue::removeInQueueCryptoContext | ( | CryptoContext * | 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 748 of file incqueue.cpp.
|
inlineinherited |
|
protectedinherited |
Remove the description of the source identified by ssrc
Definition at line 295 of file members.cpp.
|
protectedvirtual |
Reimplemented from RTPQueueBase.
Definition at line 128 of file incqueue.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.
|
inlineinherited |
|
inlineinherited |
void IncomingDataQueue::setInQueueCryptoContext | ( | CryptoContext * | cc | ) |
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.
|
inlineinherited |
|
inlineprotectedinherited |
Definition at line 211 of file queuebase.h.
|
inline |
|
inline |
|
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.
|
inlineprotectedinherited |
|
inline |
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 |
|
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.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotected |
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 |
|
protectedvirtual |
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.
|
inlineinherited |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotectedinherited |
|
staticprotected |
|
staticprotected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
staticprotectedinherited |