Queue for incoming RTP data packets in an RTP session.
More...
#include <iqueue.h>
Inheritance diagram for IncomingDataQueue:
Collaboration diagram for IncomingDataQueue:
Data Structures
iterator through the list of synchronizations sources in this session
More...
Public Member Functions
Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer.
More...
Determine if packets are waiting in the reception queue.
More...
Get timestamp of first packet waiting in the queue.
More...
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...
Get the minimun number of consecutive packets that must be received from a source before accepting its data packets.
More...
It also prevents packets sent after a restart of the source being immediately accepted.
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...
Static Public Member Functions
Protected Member Functions
Apply collision and loop detection and correction algorithm when receiving RTP data packets.
More...
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...
This function is used by the service thread to process the next incoming packet and place it in the receive list.
More...
This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp.
More...
Log reception of a new RTP packet from this source.
More...
Log extraction of a packet from this source from the scheduled reception queue.
More...
Virtual called when a new synchronization source has joined the session.
More...
A virtual function to support parsing of arriving packets to determine if they should be kept in the queue and to dispatch events.
More...
A hook to filter packets in the receive queue that are being expired.
More...
A hook that gets called if the decoding of an incoming SRTP was erroneous.
More...
Insert a just received packet in the queue (both general and source specific queues).
More...
This function performs the physical I/O for reading a packet from the source.
More...
A plugin point for posting of BYE messages.
More...
Get whether a synchronization source is recorded in this membership controller.
More...
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
More...
Get the description of a source by its
ssrc
identifier.
More...
Mark the source identified by
ssrc
as having sent a BYE packet.
More...
Remove the description of the source identified by
ssrc
More...
Protected Attributes
Static Protected Attributes
Detailed Description
Constructor & Destructor Documentation
IncomingDataQueue::IncomingDataQueue
(
uint32
size )
protected
- Parameters
-
size initial size of the membership table.
virtual IncomingDataQueue::~IncomingDataQueue
(
)
inlineprotectedvirtual
Member Function Documentation
void ConflictHandler::addConflict
(
const
InetAddress &
na,
)
inherited
bool MembershipBookkeeping::BYESource
(
uint32
ssrc )
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.
- Returns
- true if the source had been previously identified. false if it was not in the table of known sources.
bool IncomingDataQueue::checkSSRCInIncomingRTPPkt
(
SyncSourceLink &
sourceLink,
bool
is_new,
)
protected
Apply collision and loop detection and correction algorithm when receiving RTP data packets.
Follows section 8.2 in draft-ietf-avt-rtp-new.
- Parameters
-
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.
- Returns
- whether the packet must not be discarded.
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.
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.
const
AppDataUnit* IncomingDataQueue::getData
(
uint32
stamp,
)
Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer.
- Parameters
-
stamp Data unit timestamp.
src Optional synchronization source selector.
- Returns
- data retrieved from the reception buffer.
- Return values
-
null pointer if no packet with such timestamp is available.
uint16 IncomingDataQueue::getDefaultMaxPacketDropout
(
)
const
inline
uint16 IncomingDataQueue::getDefaultMaxPacketMisorder
(
)
const
inline
size_t IncomingDataQueueBase::getDefaultMaxRecvPacketSize
(
)
const
inlineinherited
size_t MembershipBookkeeping::getDefaultMembersHashSize
(
)
inlineinherited
static size_t IncomingDataQueue::getDefaultMembersSize
(
)
inlinestatic
uint8 IncomingDataQueue::getDefaultMinValidPacketSequence
(
)
const
inline
uint32 IncomingDataQueue::getFirstTimestamp
(
const
SyncSource *
src =
NULL
)
const
Get timestamp of first packet waiting in the queue.
- Parameters
-
src optional source selector.
- Returns
- timestamp of first arrival packet.
timeval RTPQueueBase::getInitialTime
(
)
const
inlineinherited
CryptoContext* IncomingDataQueue::getInQueueCryptoContext
(
uint32
ssrc )
uint32 RTPQueueBase::getLocalSSRC
(
)
const
inlineinherited
uint32 RTPQueueBase::getLocalSSRCNetwork
(
)
const
inlineprotectedinherited
uint16 IncomingDataQueue::getMaxPacketDropout
(
)
const
inline
uint16 IncomingDataQueue::getMaxPacketMisorder
(
)
const
inline
size_t IncomingDataQueueBase::getMaxRecvPacketSize
(
)
const
inlineinherited
uint32 MembershipBookkeeping::getMembersCount
(
)
inlineprotectedinherited
uint8 IncomingDataQueue::getMinValidPacketSequence
(
)
const
inline
Get the minimun number of consecutive packets that must be received from a source before accepting its data packets.
Definition at line 1010 of file iqueue.h.
virtual size_t IncomingDataQueue::getNextDataPacketSize
(
)
const
protectedpure virtual
uint32 MembershipBookkeeping::getSendersCount
(
)
inlineprotectedinherited
bool &
created
)
protectedinherited
Get the description of a source by its ssrc
identifier.
- Parameters
-
ssrc SSRC identifier, in host order.
created whether a new source has been created.
- Returns
- Pointer to the SyncSource object identified by
ssrc
.
This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp.
- Returns
- packet buffer object for current timestamp if found.
- Parameters
-
timestamp timestamp requested.
src optional source selector
- Note
- if found, the packet is removed from the reception queue
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.
- Parameters
-
packetLink link to a packet just received and generally validated and processed by onRTPPacketRecv.
- Returns
- whether the packet was successfully inserted.
- Return values
-
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.
bool MembershipBookkeeping::isMine
(
const
SyncSource &
source )
const
inlineprotectedinherited
Get whether a synchronization source is recorded in this membership controller.
Definition at line 345 of file iqueue.h.
bool MembershipBookkeeping::isRegistered
(
uint32
ssrc )
protectedinherited
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
bool IncomingDataQueue::isWaiting
(
const
SyncSource *
src =
NULL
)
const
Determine if packets are waiting in the reception queue.
- Parameters
-
src Optional synchronization source selector.
- Returns
- True if packets are waiting.
A hook to filter packets in the receive queue that are being expired.
This hook may be used to do some application specific processing on expired packets before they are deleted.
- Parameters
-
- packet expired from the recv queue.
Definition at line 1217 of file iqueue.h.
virtual void IncomingDataQueue::onNewSyncSource
(
const
SyncSource &
)
inlineprotectedvirtual
Virtual called when a new synchronization source has joined the session.
- Parameters
-
- new synchronization source
Definition at line 1185 of file iqueue.h.
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.
- Parameters
-
- packet just received.
- Returns
- true if packet is kept in the incoming packets queue.
Definition at line 1206 of file iqueue.h.
virtual bool IncomingDataQueue::onSRTPPacketError
(
IncomingRTPPkt &
pkt,
int32
errorCode
)
inlineprotectedvirtual
A hook that gets called if the decoding of an incoming SRTP was erroneous.
- Parameters
-
pkt The SRTP packet with error.
errorCode The error code: -1 - SRTP authentication failure, -2 - replay check failed
- Returns
- True: put the packet in incoming queue for further processing by the applications; false: dismiss packet. The default implementation returns false.
Reimplemented in ZrtpQueue.
Definition at line 1234 of file iqueue.h.
void IncomingDataQueue::purgeIncomingQueue
(
)
protected
void IncomingDataQueue::recordExtraction
(
const
IncomingRTPPkt &
pkt )
protected
Log extraction of a packet from this source from the scheduled reception queue.
- Parameters
-
pkt Packet extracted from the queue.
const timeval
recvtime
)
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.
- Parameters
-
srcLink Link structure for the synchronization source of this packet.
pkt Packet just created and to be logged.
recvtime Reception time.
- Returns
- whether, according to the source state and statistics, the packet is considered valid and must be inserted in the incoming packets queue.
virtual size_t IncomingDataQueue::recvData
(
unsigned char *
buffer,
size_t
length,
)
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.
- Returns
- number of bytes read.
- Parameters
-
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.
- Parameters
-
bool MembershipBookkeeping::removeSource
(
uint32
ssrc )
protectedinherited
Remove the description of the source identified by ssrc
- Returns
- whether the source has been actually removed or it did not exist.
void IncomingDataQueue::renewLocalSSRC
(
)
protectedvirtual
- Parameters
-
na Inet network address.
ctp Data transport port.
- Parameters
-
na Inet network address.
dtp Data transport port.
void SyncSourceHandler::setControlTransportPort
(
SyncSource &
source,
)
inlineinherited
void SyncSourceHandler::setDataTransportPort
(
SyncSource &
source,
)
inlineinherited
void IncomingDataQueue::setInQueueCryptoContext
(
CryptoContext *
cc )
Set input queue CryptoContext.
The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.
- Parameters
-
void SyncSourceHandler::setLink
(
SyncSource &
source,
void *
link
)
inlineinherited
void RTPQueueBase::setLocalSSRC
(
uint32
ssrc )
inlineprotectedinherited
void IncomingDataQueue::setMaxPacketDropout
(
uint16
packets )
inline
It also prevents packets sent after a restart of the source being immediately accepted.
Definition at line 1031 of file iqueue.h.
void IncomingDataQueue::setMaxPacketMisorder
(
uint16
packets )
inline
void IncomingDataQueueBase::setMaxRecvPacketSize
(
size_t
maxsize )
inlineinherited
- Parameters
-
- Note
- This method sets a filter for incoming packets. Setting higher values does not necessarily imply higher memory usage (this method does not set any buffer size).
Definition at line 319 of file queuebase.h.
void MembershipBookkeeping::setMembersCount
(
uint32
n )
inlineprotectedinherited
void IncomingDataQueue::setMinValidPacketSequence
(
uint8
packets )
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.
- Note
- the default (see defaultMinValidPacketSequence()) value for this parameter is 0, so that no packets are rejected (data packets are accepted from the first one).
-
this validation is performed after the generic header validation and the additional validation done in onRTPPacketRecv().
-
if any valid RTCP packet is received from this source, it will be immediatly considered valid regardless of the number of sequential data packets received.
- Parameters
-
packets number of sequential packet required
Definition at line 998 of file iqueue.h.
void SyncSourceHandler::setNetworkAddress
(
SyncSource &
source,
)
inlineinherited
void SyncSourceHandler::setParticipant
(
SyncSource &
source,
)
inlineinherited
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.
void ParticipantHandler::setPRIVPrefix
(
Participant *
part,
const std::string
val
)
inlineinherited
void ParticipantHandler::setSDESItem
(
Participant *
part,
const std::string &
val
)
inlineinherited
void SyncSourceHandler::setSender
(
SyncSource &
source,
bool
active
)
inlineinherited
void IncomingDataQueue::setSourceExpirationPeriod
(
uint8
intervals )
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.
- Parameters
-
intervals number of RTCP report intervals
- Note
- If RTCP is not being used, the RTCP interval is assumed to be the default: 5 seconds.
-
The default for this value is, as RECOMMENDED, 5.
Definition at line 1122 of file iqueue.h.
void SyncSourceHandler::setState
(
SyncSource &
source,
)
inlineinherited
virtual size_t IncomingDataQueue::takeInDataPacket
(
)
protectedvirtual
This function is used by the service thread to process the next incoming packet and place it in the receive list.
- Returns
- number of payload bytes received. <0 if error.
Reimplemented in ZrtpQueue.
Field Documentation
Mutex IncomingDataQueue::cryptoMutex
mutableprotected
const uint16 IncomingDataQueue::defaultMaxPacketDropout
staticprotected
const uint16 IncomingDataQueue::defaultMaxPacketMisorder
staticprotected
const size_t MembershipBookkeeping::defaultMembersHashSize
staticprotectedinherited
const size_t IncomingDataQueue::defaultMembersSize
staticprotected
const uint8 IncomingDataQueue::defaultMinValidPacketSequence
staticprotected
uint16 IncomingDataQueue::maxPacketDropout
protected
uint16 IncomingDataQueue::maxPacketMisorder
protected
uint8 IncomingDataQueue::minValidPacketSequence
protected
const uint32 MembershipBookkeeping::SEQNUMMOD
staticprotectedinherited
uint8 IncomingDataQueue::sourceExpirationPeriod
protected
The documentation for this class was generated from the following file: