AVPQueue(3)
πΈ NAME πΈ
AVPQueue β okay so bestie, this is a class, and it's an RTP/RTCP queue, and what it does is take the generic RTCP service queue (QueueRTCPManager) and add audio/video profile (AVP) specific methods on top of it. That's the whole vibe. π
It lives in section 3 of the Library Functions Manual, so if you were looking for AVPQueue(3), you found her. π
β¨ SYNOPSIS β¨
#include <cqueue.h>
Inherits QueueRTCPManager.
Inherited by TRTPSessionBase< DualRTPUDPIPv4Channel, DualRTPUDPIPv4Channel, AVPQueue >, and TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >.
So yeah, she's the middle child of a whole inheritance situation. Family tree goes hard. π³
π Public Member Functions π
These two are hers, the rest are inherited. Main character energy, tiny little list. π
void setControlBandwidth (float fraction)β tell the queue how much bandwith is available for control (RTCP) packets. That's the fraction, babes.float getControlBandwidth () constβ the getter sibling to the one right above it. β¨
π¦ Public Member Functions inherited from QueueRTCPManager π¦
RTCPSenderInfo * getMRSenderInfo (SyncSource &src)β grab the most recent sender report that came in from a synchronization source. πRTCPReceiverInfo * getMRReceiverInfo (SyncSource &srcFrom)β you're asking for the info in the most recent receiver report about the local source, received from the source you passed as the parameter. iykyk.void setLeavingDelay (microtimeout_t delay)β sets how long the stack will wait before it deletes a synchronization source that already sent an RTCP BYE packet. Grace period, but make it timed. πvoid setEnd2EndDelay (microtimeout_t t)β this method sets the maximum end to end delay allowed. No cap on the vibe, but there IS a cap here, fr fr.microtimeout_t getDefaultEnd2EndDelay () constmicrotimeout_t getEnd2EndDelay () constvoid setSendersControlFraction (float fraction)β specify the fraction of the total control bandwith that gets dedicated to senders reports. Slice of the pie. πvoid setMinRTCPInterval (microtimeout_t interval)β manually set the minimum interval for sending RTP compound packets.uint32 getSendRTCPPacketCount () constβ the total number of RTCP packets sent until now. Count 'em up. π₯void setOutQueueCryptoContextCtrl (CryptoContextCtrl *cc)β set output queue CryptoContext.void removeOutQueueCryptoContextCtrl (CryptoContextCtrl *cc)β remove output queue CryptoContext.CryptoContextCtrl * getOutQueueCryptoContextCtrl (uint32 ssrc)β get an output queue CryptoContext identified by SSRC.void setInQueueCryptoContextCtrl (CryptoContextCtrl *cc)β set input queue CryptoContext.void removeInQueueCryptoContextCtrl (CryptoContextCtrl *cc)β remove input queue CryptoContext.CryptoContextCtrl * getInQueueCryptoContextCtrl (uint32 ssrc)β get an input queue CryptoContext identified by SSRC.
π Public Member Functions inherited from RTPDataQueue π
void setTypeOfService (Tos tos)β specify the kind of service the application expects to use.void enableStack ()β enable packet queue processing in the stack. Let her cook. π³void disableStack ()β disable packet queue processing in the stack. Sit down, girl.bool isActive () constβ get the active connection state flag.uint32 getCurrentTimestamp () constβ get the timestamp that should be given for a packet whose payload sampling instant corresponds to the current system time. β°void setSessionBandwidth (uint32 bw)β specify the bandwidth of the current session.uint32 getDefaultSessionBandwidth () constuint32 getSessionBandwidth () constvoid setTimeclock ()β set the packet timeclock for synchronizing timestamps.timeout_t getTimeclock () constβ get the packet timeclock for synchronizing timestamps.
π§ Public Member Functions inherited from IncomingDataQueue π§
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. (yes, "retreive", we don't fix the docs, we love her as she is π«Ά)bool isWaiting (const SyncSource *src=NULL) constβ determine if packets are waiting in the reception queue.uint32 getFirstTimestamp (const SyncSource *src=NULL) constβ get timestamp of first packet waiting in the queue.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. Trust issues but make it protocol. πuint8 getDefaultMinValidPacketSequence () constuint8 getMinValidPacketSequence () constβ get the minimun number of consecutive packets that must be received from a source before accepting its data packets.void setMaxPacketMisorder (uint16 packets)uint16 getDefaultMaxPacketMisorder () constuint16 getMaxPacketMisorder () constvoid setMaxPacketDropout (uint16 packets)β it also prevents packets sent after a restart of the source being immediately accepted.uint16 getDefaultMaxPacketDropout () constuint16 getMaxPacketDropout () constvoid setInQueueCryptoContext (CryptoContext *cc)β set input queue CryptoContext.void removeInQueueCryptoContext (CryptoContext *cc)β remove input queue CryptoContext.CryptoContext * getInQueueCryptoContext (uint32 ssrc)β get an input queue CryptoContext identified by SSRC.
β Public Member Functions inherited from IncomingDataQueueBase β
size_t getDefaultMaxRecvPacketSize () constsize_t getMaxRecvPacketSize () constvoid setMaxRecvPacketSize (size_t maxsize)
π Public Member Functions inherited from RTPQueueBase π
bool setPayloadFormat (const PayloadFormat &pf)β set the payload format in use, for timing and payload type identification purposes.uint32 getLocalSSRC () constuint32 getCurrentRTPClockRate () constβ get the clock rate in RTP clock units (for instance,8000units per second for PCMU, or90000units per second for MP2T).PayloadType getCurrentPayloadType () consttimeval getInitialTime () const
π Public Member Functions inherited from OutgoingDataQueue π
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)β addcsrcas the CSRC identifier of a new contributor.bool removeContributor (uint32 csrc)β remove CSRC from the list of contributors.bool isSending () constβ determine if outgoing packets are waiting to send.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.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. No waiting around, periodt. β‘void setPadding (uint8 paddinglen)β set padding.void setMark (bool mark)β set marker bit for the packet in which the next data provided will be send.bool getMark () constβ get whether the mark bit will be set in the next packet.size_t setPartial (uint32 timestamp, unsigned char *data, size_t offset, size_t max)β set partial data for an already queued packet.microtimeout_t getDefaultSchedulingTimeout () constvoid setSchedulingTimeout (microtimeout_t to)β set the default scheduling timeout to use when no data packets are waiting to be sent.microtimeout_t getDefaultExpireTimeout () constvoid 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. πmicrotimeout_t getExpireTimeout () constuint32 getSendPacketCount () constβ get the total number of packets sent so far.uint32 getSendOctetCount () constβ get the total number of octets (payload only) sent so far.uint16 getSequenceNumber () constβ get the sequence number of the next outgoing packet.void setOutQueueCryptoContext (CryptoContext *cc)β set output queue CryptoContext.void removeOutQueueCryptoContext (CryptoContext *cc)β remove output queue CryptoContext.CryptoContext * getOutQueueCryptoContext (uint32 ssrc)β get an output queue CryptoContext identified by SSRC.
πΈ Public Member Functions inherited from OutgoingDataQueueBase πΈ
size_t getDefaultMaxSendSegmentSize ()void setMaxSendSegmentSize (size_t size)β set maximum payload segment size before fragmenting sends.size_t getMaxSendSegmentSize ()
π Protected Member Functions π
AVPQueue (uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())AVPQueue (uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication())β local SSRC is given instead of computed by the queue. You're doing the math yourself, bestie. πvirtual ~AVPQueue ()
π«Ά Protected Member Functions inherited from QueueRTCPManager π«Ά
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 () constvoid 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. (again β not our typo, we protect her π₯Ί)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 () constsize_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)
bestie that's genuinely not even the whole list yet π more is coming, stay tuned π
Protected Member Functions inherited from RTPDataQueue π
RTPDataQueue (uint32 size=defaultMembersHashSize)β Constructor, bestie. It's giving "let's set this up" energy. β¨RTPDataQueue (uint32 *ssrc, uint32 size=defaultMembersHashSize)β Using this constructor you can start a session with the givenssrc, instead of the usual randomly generated one. So you get to pick your own vibe. πvirtual ~RTPDataQueue ()β The queue destructor flushes the queue and stops all services. It's the ultimate cleanup, no cap. πvirtual void timerTick ()β A plugin point for timer tick driven events. Like a little heartbeat for your queue. π«Άvoid renewLocalSSRC ()void endQueue ()β This method ends the queue. Bye bye, queue. π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. It's the vibe check for incoming data. πΈ
Protected Member Functions inherited from IncomingDataQueue π
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. Keeping things in check, fr fr. π₯void setSourceExpirationPeriod (uint8 intervals)β Set the number of RTCP intervals that the stack will wait to change the state of a source fromstateActivetostateInactive, or to delete the source after being instateInactive. So you control the timeout tea. β³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. It's the main character of packet intake. π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. Old packets? Not on my watch. πbool recordReception (SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime)β Log reception of a new RTP packet from this source. Just taking notes, bestie. πvoid recordExtraction (const IncomingRTPPkt &pkt)β Log extraction of a packet from this source from the scheduled reception queue. Noting when it leaves the party. πvoid purgeIncomingQueue ()virtual void onNewSyncSource (const SyncSource &)β Virtual called when a new synchronization source has joined the session. Welcome to the group chat, new source! π¦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. It's the bouncer at the door. πͺvirtual void onExpireRecv (IncomingRTPPkt &)β A hook to filter packets in the receive queue that are being expired. Expired? Filtered. Bye. πvirtual bool onSRTPPacketError (IncomingRTPPkt &pkt, int32 errorCode)β A hook that gets called if the decoding of an incoming SRTP was erroneous. Oops, something went wrong. πbool insertRecvPacket (IncomingRTPPktLink *packetLink)β Insert a just received packet in the queue (both general and source specific queues). Put it in the right place, slay. β¨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. The actual reading, no cap. π₯virtual size_t getNextDataPacketSize () const =0
Protected Member Functions inherited from IncomingDataQueueBase π
IncomingDataQueueBase ()virtual ~IncomingDataQueueBase ()
Protected Member Functions inherited from RTPQueueBase β
RTPQueueBase (uint32 *ssrc=NULL)void setLocalSSRC (uint32 ssrc)uint32 getLocalSSRCNetwork () constvirtual ~RTPQueueBase ()
Protected Member Functions inherited from MembershipBookkeeping π
MembershipBookkeeping (uint32 initialSize=defaultMembersHashSize)β The initial size is a hint to allocate the resources needed in order to keep the members' identifiers and associated information. Just a lil heads up for resource planning. πvirtual ~MembershipBookkeeping ()β Purges all RTPSource structures created during the session, as well as the hash table and the list of sources. Total cleanup, periodt. πSyncSourceLink * getLink (const SyncSource &source) constbool isMine (const SyncSource &source) constβ Get whether a synchronization source is recorded in this membership controller. Is it yours? Check the list. π«Άbool isRegistered (uint32 ssrc)β Returns whether there is already a synchronizacion source with'ssrc'SSRC identifier.SyncSourceLink * getSourceBySSRC (uint32 ssrc, bool &created)β Get the description of a source by itsssrcidentifier. Look it up by ID. πbool BYESource (uint32 ssrc)β Mark the source identified byssrcas having sent a BYE packet. Bye Felicia. πbool removeSource (uint32 ssrc)β Remove the description of the source identified byssrcSyncSourceLink * getFirst ()SyncSourceLink * getLast ()uint32 getMembersCount ()void setMembersCount (uint32 n)uint32 getSendersCount ()size_t getDefaultMembersHashSize ()
Protected Member Functions inherited from SyncSourceHandler β¨
SyncSourceHandler ()virtual ~SyncSourceHandler ()void * getLink (const SyncSource &source) constβ This requiresSyncSource-SyncSourceHandlerfriendship. BFFs only. π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)
Protected Member Functions inherited from ParticipantHandler π
ParticipantHandler ()virtual ~ParticipantHandler ()void setSDESItem (Participant *part, SDESItemType item, const std::string &val)void setPRIVPrefix (Participant *part, const std::string val)
Protected Member Functions inherited from ApplicationHandler π¦
ApplicationHandler ()virtual ~ApplicationHandler ()void addParticipant (RTPApplication &app, Participant &part)void removeParticipant (RTPApplication &app, RTPApplication::ParticipantLink *pl)
Protected Member Functions inherited from ConflictHandler π₯
ConflictHandler ()virtual ~ConflictHandler ()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 Member Functions inherited from OutgoingDataQueue π₯
OutgoingDataQueue ()virtual ~OutgoingDataQueue ()void dispatchImmediate (OutgoingRTPPkt *packet)β This is used to write the RTP data packet to one or more destinations. Send it out immediately, no waiting. πmicrotimeout_t getSchedulingTimeout ()β This computes the timeout period for scheduling transmission of the next packet at the'head'of the send buffer. It's the timing tea. β°size_t dispatchDataPacket ()β This function is used by the service thread to process the next outgoing packet pending in the sending queue. The main character of outgoing packets. π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). So you can control the sequence, periodt. π¬uint32 getCurrentSeqNum (void)void setInitialTimestamp (uint32 ts)uint32 getInitialTimestamp ()void purgeOutgoingQueue ()virtual void setControlPeer (const InetAddress &host, tpport_t port)
Protected Member Functions inherited from OutgoingDataQueueBase π
OutgoingDataQueueBase ()virtual ~OutgoingDataQueueBase ()
Protected Member Functions inherited from DestinationListHandler π«
void writeLockDestinationList () constbool addDestinationToList (const InetAddress &ia, tpport_t data, tpport_t control)β Locks the object before modifying it. Safety first, bestie. πbool removeDestinationFromList (const InetAddress &ia, tpport_t dataPort, tpport_t controlPort)β Locks the object before modifying it. Same lock energy. πDestinationListHandler ()~DestinationListHandler ()bool isSingleDestination () constβ Get whether there is only a destination in the list. Just one? Check it. π―TransportAddress * getFirstDestination () constvoid lockDestinationList () constvoid unlockDestinationList () const
Protected Member Functions inherited from RTCPCompoundHandler π§
RTCPCompoundHandler (uint16 mtu=defaultPathMTU)~RTCPCompoundHandler ()bool checkCompoundRTCPHeader (size_t len)β Perform RTCP compound packet header validity check as specified indraft-ietv-avt-rtp-new. Validity check, no cap. βvoid setPathMTU (uint16 mtu)uint16 getPathMTU ()
Additional Inherited Members π
Public Types inherited from RTPDataQueue
enum Tos { tosBestEffort, tosEnhanced }βrtp.h cc++/rtp.h
Static Public Member Functions inherited from IncomingDataQueue
static size_t getDefaultMembersSize ()
Protected Types inherited from RTCPCompoundHandler
enum { defaultPathMTU = 1500 }
Protected Attributes inherited from IncomingDataQueue
ThreadLock recvLockIncomingRTPPktLink * recvFirstIncomingRTPPktLink * recvLastuint8 minValidPacketSequenceuint16 maxPacketMisorderuint16 maxPacketDropoutuint8 sourceExpirationPeriodMutex cryptoMutexstd::list< CryptoContext * > cryptoContexts
Protected Attributes inherited from ConflictHandler
ConflictingTransportAddress * firstConflictConflictingTransportAddress * lastConflict
Protected Attributes inherited from OutgoingDataQueue
Mutex cryptoMutexstd::list< CryptoContext * > cryptoContexts
Protected Attributes inherited from DestinationListHandler
std::list< TransportAddress * > destList
Protected Attributes inherited from RTCPCompoundHandler
unsigned char * rtcpSendBufferunsigned char * rtcpRecvBuffer
Static Protected Attributes inherited from IncomingDataQueue
static const uint8 defaultMinValidPacketSequencestatic const uint16 defaultMaxPacketMisorderstatic const uint16 defaultMaxPacketDropoutstatic const size_t defaultMembersSize
Static Protected Attributes inherited from MembershipBookkeeping
static const size_t defaultMembersHashSizestatic const uint32 SEQNUMMOD
Detailed Description π
This class, an RTP/RTCP queue, adds audio/video profile (AVP) specific methods to the generic RTCP service queue (QueueRTCPManager). It's like the AVP glow-up for the RTCP queue. β¨
Author
Federico Montesino Pouzols fedemp@altern.org
Constructor & Destructor Documentation π οΈ
AVPQueue::AVPQueue (uint32 size = RTPDataQueue::defaultMembersHashSize,
RTPApplication & app = defaultApplication()) [inline], [protected]
AVPQueue::AVPQueue (uint32 ssrc, uint32 size =
RTPDataQueue::defaultMembersHashSize, RTPApplication & app =
defaultApplication()) [inline], [protected]
Local SSRC is given instead of computed by the queue. So you get to set the SSRC yourself, no auto-generation. π
virtual AVPQueue::~AVPQueue () [inline], [protected], [virtual]
π Member Function Documentation π
πΈ float AVPQueue::getControlBandwidth () const [inline] πΈ
okay bestie this one is the lil getter twin of the setter right below it β it's inline, it's const, it hands you back the control bandwidth. that's the vibe. no extra lore attached in the docs, it just exists and it slays quietly. π«Ά
πΈ void AVPQueue::setControlBandwidth (float fraction) [inline] πΈ
so THIS is the one that actually sets your bandwidth available for control (RTCP) packets. like, it's the main character of this section fr fr. and it's not a one-session kind of deal either β this method sets the global control bandwidth for both sender and receiver reports. everyone eats at this table. π
and per RFC 1890 (the blueprint, the blueprint bestie), the split goes like this: 1/4 of the total control bandwidth is dedicated to senders, while 3/4 are dedicated to receivers. that's the ratio, that's the rule, no negotiating. β¨
Parameters π
fractionβ fraction of the session bandwidth, between0and1
Note π if you never call this method, the universe just assumes the control bandwidth is equal to 5% of the session bandwidth. and listen, the RFC literally RECOMMENDS that 5%. so like, the default is not just a lazy fallback, it's the certified good choice. no cap. π
π Author π
Generated automatically by Doxygen for ccRTP from the source code. (yes bestie, a robot wrote this page, and the robot ate. π€π )
and that's the whole page, gorgeous!! π¦ this was the AVPQueue(3) manual, living under the ccRTP umbrella β go forth and configure your control bandwidth with confidence, mwah ππβ¨
π¦ where this page comes from
- debian trixie: libccrtp-doc 2.0.9-4.1 Β· GPL-2.0-or-later WITH MIF exception
- ubuntu noble: libccrtp-doc 2.0.9-2.5build1
- ubuntu questing: libccrtp-doc 2.0.9-4.1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms