RTPDataQueue(3)

๐Ÿ“ฆ
version 2.0.9 ยท 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

๐Ÿ’– RTPDataQueue(3) ๐Ÿ’–

okay bestie, welcome to the manual page for RTPDataQueue from the Library Functions Manual. This is the packet queue handler for building different kinds of RTP protocol systems, and it's giving serious networking main character energy, fr fr. โœจ


โœจ NAME โœจ

RTPDataQueue โ€” a packet queue handler for building different kinds of RTP protocol systems.


โœจ SYNOPSIS โœจ

#include <ioqueue.h>

Inherits IncomingDataQueue, and OutgoingDataQueue.

Inherited by QueueRTCPManager, and RTPDuplex.

๐ŸŽ€ Public Types ๐ŸŽ€

  • enum Tos { tosBestEffort, tosEnhanced } โ€” the type-of-service enum, from rtp.h cc++/rtp.h. ๐Ÿ’…

๐ŸŒธ Public Member Functions ๐ŸŒธ

  • void setTypeOfService (Tos tos) โ€” tell the stack what kind of service your app expects to use. โœจ
  • void enableStack () โ€” turn on packet queue processing in the stack. ๐Ÿ”ฅ
  • void disableStack () โ€” turn off packet queue processing in the stack. ๐Ÿ™ˆ
  • 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 () const โ€” signature only, no description in the original. ๐ŸŽ€
  • uint32 getSessionBandwidth () const โ€” signature only, no description in the original. ๐ŸŽ€
  • void 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 () โ€” signature only, no description in the original. ๐Ÿฆ‹
  • SyncSourcesIterator end () โ€” signature only, no description in the original. ๐Ÿฆ‹
  • const AppDataUnit * getData (uint32 stamp, const SyncSource *src=NULL) โ€” grab data from a specific timestamped packet if such a packet is currently available in the receive buffer. ๐Ÿ“ฆ
  • bool isWaiting (const SyncSource *src=NULL) const โ€” figure out if packets are waiting in the reception queue. ๐Ÿ‘€
  • uint32 getFirstTimestamp (const SyncSource *src=NULL) const โ€” get the timestamp of the 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. ๐Ÿšซ
  • uint8 getDefaultMinValidPacketSequence () const โ€” signature only, no description in the original. ๐ŸŽ€
  • uint8 getMinValidPacketSequence () const โ€” get the minimum number of consecutive packets that must be received from a source before accepting its data packets. โœ…
  • void setMaxPacketMisorder (uint16 packets) โ€” signature only, no description in the original. ๐ŸŽ€
  • uint16 getDefaultMaxPacketMisorder () const โ€” signature only, no description in the original. ๐ŸŽ€
  • uint16 getMaxPacketMisorder () const โ€” signature only, no description in the original. ๐ŸŽ€
  • void setMaxPacketDropout (uint16 packets) โ€” it also prevents packets sent after a restart of the source being immediately accepted. ๐Ÿ”
  • uint16 getDefaultMaxPacketDropout () const โ€” signature only, no description in the original. ๐ŸŽ€
  • uint16 getMaxPacketDropout () const โ€” signature only, no description in the original. ๐ŸŽ€
  • void 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 () const โ€” signature only, no description in the original. ๐ŸŽ€
  • size_t getMaxRecvPacketSize () const โ€” signature only, no description in the original. ๐ŸŽ€
  • void setMaxRecvPacketSize (size_t maxsize) โ€” signature only, no description in the original. ๐ŸŽ€

๐ŸŒˆ 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 () const โ€” signature only, no description in the original. ๐ŸŽ€
  • 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). โฑ๏ธ
  • PayloadType getCurrentPayloadType () const โ€” signature only, no description in the original. ๐ŸŽ€
  • timeval getInitialTime () const โ€” signature only, no description in the original. ๐ŸŽ€

๐Ÿฆ‹ Public Member Functions inherited from OutgoingDataQueue ๐Ÿฆ‹

  • bool addDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” signature only, no description in the original. ๐ŸŽ€
  • bool addDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” signature only, no description in the original. ๐ŸŽ€
  • bool forgetDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” signature only, no description in the original. ๐ŸŽ€
  • bool forgetDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” signature only, no description in the original. ๐ŸŽ€
  • void addContributor (uint32 csrc) โ€” add csrc as 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) โ€” used to create a data packet in the send queue. ๐Ÿ“ฆ
  • void sendImmediate (uint32 stamp, const unsigned char *data=NULL, size_t len=0) โ€” used to create a data packet and send it immediately. ๐Ÿš€
  • void setPadding (uint8 paddinglen) โ€” set padding. ๐Ÿงธ
  • void setMark (bool mark) โ€” set the marker bit for the packet in which the next data provided will be sent. ๐Ÿ”–
  • 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 () const โ€” signature only, no description in the original. ๐ŸŽ€
  • void setSchedulingTimeout (microtimeout_t to) โ€” set the default scheduling timeout to use when no data packets are waiting to be sent. โณ
  • microtimeout_t getDefaultExpireTimeout () const โ€” signature only, no description in the original. ๐ŸŽ€
  • 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. โŒ›
  • microtimeout_t getExpireTimeout () const โ€” signature only, no description in the original. ๐ŸŽ€
  • uint32 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 () โ€” signature only, no description in the original. ๐ŸŽ€
  • void setMaxSendSegmentSize (size_t size) โ€” set maximum payload segment size before fragmenting sends. ๐Ÿงต
  • size_t getMaxSendSegmentSize () โ€” signature only, no description in the original. ๐ŸŽ€

๐Ÿ”ฅ Protected Member Functions ๐Ÿ”ฅ

  • RTPDataQueue (uint32 size=defaultMembersHashSize) โ€” constructor. ๐Ÿ—๏ธ
  • RTPDataQueue (uint32 *ssrc, uint32 size=defaultMembersHashSize) โ€” using this constructor you can start a session with the given ssrc, instead of the usual randomly generated one. ๐ŸŽฒ
  • virtual ~RTPDataQueue () โ€” the queue destructor flushes the queue and stops all services. ๐Ÿ’ฅ
  • virtual void timerTick () โ€” a plugin point for timer tick driven events. โฒ๏ธ
  • void renewLocalSSRC () โ€” signature only, no description in the original. ๐ŸŽ€
  • void endQueue () โ€” this method ends the 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. ๐Ÿ“ก

๐Ÿ’œ Protected Member Functions inherited from IncomingDataQueue ๐Ÿ’œ

  • IncomingDataQueue (uint32 size) โ€” signature only, no description in the original. ๐ŸŽ€
  • virtual ~IncomingDataQueue () โ€” signature only, no description in the original. ๐ŸŽ€
  • 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. ๐Ÿ”
  • 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. โณ
  • 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. ๐Ÿ“ฅ
  • 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. โฐ
  • bool recordReception (SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime) โ€” log reception of a new RTP packet from this source. ๐Ÿ“
  • void recordExtraction (const IncomingRTPPkt &pkt) โ€” log extraction of a packet from this source from the scheduled reception queue. ๐Ÿ“
  • void purgeIncomingQueue () โ€” signature only, no description in the original. ๐ŸŽ€
  • virtual void onNewSyncSource (const SyncSource &) โ€” virtual called when a new synchronization source has joined the session. ๐ŸŽ‰
  • 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. ๐ŸŽช
  • virtual void onExpireRecv (IncomingRTPPkt &) โ€” a hook to filter packets in the receive queue that are being expired. ๐Ÿ•ณ๏ธ
  • virtual bool onSRTPPacketError (IncomingRTPPkt &pkt, int32 errorCode) โ€” a hook that gets called if the decoding of an incoming SRTP was erroneous. ๐Ÿšจ
  • virtual bool end2EndDelayed (IncomingRTPPktLink &) โ€” signature only, no description in the original. ๐ŸŽ€
  • bool insertRecvPacket (IncomingRTPPktLink *packetLink) โ€” insert a just received packet in the queue (both general and source specific queues). ๐Ÿ“ฅ
  • 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. ๐Ÿ’พ
  • virtual size_t getNextDataPacketSize () const =0 โ€” signature only, no description in the original. ๐ŸŽ€

๐Ÿซถ Protected Member Functions inherited from IncomingDataQueueBase ๐Ÿซถ

  • IncomingDataQueueBase () โ€” signature only, no description in the original. ๐ŸŽ€
  • virtual ~IncomingDataQueueBase () โ€” signature only, no description in the original. ๐ŸŽ€

๐ŸŒŸ Protected Member Functions inherited from RTPQueueBase ๐ŸŒŸ

  • RTPQueueBase (uint32 *ssrc=NULL) โ€” signature only, no description in the original. ๐ŸŽ€
  • void setLocalSSRC (uint32 ssrc) โ€” signature only, no description in the original. ๐ŸŽ€
  • uint32 getLocalSSRCNetwork () const โ€” signature only, no description in the original. ๐ŸŽ€
  • virtual ~RTPQueueBase () โ€” signature only, no description in the original. ๐ŸŽ€
  • virtual size_t dispatchBYE (const std::string &) โ€” a plugin point for posting of BYE messages. ๐Ÿ‘‹

๐Ÿซถ Protected Member Functions inherited from MembershipBookkeeping ๐Ÿซถ

bestie these are the lil helper functions your class just inherits, no extra work required, we love a hand-me-down ๐Ÿ’…

  • MembershipBookkeeping(uint32 initialSize=defaultMembersHashSize) โ€” the initial size is basically a hint โœจ it tells the object how much room to set aside so it can keep track of everybody's identifiers and the info attached to them.
  • virtual ~MembershipBookkeeping() โ€” the destructor goes full Marie Kondo and purges all the RTPSource structures made during the session, plus the hash table and the list of sources. everything gone. clean slate. ๐Ÿงน
  • SyncSourceLink * getLink(const SyncSource &source) const โ€” no description on this one, it's just there doing its thing ๐Ÿฆ‹
  • bool isMine(const SyncSource &source) const โ€” tells you whether a synchronization source is actually recorded in this membership controller. is it ours? ๐Ÿ‘€
  • bool isRegistered(uint32 ssrc) โ€” returns whether there's already a synchronization source chilling there with that 'ssrc' SSRC identifier.
  • SyncSourceLink * getSourceBySSRC(uint32 ssrc, bool &created) โ€” grab the description of a source by its ssrc identifier.
  • bool BYESource(uint32 ssrc) โ€” marks the source identified by ssrc as having sent a BYE packet. bye bestie ๐Ÿ‘‹
  • bool removeSource(uint32 ssrc) โ€” removes the description of the source identified by ssrc.
  • SyncSourceLink * getFirst() โ€” no description, just vibes โœจ
  • SyncSourceLink * getLast() โ€” same energy, no description ๐ŸŒธ
  • uint32 getMembersCount() โ€” also undescribed, we move ๐Ÿ’œ
  • void setMembersCount(uint32 n) โ€” yeah, no description here either ๐Ÿ™ˆ
  • uint32 getSendersCount() โ€” and none here ๐ŸŽ€
  • size_t getDefaultMembersHashSize() โ€” nope, nothing, it's iconic in silence ๐Ÿ‘‘

๐Ÿ’– Protected Member Functions inherited from SyncSourceHandler ๐Ÿ’–

  • SyncSourceHandler() โ€” the constructor, living its best life ๐Ÿฆ‹
  • virtual ~SyncSourceHandler() โ€” the destructor, also just existing โœจ
  • void * getLink(const SyncSource &source) const โ€” heads up, this one requires SyncSource - SyncSourceHandler friendship ๐Ÿค like, they have to be besties for this to work.
  • void setLink(SyncSource &source, void *link) โ€” no description ๐Ÿ“
  • void setParticipant(SyncSource &source, Participant &p) โ€” no description ๐Ÿ“
  • void setState(SyncSource &source, SyncSource::State ns) โ€” no description ๐Ÿ“
  • void setSender(SyncSource &source, bool active) โ€” no description ๐Ÿ“
  • void setDataTransportPort(SyncSource &source, tpport_t p) โ€” no description ๐Ÿ“
  • void setControlTransportPort(SyncSource &source, tpport_t p) โ€” no description ๐Ÿ“
  • void setNetworkAddress(SyncSource &source, InetAddress addr) โ€” no description ๐Ÿ“

๐ŸŒธ Protected Member Functions inherited from ParticipantHandler ๐ŸŒธ

  • ParticipantHandler() โ€” constructor, slaying quietly ๐Ÿ’…
  • virtual ~ParticipantHandler() โ€” destructor, also quiet ๐Ÿ’…
  • void setSDESItem(Participant *part, SDESItemType item, const std::string &val) โ€” no description, it just is ๐Ÿงš
  • void setPRIVPrefix(Participant *part, const std::string val) โ€” no description either ๐Ÿงš

โœจ Protected Member Functions inherited from ApplicationHandler โœจ

  • ApplicationHandler() โ€” constructor, being adorable ๐ŸŒˆ
  • virtual ~ApplicationHandler() โ€” destructor, also adorable ๐ŸŒˆ
  • void addParticipant(RTPApplication &app, Participant &part) โ€” no description ๐ŸŽ€
  • void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl) โ€” no description ๐ŸŽ€

๐Ÿ”ฅ Protected Member Functions inherited from ConflictHandler ๐Ÿ”ฅ

  • ConflictHandler() โ€” constructor, staying out of drama ๐Ÿ’€
  • virtual ~ConflictHandler() โ€” destructor, also staying out of drama ๐Ÿ’€
  • ConflictingTransportAddress * searchDataConflict(InetAddress na, tpport_t dtp) โ€” no description ๐Ÿซถ
  • ConflictingTransportAddress * searchControlConflict(InetAddress na, tpport_t ctp) โ€” no description ๐Ÿซถ
  • void updateConflict(ConflictingTransportAddress &ca) โ€” no description ๐Ÿซถ
  • void addConflict(const InetAddress &na, tpport_t dtp, tpport_t ctp) โ€” no description ๐Ÿซถ

๐Ÿ‘‘ Protected Member Functions inherited from OutgoingDataQueue ๐Ÿ‘‘

  • OutgoingDataQueue() โ€” constructor, main character energy โœจ
  • virtual ~OutgoingDataQueue() โ€” destructor, also main character energy โœจ
  • void dispatchImmediate(OutgoingRTPPkt *packet) โ€” this is the one that actually writes the RTP data packet out to one or more destinations ๐Ÿ“ฌ
  • microtimeout_t getSchedulingTimeout() โ€” this computes the timeout period for scheduling the transmission of the next packet sitting at the 'head' of the send buffer โฐ
  • size_t dispatchDataPacket() โ€” this function is used by the service thread to process the next outgoing packet that's pending in the sending queue.
  • void setNextSeqNum(uint32 seqNum) โ€” for those cases where your app needs a way to set the sequence number for the outgoing stream, like when you're implementing the RTSP PLAY command ๐ŸŽฌ
  • uint32 getCurrentSeqNum(void) โ€” no description ๐Ÿ“
  • void setInitialTimestamp(uint32 ts) โ€” no description ๐Ÿ“
  • uint32 getInitialTimestamp() โ€” no description ๐Ÿ“
  • void purgeOutgoingQueue() โ€” no description ๐Ÿ“
  • virtual void setControlPeer(const InetAddress &host, tpport_t port) โ€” no description ๐Ÿ“

๐Ÿฆ‹ Protected Member Functions inherited from OutgoingDataQueueBase ๐Ÿฆ‹

  • OutgoingDataQueueBase() โ€” constructor, no notes ๐ŸŒŸ
  • virtual ~OutgoingDataQueueBase() โ€” destructor, no notes ๐ŸŒŸ

๐Ÿ’œ Protected Member Functions inherited from DestinationListHandler ๐Ÿ’œ

  • void writeLockDestinationList() const โ€” no description ๐ŸŒธ
  • bool addDestinationToList(const InetAddress &ia, tpport_t data, tpport_t control) โ€” locks the object before modifying it ๐Ÿ”’
  • bool removeDestinationFromList(const InetAddress &ia, tpport_t dataPort, tpport_t controlPort) โ€” locks the object before modifying it ๐Ÿ”’
  • DestinationListHandler() โ€” no description ๐ŸŒธ
  • ~DestinationListHandler() โ€” no description ๐ŸŒธ
  • bool isSingleDestination() const โ€” tells you whether there's only one destination in the list.
  • TransportAddress * getFirstDestination() const โ€” no description ๐ŸŒธ
  • void lockDestinationList() const โ€” no description ๐ŸŒธ
  • void unlockDestinationList() const โ€” no description ๐ŸŒธ

๐ŸŒˆ Additional Inherited Members ๐ŸŒˆ

โญ Static Public Member Functions inherited from IncomingDataQueue โญ

  • static size_t getDefaultMembersSize() โ€” no description, it just exists ๐ŸŽ€

๐Ÿงš Protected Attributes inherited from IncomingDataQueue ๐Ÿงš

  • ThreadLock recvLock
  • IncomingRTPPktLink * recvFirst
  • IncomingRTPPktLink * recvLast
  • uint8 minValidPacketSequence
  • uint16 maxPacketMisorder
  • uint16 maxPacketDropout
  • uint8 sourceExpirationPeriod
  • Mutex cryptoMutex
  • std::list< CryptoContext * > cryptoContexts

๐Ÿ’€ Protected Attributes inherited from ConflictHandler ๐Ÿ’€

  • ConflictingTransportAddress * firstConflict
  • ConflictingTransportAddress * lastConflict

๐Ÿ”ฅ Protected Attributes inherited from OutgoingDataQueue ๐Ÿ”ฅ

  • Mutex cryptoMutex
  • std::list< CryptoContext * > cryptoContexts

๐Ÿ“ Protected Attributes inherited from DestinationListHandler ๐Ÿ“

  • std::list< TransportAddress * > destList

๐Ÿ‘‘ Static Protected Attributes inherited from IncomingDataQueue ๐Ÿ‘‘

  • static const uint8 defaultMinValidPacketSequence
  • static const uint16 defaultMaxPacketMisorder
  • static const uint16 defaultMaxPacketDropout
  • static const size_t defaultMembersSize

โœจ Static Protected Attributes inherited from MembershipBookkeeping โœจ

  • static const size_t defaultMembersHashSize
  • static const uint32 SEQNUMMOD

๐Ÿ“ฆ Detailed Description ๐Ÿ“ฆ

a packet queue handler for building all different kinds of RTP protocol systems, no cap ๐Ÿ’…

the queue handles both the incoming and the outgoing RTP packets, plus the synchronization and the transmission/reception timers. and the way it makes the queue handler its own separate base class? that's what lets you define RTP classes for RTP profiles and sessions of totally different types. obsessed honestly โœจ

outgoing packets get sent via the OutgoingDataQueue::putData method ๐Ÿ“ค

incoming packets can be retrieved via the IncomingDataQueue::getData method ๐Ÿ“ฅ

Author

David Sugar dyfet@ostel.com

RTP data queue handler.


๐ŸŽ€ Member Enumeration Documentation ๐ŸŽ€

enum RTPDataQueue::Tos

rtp.h cc++/rtp.h โ€” the type of network service the application uses.

so here's the tea: if the application uses enhanced network service โ€” think Integrated Services or Differentiated Services โ€” it does not have to ensure fair competition with TCP, as long as the requested service is actually being delivered. but whenever the application uses best-effort service, or the enhanced service it asked for isn't actually being delivered, then it does have to ensure fair competition with TCP. and by default? best-effort is what's assumed. periodt.

Note โ€” although it's not required, RTP packets are always sent on top of UDP segments. no other underlying transport protocol is supported at present ๐Ÿซถ

Enumerator

  • tosBestEffort โ€” best-effort network service.
  • tosEnhanced โ€” enhanced network service.

๐Ÿ’… Constructor & Destructor Documentation ๐Ÿ’…

RTPDataQueue::RTPDataQueue(uint32 size = defaultMembersHashSize) [protected]

the constructor โœจ this one generates a random application SSRC identifier for you, like a lil surprise gift ๐ŸŽ

Parameters

  • size โ€” an estimation of the number of participants in the session.

RTPDataQueue::RTPDataQueue(uint32 * ssrc, uint32 size = defaultMembersHashSize) [protected]

with this constructor you get to start a session with the ssrc you provide, instead of the usual randomly generated one. this is necessary when you need to kick off several sessions that all have the same SSRC identifier โ€” for instance, to implement layered encoding, where each layer is managed through a different session but all the sessions share the same SSRC identifier. team effort fr fr ๐Ÿค

Warning โ€” this doesn't seem to be a good solution ๐Ÿ’€

Parameters

  • ssrc โ€” synchronization SouRCe identifier for this session.
  • size โ€” an estimation of the number of participants in the session.

virtual RTPDataQueue::~RTPDataQueue() [inline], [protected], [virtual]

the queue destructor flushes the queue and stops all services. everything wraps up, curtains closed, iconic exit ๐ŸŽฌโœจ

โœจ Member Function Documentation โœจ

void RTPDataQueue::disableStack (void) [inline]

void RTPDataQueue::disableStack (void) [inline]

Okay so bestie, this one just turns OFF packet queue processing in the stack. That's the entire job. It's giving "lights off, nobody's home" energy. ๐Ÿ›‘


void RTPDataQueue::enableStack (void) [inline]

void RTPDataQueue::enableStack (void) [inline]

And this icon turns packet queue processing in the stack back ON. โœจ

Heads up: this method will not any thread of execution. That's literally what the docs say, word for word โ€” I am not editing the ancestors. Make of it what you will, bestie. ๐Ÿซถ


void RTPDataQueue::endQueue () [protected]

void RTPDataQueue::endQueue () [protected]

This method ends the queue. That's it. Queue over, pack it up, go home. ๐Ÿ’… (It's protected, so it's living its life behind the velvet rope.)


uint32 RTPDataQueue::getCurrentTimestamp () const

uint32 RTPDataQueue::getCurrentTimestamp () const

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. So like... it's not the clock, but it does need to be clock-adjacent. The way that nuance lives in this function. ๐Ÿ˜ญ

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. Please don't do math by hand, bestie, we have functions for that. ๐Ÿงฎ

Note ๐Ÿ“Œ Frame based applications must follow a specific timestamping method, probably specified in a profile. You should take into account that by default ccRTP assumes that the application begins sampling at the queue creation time. Moreover, the first sampling instant is assigned a 'user visible' timestamp of 0, although the RTP stack will then add internally a random offset unknown to the application. That is to say, the application may count samples from 0 in order to get the timestamp for the next packet, provided that the first sampling instant is the same as the queue creation time. Nevertheless, this simpler way of starting will not be as accurate as it would be if the application got at least the first timestamp through getCurrentTimestamp. We provide this option since ccRTP interface is evolving, but we admit that it is ugly, we could remove this option or even replace uint32 timestamps with a restrictively regulated object; suggestions are gladly welcomed. ๐Ÿ’€ (the devs literally said "it's ugly" in the docs, no cap โ€” they're so real for that)

Examples

  • rtphello.cpp

uint32 RTPDataQueue::getDefaultSessionBandwidth () const [inline]

uint32 RTPDataQueue::getDefaultSessionBandwidth () const [inline]

The docs give us literally zero description here. Just the signature, standing there, mysterious, serving main character energy with no lines. ๐Ÿ™ˆ


uint32 RTPDataQueue::getSessionBandwidth () const [inline]

uint32 RTPDataQueue::getSessionBandwidth () const [inline]

Same situation, bestie โ€” signature only, no prose. The silence is deafening. ๐Ÿ”‡


timeout_t RTPDataQueue::getTimeclock () const [inline]

timeout_t RTPDataQueue::getTimeclock () const [inline]

Get the packet timeclock for synchronizing timestamps. โฑ๏ธ

Returns

  • runtime in milliseconds since last set.

bool RTPDataQueue::isActive () const [inline]

bool RTPDataQueue::isActive () const [inline]

Get active connection state flag. Vibe check, but for connections. ๐Ÿฆ‹

Returns

  • true if connection 'active'.

Examples

  • audiorx.cpp
  • audiotx.cpp
  • rtphello.cpp

virtual bool RTPDataQueue::isPendingData (microtimeout_t timeout) [protected], [pure virtual]

virtual bool RTPDataQueue::isPendingData (microtimeout_t timeout) [protected], [pure virtual]

This function is used to check for and schedule against arriving packets based on the derived connection type. ๐Ÿ‘€ It's pure virtual, so the derived connection type is the one who actually has to show up and do the work. Periodt.

Returns

  • true if packet waiting for processing.

Parameters

  • number of microseconds to wait.

Implemented in

  • RTPDuplex
  • TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >
  • TRTPSessionBase< DualRTPUDPIPv4Channel, DualRTPUDPIPv4Channel, AVPQueue >
  • SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >

void RTPDataQueue::renewLocalSSRC () [inline], [protected], [virtual]

void RTPDataQueue::renewLocalSSRC () [inline], [protected], [virtual]

Reimplemented from IncomingDataQueue. No extra notes, no side quests โ€” just a glow-up of the SSRC with the receipts to prove where it came from. ๐Ÿ’…


void RTPDataQueue::setSessionBandwidth (uint32 bw) [inline]

void RTPDataQueue::setSessionBandwidth (uint32 bw) [inline]

Specify the bandwidth of the current session. ๐Ÿ“ถ

Parameters

  • bw โ€” bandwidth of the current session, in bits/s.

See also

  • AVPQueue::setControlBandwidth()

void RTPDataQueue::setTimeclock () [inline]

void RTPDataQueue::setTimeclock () [inline]

Set the packet timeclock for synchronizing timestamps. That's the whole note, bestie. Short, sweet, and it matches getTimeclock() like a matching set. ๐ŸŽ€


void RTPDataQueue::setTypeOfService (Tos tos) [inline]

void RTPDataQueue::setTypeOfService (Tos tos) [inline]

Specify the kind of service the application expects to use. ๐ŸŒˆ

Parameters

  • tos โ€” type of service the application expects to use.
Note โš ๏ธ If enhanced service is specified but packet loss is high (the requested service does not appear to actually be delivered) ccRTP defaults to best-effort suitable behaviour: guarantee fair competition with TCP. So like, if you ask for the fancy treatment and the network is not delivering, ccRTP stops pretending and plays nice with TCP instead. Not me being humbled by the network layer. ๐Ÿ˜ญ

virtual void RTPDataQueue::timerTick (void) [inline], [protected], [virtual]

virtual void RTPDataQueue::timerTick (void) [inline], [protected], [virtual]

A plugin point for timer tick driven events. ๐ŸŽฏ Like a little hook where timer tick stuff can do its thing.

Reimplemented in

  • SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >

Author โœ๏ธ

Generated automatically by Doxygen for ccRTP from the source code. So nobody hand-wrote this one, it just โœจmanifestedโœจ.


And that's the whole page, bestie โ€” that footer at the bottom is your source and version tag, ccRTP, living on manual page RTPDataQueue(3), dated like a little timestamp on the whole thing. ๐Ÿ’– Go build something cute with it. ๐Ÿฆ‹๐ŸŒธ

๐Ÿ“ฆ where this page comes from