TRTPSESSIONBASE(3)

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

โœจ TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue > โœจ

okay bestie, welcome to the blueprint of TRTPSessionBase ๐Ÿ’– this is the big foundational class for RTP sessions, and yes it's a template with three lil parameters: RTPDataChannel, RTCPChannel, and ServiceQueue. she's the main character and everyone else inherits her energy. let's get into it ๐Ÿซถ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <rtp.h>

Inherits AVPQueue.

Inherited by SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >.

๐Ÿ’… Public Member Functions

  • TRTPSessionBase (const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app) โ€” builds a session that's just sitting there, waiting for packets on a host address ๐Ÿฆ‹
  • TRTPSessionBase (uint32 ssrc, const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app) โ€” same vibe, but you hand her the ssrc identifier for the local source yourself ๐Ÿ’ซ
  • TRTPSessionBase (const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface) โ€” builds a session waiting for packets on a multicast address, yes she does multicast, she contains multitudes ๐ŸŒˆ
  • TRTPSessionBase (uint32 ssrc, const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface) โ€” multicast again but with your own ssrc for the local source, iconic behavior โœจ
  • virtual size_t dispatchBYE (const std::string &str) โ€” the BYE dispatcher, no notes ๐Ÿ’€
  • Socket::Error setMcastTTL (uint8 ttl) โ€” sets the value of the TTL field in the packets she sends out, very demure, very mindful ๐ŸŽ€
  • virtual ~TRTPSessionBase () โ€” the destructor, she logs off ๐Ÿ˜ญ
  • RTPDataChannel * getDSO (void) โ€” grab the DSO, slay

๐Ÿงš Public Member Functions inherited from AVPQueue

  • void setControlBandwidth (float fraction) โ€” tells the stack how much bandwidth is available for control (RTCP) packets, share the wealth bestie ๐Ÿ’œ
  • float getControlBandwidth () const โ€” reads that number back

๐ŸŒธ Public Member Functions inherited from QueueRTCPManager

  • RTCPSenderInfo * getMRSenderInfo (SyncSource &src) โ€” gets the most recent sender report that came in from a synchronization source ๐Ÿ‘‘
  • RTCPReceiverInfo * getMRReceiverInfo (SyncSource &srcFrom) โ€” asks for the info in the most recent receiver report about the local source, as received from the source you pass in ๐Ÿฆ‹
  • void setLeavingDelay (microtimeout_t delay) โ€” sets how long the stack waits before it deletes a synchronization source that already sent an RTCP BYE packet โœŒ๏ธ
  • void setEnd2EndDelay (microtimeout_t t) โ€” sets the maximum end to end delay allowed, no cap on caring tho ๐Ÿ’–
  • microtimeout_t getDefaultEnd2EndDelay () const โ€” the default end to end delay
  • microtimeout_t getEnd2EndDelay () const โ€” the current end to end delay
  • void setSendersControlFraction (float fraction) โ€” says what fraction of the total control bandwidth gets dedicated to senders reports ๐Ÿ“Š
  • void setMinRTCPInterval (microtimeout_t interval) โ€” manually sets the minimum interval for sending RTP compound packets, sometimes you just gotta take the wheel ๐Ÿ’…
  • uint32 getSendRTCPPacketCount () const โ€” the total number of RTCP packets sent so far, a flex fr fr ๐Ÿ”ฅ
  • void setOutQueueCryptoContextCtrl (CryptoContextCtrl *cc) โ€” sets the output queue CryptoContext
  • void removeOutQueueCryptoContextCtrl (CryptoContextCtrl *cc) โ€” removes the output queue CryptoContext
  • CryptoContextCtrl * getOutQueueCryptoContextCtrl (uint32 ssrc) โ€” gets an output queue CryptoContext identified by SSRC ๐Ÿ”
  • void setInQueueCryptoContextCtrl (CryptoContextCtrl *cc) โ€” sets the input queue CryptoContext
  • void removeInQueueCryptoContextCtrl (CryptoContextCtrl *cc) โ€” removes the input queue CryptoContext
  • CryptoContextCtrl * getInQueueCryptoContextCtrl (uint32 ssrc) โ€” gets an input queue CryptoContext identified by SSRC

๐Ÿ’œ Public Member Functions inherited from RTPDataQueue

  • void setTypeOfService (Tos tos) โ€” says what kind of service the application expects to use ๐ŸŽ€
  • void enableStack () โ€” enables packet queue processing in the stack, wake her up โญ
  • void disableStack () โ€” disables packet queue processing in the stack, nap time ๐Ÿ˜ด
  • bool isActive () const โ€” gets the active connection state flag
  • uint32 getCurrentTimestamp () const โ€” gets the timestamp you should give a packet whose payload sampling instant lines up with the current system time โฐ
  • void setSessionBandwidth (uint32 bw) โ€” specifies the bandwidth of the current session
  • uint32 getDefaultSessionBandwidth () const โ€” the default session bandwidth
  • uint32 getSessionBandwidth () const โ€” the current session bandwidth
  • void setTimeclock () โ€” sets the packet timeclock used for synchronizing timestamps ๐Ÿ•ฐ๏ธ
  • timeout_t getTimeclock () const โ€” gets the packet timeclock used for synchronizing timestamps

๐Ÿฆ‹ Public Member Functions inherited from IncomingDataQueue

  • SyncSourcesIterator begin () โ€” begin, bestie
  • SyncSourcesIterator end () โ€” end, bestie
  • const AppDataUnit * getData (uint32 stamp, const SyncSource *src=NULL) โ€” retrieves data from a specific timestamped packet, if such a packet is currently available in the receive buffer ๐Ÿ‘€
  • bool isWaiting (const SyncSource *src=NULL) const โ€” tells you if packets are waiting in the reception queue ๐ŸŽ€
  • uint32 getFirstTimestamp (const SyncSource *src=NULL) const โ€” timestamp of the first packet waiting in the queue
  • void setMinValidPacketSequence (uint8 packets) โ€” when packets arrive from a new source, sometimes you wanna reject the first few before you're actually sure the source is valid. cautious queen behavior ๐Ÿ’…
  • uint8 getDefaultMinValidPacketSequence () const โ€” the default minimum valid packet sequence
  • uint8 getMinValidPacketSequence () const โ€” gets the minimum number of consecutive packets that must arrive from a source before her data packets get accepted โœ…
  • void setMaxPacketMisorder (uint16 packets) โ€” sets the max packet misorder
  • uint16 getDefaultMaxPacketMisorder () const โ€” the default max packet misorder
  • uint16 getMaxPacketMisorder () const โ€” the current max packet misorder
  • void setMaxPacketDropout (uint16 packets) โ€” sets the max packet dropout. this one also stops packets sent after a source restart from being immediately accepted, sneaky-proof ๐Ÿ”’
  • uint16 getDefaultMaxPacketDropout () const โ€” the default max packet dropout
  • uint16 getMaxPacketDropout () const โ€” the current max packet dropout
  • void setInQueueCryptoContext (CryptoContext *cc) โ€” sets the input queue CryptoContext
  • void removeInQueueCryptoContext (CryptoContext *cc) โ€” removes the input queue CryptoContext
  • CryptoContext * getInQueueCryptoContext (uint32 ssrc) โ€” gets an input queue CryptoContext identified by SSRC

๐ŸŒˆ Public Member Functions inherited from IncomingDataQueueBase

  • size_t getDefaultMaxRecvPacketSize () const โ€” the default max receive packet size
  • size_t getMaxRecvPacketSize () const โ€” the current max receive packet size
  • void setMaxRecvPacketSize (size_t maxsize) โ€” sets the max receive packet size

โญ Public Member Functions inherited from RTPQueueBase

  • bool setPayloadFormat (const PayloadFormat &pf) โ€” sets the payload format in use, for timing and payload type identification purposes ๐ŸŽฏ
  • uint32 getLocalSSRC () const โ€” your local SSRC
  • uint32 getCurrentRTPClockRate () const โ€” gets the clock rate in RTP clock units, like 8000 units per second for PCMU, or 90000 units per second for MP2T ๐Ÿ•
  • PayloadType getCurrentPayloadType () const โ€” the current payload type
  • timeval getInitialTime () const โ€” the initial time

๐Ÿ‘‘ Public Member Functions inherited from OutgoingDataQueue

  • bool addDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” adds a destination, come through ๐Ÿ’ซ
  • bool addDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” adds a multicast destination
  • bool forgetDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” forgets a destination, we don't know her ๐Ÿ’€
  • bool forgetDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0) โ€” forgets a multicast destination
  • void addContributor (uint32 csrc) โ€” adds csrc as the CSRC identifier of a new contributor ๐Ÿซถ
  • bool removeContributor (uint32 csrc) โ€” removes CSRC from the list of contributors
  • bool isSending () const โ€” tells you if outgoing packets are waiting to send ๐Ÿ“ค
  • void putData (uint32 stamp, const unsigned char *data=NULL, size_t len=0) โ€” this is what you use to create a data packet in the send queue โœจ
  • void sendImmediate (uint32 stamp, const unsigned char *data=NULL, size_t len=0) โ€” this one creates a data packet and sends it immediately, no waiting around ๐Ÿ”ฅ
  • void setPadding (uint8 paddinglen) โ€” sets padding
  • void setMark (bool mark) โ€” sets the marker bit for the packet that the next data you provide will be sent in ๐Ÿท๏ธ
  • bool getMark () const โ€” tells you 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) โ€” sets partial data for an already queued packet
  • microtimeout_t getDefaultSchedulingTimeout () const โ€” the default scheduling timeout
  • void setSchedulingTimeout (microtimeout_t to) โ€” sets the default scheduling timeout to use when no data packets are waiting to be sent โณ
  • microtimeout_t getDefaultExpireTimeout () const โ€” the default expire timeout
  • void setExpireTimeout (microtimeout_t to) โ€” sets the 'expired' timer for expiring packets pending in the send queue that have gone unsent and are already 'too late' to be sent now. brutal but necessary ๐Ÿ˜ญ
  • microtimeout_t getExpireTimeout () const โ€” the current expire timeout
  • uint32 getSendPacketCount () const โ€” the total number of packets sent so far
  • uint32 getSendOctetCount () const โ€” the total number of octets sent so far, payload only bestie ๐Ÿ“ฆ
  • uint16 getSequenceNumber () const โ€” the sequence number of the next outgoing packet
  • void setOutQueueCryptoContext (CryptoContext *cc) โ€” sets the output queue CryptoContext
  • void removeOutQueueCryptoContext (CryptoContext *cc) โ€” removes the output queue CryptoContext
  • CryptoContext * getOutQueueCryptoContext (uint32 ssrc) โ€” gets an output queue CryptoContext identified by SSRC

๐ŸŽ€ Public Member Functions inherited from OutgoingDataQueueBase

  • size_t getDefaultMaxSendSegmentSize () โ€” the default max send segment size
  • void setMaxSendSegmentSize (size_t size) โ€” sets the maximum payload segment size before sends get fragmented โœ‚๏ธ
  • size_t getMaxSendSegmentSize () โ€” the current max send segment size

๐Ÿ” Protected Member Functions

  • bool isPendingData (microtimeout_t timeout) โ€” is there pending data?
  • InetHostAddress getDataSender (tpport_t *port=NULL) const โ€” who's the data sender?
  • size_t getNextDataPacketSize () const โ€” how big is the next data packet?
  • size_t recvData (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp) โ€” receives data from the data channel/socket ๐Ÿ“ฅ
  • void setDataPeer (const InetAddress &host, tpport_t port) โ€” sets the data peer
  • size_t sendData (const unsigned char *const buffer, size_t len) โ€” sends data
  • SOCKET getDataRecvSocket () const โ€” the data receive socket
  • bool isPendingControl (microtimeout_t timeout) โ€” is there pending control?
  • InetHostAddress getControlSender (tpport_t *port=NULL) const โ€” who's the control sender?
  • size_t recvControl (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp) โ€” receives data from the control channel/socket ๐Ÿ“จ
  • void setControlPeer (const InetAddress &host, tpport_t port) โ€” sets the control peer
  • size_t sendControl (const unsigned char *const buffer, size_t len) โ€” sends control
  • SOCKET getControlRecvSocket () const โ€” the control receive socket
  • Socket::Error joinGroup (const InetMcastAddress &ia, uint32 iface) โ€” joins a multicast group, welcome to the group chat ๐Ÿซ‚
  • Socket::Error leaveGroup (const InetMcastAddress &ia) โ€” leaves a multicast group, she's leaving the group chat ๐Ÿ˜ญ
  • void endSocket () โ€” ends the socket

okay that's part 1 bestie, stay tuned for more ๐Ÿ’–

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

okay so these are the ones AVPQueue hands down to you โ€” protected, so they're for you and your subclass besties, not for randos calling in from outside ๐Ÿ’…

  • AVPQueue (uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) โ€” the standard constructor, takes a size and an application and gets you set up.
  • AVPQueue (uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) โ€” the choose-your-own-SSRC edition โœจ the local SSRC is handed to you instead of being computed by the queue.
  • virtual ~AVPQueue () โ€” destructor, does the tidy-up thing.

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

the RTCP control-plane bestie. all the timing rules, the collision detection, the plug-ins โ€” it's giving very much management energy ๐Ÿ‘‘

  • QueueRTCPManager (uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) โ€” constructor with a size and an app.
  • QueueRTCPManager (uint32 ssrc, uint32 size=RTPDataQueue::defaultMembersHashSize, RTPApplication &app=defaultApplication()) โ€” constructor where you supply the SSRC yourself.
  • virtual ~QueueRTCPManager () โ€” destructor.
  • const RTPApplication & getApplication () โ€” hands you the application, read-only style.
  • void setControlBandwidth (float fraction) โ€” sets the control bandwidth as a fraction.
  • float getControlBandwidth () const โ€” reads that fraction back out.
  • void controlTransmissionService () โ€” builds and sends RTCP packets following the timing rules, including the 'timer reconsideration' algorithm. no cap, that algorithm is real and it matters.
  • void controlReceptionService () โ€” processes the incoming RTCP packets that are sitting pending in the control reception socket.
  • bool checkSSRCInRTCPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp) โ€” applies the collision and loop detection and correction algorithm when you're receiving RTCP packets. so important, don't skip it ๐Ÿ’€
  • void endQueueRTCPManager () โ€” wraps up the RTCP manager.
  • virtual void onGotSR (SyncSource &source, SendReport &SR, uint8 blocks) โ€” plug-in point for processing an incoming RTCP Sender Report (aka acquiring the info it carries).
  • virtual void onGotRR (SyncSource &source, RecvReport &RR, uint8 blocks) โ€” plug-in point for processing an incoming RTCP Receiver Report.
  • bool onGotSDES (SyncSource &source, RTCPPacket &pkt) โ€” handles an incoming SDES.
  • virtual bool onGotSDESChunk (SyncSource &source, SDESChunk &chunk, size_t len) โ€” plug-in for handling SDES chunks.
  • virtual void onGotAPP (SyncSource &, RTCPCompoundHandler::APPPacket &, size_t) โ€” plug-in for handling APP (application specific) RTCP packets.
  • timeval getRTCPCheckInterval () โ€” gives you the RTCP check interval as a timeval.
  • uint32 getLastSendPacketCount () const โ€” gets the number of data packets that had been sent at the time the last SR was generated.
  • void setPrevMembersNum (uint32 n) โ€” sets the previous members number.
  • uint32 getPrevMembersCount () const โ€” gets the previous members count.
  • size_t sendControlToDestinations (unsigned char *buffer, size_t len) โ€” sends that control data out to the destinations.

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

the big one, the whole queue vibe.

  • 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. cute and specific, love that for you.
  • virtual ~RTPDataQueue () โ€” the queue destructor flushes the queue and stops all services. everything. gone. ๐Ÿซถ
  • virtual void timerTick () โ€” a plugin point for timer tick driven events.
  • void renewLocalSSRC () โ€” regenerates your local SSRC.
  • void endQueue () โ€” this method ends the queue.

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

the receiving side of the operation. packets come in, packets get checked, packets get queued.

  • IncomingDataQueue (uint32 size) โ€” constructor, takes a size.
  • virtual ~IncomingDataQueue () โ€” destructor.
  • bool checkSSRCInIncomingRTPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp) โ€” applies the collision and loop detection and correction algorithm when receiving RTP data packets.
  • void setSourceExpirationPeriod (uint8 intervals) โ€” sets how many RTCP intervals the stack will wait before flipping a source from stateActive to stateInactive, or before deleting the source after it's been sitting in stateInactive. yes, it's literally the grace period ๐Ÿ˜ญ
  • virtual size_t takeInDataPacket () โ€” used by the service thread to process the next incoming packet and drop it in the receive list.
  • IncomingDataQueue::IncomingRTPPktLink * getWaiting (uint32 timestamp, const SyncSource *src=NULL) โ€” used to fetch a packet out of the receive queue and to expire any packets older than the current timestamp. note the src default is NULL.
  • bool recordReception (SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime) โ€” logs the reception of a new RTP packet from this source.
  • void recordExtraction (const IncomingRTPPkt &pkt) โ€” logs the extraction of a packet from this source, out of the scheduled reception queue.
  • void purgeIncomingQueue () โ€” clears out the incoming queue.
  • virtual void onNewSyncSource (const SyncSource &) โ€” virtual that gets called when a new synchronization source has joined the session. welcome to the group chat bestie ๐ŸŽ€
  • virtual bool onRTPPacketRecv (IncomingRTPPkt &) โ€” a virtual function to support parsing of arriving packets, so you can decide whether they should be kept in the queue, and to dispatch events.
  • virtual void onExpireRecv (IncomingRTPPkt &) โ€” a hook to filter the packets in the receive queue that are in the process of expiring.
  • virtual bool onSRTPPacketError (IncomingRTPPkt &pkt, int32 errorCode) โ€” a hook that gets called if the decoding of an incoming SRTP was erroneous. ๐Ÿ’€ not the SRTP decode fail
  • bool insertRecvPacket (IncomingRTPPktLink *packetLink) โ€” inserts a just-received packet into the queue โ€” both the general queue and the source specific queues.

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

  • IncomingDataQueueBase () โ€” constructor.
  • virtual ~IncomingDataQueueBase () โ€” destructor.

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

  • RTPQueueBase (uint32 *ssrc=NULL) โ€” constructor, ssrc defaults to NULL.
  • void setLocalSSRC (uint32 ssrc) โ€” sets the local SSRC.
  • uint32 getLocalSSRCNetwork () const โ€” gets the local SSRC, in network form.
  • virtual ~RTPQueueBase () โ€” destructor.

๐Ÿ“ Protected Member Functions inherited from MembershipBookkeeping ๐Ÿ“

who's in the session, who's out, and where all their info lives. very much the roster keeper of the whole thing ๐Ÿ“‹

  • MembershipBookkeeping (uint32 initialSize=defaultMembersHashSize) โ€” the initial size is a hint, used to allocate the resources needed to keep the members' identifiers and all their associated info.
  • virtual ~MembershipBookkeeping () โ€” purges all the RTPSource structures created during the session, plus the hash table and the list of sources. full reset, no leftovers ๐Ÿงน
  • SyncSourceLink * getLink (const SyncSource &source) const โ€” gets the link for a source.
  • bool isMine (const SyncSource &source) const โ€” gets whether a synchronization source is recorded in this membership controller.
  • bool isRegistered (uint32 ssrc) โ€” returns whether there's already a synchronization source with the ssrc SSRC identifier.
  • SyncSourceLink * getSourceBySSRC (uint32 ssrc, bool &created) โ€” gets the description of a source by its ssrc identifier. the created flag tells you if it got made on the spot.
  • 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 () โ€” gets the first link.
  • SyncSourceLink * getLast () โ€” gets the last link.
  • uint32 getMembersCount () โ€” how many members, as a number.
  • void setMembersCount (uint32 n) โ€” sets the members count to n.
  • uint32 getSendersCount () โ€” how many senders.
  • size_t getDefaultMembersHashSize () โ€” returns the default members hash size.

๐ŸŒˆ Protected Member Functions inherited from SyncSourceHandler ๐ŸŒˆ

  • SyncSourceHandler () โ€” constructor.
  • virtual ~SyncSourceHandler () โ€” destructor.
  • void * getLink (const SyncSource &source) const โ€” this one requires SyncSource โ€“ SyncSourceHandler friendship. iykyk ๐Ÿ”ฅ
  • void setLink (SyncSource &source, void *link) โ€” sets the link on a source.
  • void setParticipant (SyncSource &source, Participant &p) โ€” attaches a participant.
  • void setState (SyncSource &source, SyncSource::State ns) โ€” sets the source's state.
  • void setSender (SyncSource &source, bool active) โ€” marks whether the source is an active sender.
  • void setDataTransportPort (SyncSource &source, tpport_t p) โ€” sets the data transport port.
  • void setControlTransportPort (SyncSource &source, tpport_t p) โ€” sets the control transport port.
  • void setNetworkAddress (SyncSource &source, InetAddress addr) โ€” sets the network address.

๐ŸŽ€ Protected Member Functions inherited from ParticipantHandler ๐ŸŽ€

  • ParticipantHandler () โ€” constructor.
  • virtual ~ParticipantHandler () โ€” destructor.
  • void setSDESItem (Participant *part, SDESItemType item, const std::string &val) โ€” sets an SDES item on a participant.
  • void setPRIVPrefix (Participant *part, const std::string val) โ€” sets the PRIV prefix on a participant.

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

  • ApplicationHandler () โ€” constructor.
  • virtual ~ApplicationHandler () โ€” destructor.
  • void addParticipant (RTPApplication &app, Participant &part) โ€” adds a participant to the application.
  • void removeParticipant (RTPApplication &app, RTPApplication::ParticipantLink *pl) โ€” removes a participant from the application.

๐Ÿ’… Protected Member Functions inherited from ConflictHandler ๐Ÿ’…

collision drama management. somebody's using your address? this is the department that handles it ๐Ÿšจ

  • ConflictHandler () โ€” constructor.
  • virtual ~ConflictHandler () โ€” destructor.
  • ConflictingTransportAddress * searchDataConflict (InetAddress na, tpport_t dtp) โ€” searches for a data conflict.
  • ConflictingTransportAddress * searchControlConflict (InetAddress na, tpport_t ctp) โ€” searches for a control conflict.
  • void updateConflict (ConflictingTransportAddress &ca) โ€” updates a conflict record.
  • void addConflict (const InetAddress &na, tpport_t dtp, tpport_t ctp) โ€” adds a conflict with the given network address and data/control transport ports.

๐Ÿงš Protected Member Functions inherited from OutgoingDataQueue ๐Ÿงš

the sending side. scheduling, dispatching, sequence numbers โ€” the whole put-it-on-the-wire situation.

  • OutgoingDataQueue () โ€” constructor.
  • virtual ~OutgoingDataQueue () โ€” destructor.
  • void dispatchImmediate (OutgoingRTPPkt *packet) โ€” used to write the RTP data packet out to one or more destinations. right now. immediately. periodt.
  • microtimeout_t getSchedulingTimeout () โ€” computes the timeout period for scheduling the transmission of the next packet sitting at the 'head' of the send buffer.
  • size_t dispatchDataPacket () โ€” used by the service thread to process the next outgoing packet pending in the sending queue.
  • void setNextSeqNum (uint32 seqNum) โ€” for those cases where the application needs a way to set the sequence number for the outgoing stream (like, say, implementing the RTSP PLAY command ๐Ÿ‘€).
  • uint32 getCurrentSeqNum (void) โ€” gets the current sequence number.
  • void setInitialTimestamp (uint32 ts) โ€” sets the initial timestamp.
  • uint32 getInitialTimestamp () โ€” gets the initial timestamp.
  • void purgeOutgoingQueue () โ€” clears out the outgoing queue.

โญ Protected Member Functions inherited from OutgoingDataQueueBase โญ

  • OutgoingDataQueueBase () โ€” constructor.
  • virtual ~OutgoingDataQueueBase () โ€” destructor.

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

  • void writeLockDestinationList () const โ€” takes the write lock on the destination list.
  • 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 () โ€” constructor.
  • ~DestinationListHandler () โ€” destructor.
  • bool isSingleDestination () const โ€” gets whether there's only a single destination in the list.
  • TransportAddress * getFirstDestination () const โ€” gets the first destination in the list.
  • void lockDestinationList () const โ€” locks the destination list.
  • void unlockDestinationList () const โ€” unlocks it again.

๐ŸŒˆ Protected Member Functions inherited from RTCPCompoundHandler ๐ŸŒˆ

  • RTCPCompoundHandler (uint16 mtu=defaultPathMTU) โ€” constructor, mtu defaults to defaultPathMTU.
  • ~RTCPCompoundHandler () โ€” destructor.
  • bool checkCompoundRTCPHeader (size_t len) โ€” performs the RTCP compound packet header validity check, exactly as specified in draft-ietv-avt-rtp-new.
  • void setPathMTU (uint16 mtu) โ€” sets the path MTU.
  • uint16 getPathMTU () โ€” gets the path MTU.

๐ŸŽ€ Protected Attributes ๐ŸŽ€

the actual variables, just vibing in protected-land:

  • RTPDataChannel * dso โ€” the data socket object.
  • RTCPChannel * cso โ€” the control socket object.

๐Ÿ’œ Protected Attributes inherited from IncomingDataQueue ๐Ÿ’œ

  • ThreadLock recvLock โ€” the receive lock.
  • IncomingRTPPktLink * recvFirst โ€” first packet link in the receive list.
  • IncomingRTPPktLink * recvLast โ€” last packet link in the receive list.
  • uint8 minValidPacketSequence โ€” the minimum valid packet sequence.
  • uint16 maxPacketMisorder โ€” the max packet misorder.
  • uint16 maxPacketDropout โ€” the max packet dropout.
  • uint8 sourceExpirationPeriod โ€” how long a source hangs around before it expires.
  • Mutex cryptoMutex โ€” the mutex guarding the crypto stuff.
  • std::list< CryptoContext * > cryptoContexts โ€” the list of crypto contexts.

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

  • ConflictingTransportAddress * firstConflict โ€” first conflict in the list.
  • ConflictingTransportAddress * lastConflict โ€” last conflict in the list.

๐Ÿ›ก๏ธ Protected Attributes inherited from OutgoingDataQueue ๐Ÿ›ก๏ธ

  • Mutex cryptoMutex โ€” a mutex for all the crypto things, bestie. ๐Ÿ”’
  • std::list< CryptoContext * > cryptoContexts โ€” a whole list of crypto contexts, no cap. ๐Ÿ”

๐Ÿ›ก๏ธ Protected Attributes inherited from DestinationListHandler ๐Ÿ›ก๏ธ

  • std::list< TransportAddress * > destList โ€” the list of destination addresses. ๐Ÿ“

๐Ÿ›ก๏ธ Protected Attributes inherited from RTCPCompoundHandler ๐Ÿ›ก๏ธ

  • unsigned char * rtcpSendBuffer โ€” buffer for sending RTCP. ๐Ÿ“ค
  • unsigned char * rtcpRecvBuffer โ€” buffer for receiving RTCP. ๐Ÿ“ฅ

๐Ÿค Friends ๐Ÿค

  • class RTPSessionBaseHandler โ€” it's a friend, periodt. ๐Ÿซถ

๐Ÿงฌ Additional Inherited Members ๐Ÿงฌ

๐ŸŒˆ Public Types inherited from RTPDataQueue ๐ŸŒˆ

  • enum Tos { tosBestEffort, tosEnhanced } โ€” Type of Service, bestie! Pick tosBestEffort or tosEnhanced. โœจ (from rtp.h cc++/rtp.h)

โšก Static Public Member Functions inherited from IncomingDataQueue โšก

  • static size_t getDefaultMembersSize () โ€” gets the default members size. ๐Ÿ“

๐Ÿ›ก๏ธ Protected Types inherited from RTCPCompoundHandler ๐Ÿ›ก๏ธ

  • enum { defaultPathMTU = 1500 } โ€” default path MTU is 1500. ๐Ÿ“ฆ

๐Ÿ”’ Static Protected Attributes inherited from IncomingDataQueue ๐Ÿ”’

  • static const uint8 defaultMinValidPacketSequence โ€” minimum valid packet sequence. ๐Ÿ”ข
  • static const uint16 defaultMaxPacketMisorder โ€” max packet misorder. ๐Ÿ”„
  • static const uint16 defaultMaxPacketDropout โ€” max packet dropout. ๐Ÿ’ง
  • static const size_t defaultMembersSize โ€” default members size. ๐Ÿ‘ฅ

๐Ÿ”’ Static Protected Attributes inherited from MembershipBookkeeping ๐Ÿ”’

  • static const size_t defaultMembersHashSize โ€” default members hash size. #๏ธโƒฃ
  • static const uint32 SEQNUMMOD โ€” sequence number mod. ๐Ÿงฎ

๐Ÿ› ๏ธ Constructor & Destructor Documentation ๐Ÿ› ๏ธ

๐Ÿ—๏ธ Constructor 1: TRTPSessionBase (host address) ๐Ÿ—๏ธ

template<class RTPDataChannel  = DualRTPUDPIPv4Channel, class RTCPChannel  = DualRTPUDPIPv4Channel, class ServiceQueue  = AVPQueue> TRTPSessionBase<RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase (const InetHostAddress & ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication & app) [inline]

Builds a session waiting for packets in a host address. ๐Ÿ 

Parameters:

  • ia โ€” Network address this socket is to be bound. ๐Ÿ“
  • dataPort โ€” Transport port the data socket is to be bound. ๐Ÿ”Œ
  • controlPort โ€” Transport port the control socket is to be bound. ๐ŸŽ›๏ธ
  • membersSize โ€” Initial size of the membership table. ๐Ÿ‘ฅ
  • app โ€” Application this session is associated to. ๐Ÿ“ฑ

๐Ÿ—๏ธ Constructor 2: TRTPSessionBase (with ssrc, host address) ๐Ÿ—๏ธ

template<class RTPDataChannel  = DualRTPUDPIPv4Channel, class RTCPChannel  = DualRTPUDPIPv4Channel, class ServiceQueue  = AVPQueue> TRTPSessionBase<RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase (uint32 ssrc, const InetHostAddress & ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication & app) [inline]

Builds a session with the specified ssrc identifier for the local source. ๐Ÿ†”

Parameters:

  • ssrc โ€” SSRC identifier for the local source. ๐Ÿ†”
  • ia โ€” Network address this socket is to be bound. ๐Ÿ“
  • dataPort โ€” Transport port the data socket is to be bound. ๐Ÿ”Œ
  • controlPort โ€” Transport port the control socket is to be bound. ๐ŸŽ›๏ธ
  • membersSize โ€” Initial size of the membership table. ๐Ÿ‘ฅ
  • app โ€” Application this session is associated to. ๐Ÿ“ฑ

๐Ÿ—๏ธ Constructor 3: TRTPSessionBase (multicast address) ๐Ÿ—๏ธ

template<class RTPDataChannel  = DualRTPUDPIPv4Channel, class RTCPChannel  = DualRTPUDPIPv4Channel, class ServiceQueue  = AVPQueue> TRTPSessionBase<RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase (const InetMcastAddress & ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication & app, uint32 iface) [inline]

Builds a session waiting for packets in a multicast address. ๐Ÿ“ก

TODO: ssrc constructor for multicast! ๐Ÿšง โ€” like, it's not here yet, bestie.

Parameters:

  • ia โ€” Multicast address this socket is to be bound. ๐Ÿ“ก
  • dataPort โ€” Transport port the data socket is to be bound. ๐Ÿ”Œ
  • controlPort โ€” Transport port the control socket is to be bound. ๐ŸŽ›๏ธ
  • membersSize โ€” Initial size of the membership table. ๐Ÿ‘ฅ
  • app โ€” Application this session is associated to. ๐Ÿ“ฑ
  • iface โ€” Index (from 0 to n) of network interface to join to multicast group. ๐Ÿ”ข

๐Ÿ—๏ธ Constructor 4: TRTPSessionBase (with ssrc, multicast address) ๐Ÿ—๏ธ

template<class RTPDataChannel  = DualRTPUDPIPv4Channel, class RTCPChannel  = DualRTPUDPIPv4Channel, class ServiceQueue  = AVPQueue> TRTPSessionBase<RTPDataChannel, RTCPChannel, ServiceQueue >::TRTPSessionBase (uint32 ssrc, const InetMcastAddress & ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication & app, uint32 iface) [inline]

Builds a session waiting for packets in a multicast address, with the specified ssrc identifier for the local source. ๐Ÿ†”๐Ÿ“ก

Parameters:

  • ssrc โ€” SSRC identifier for the local source. ๐Ÿ†”
  • ia โ€” Multicast address this socket is to be bound. ๐Ÿ“ก
  • dataPort โ€” Transport port the data socket is to be bound. ๐Ÿ”Œ
  • controlPort โ€” Transport port the control socket is to be bound. ๐ŸŽ›๏ธ
  • membersSize โ€” Initial size of the membership table. ๐Ÿ‘ฅ
  • app โ€” Application this session is associated to. ๐Ÿ“ฑ
  • iface โ€” Index (from 0 to n) of network interface to join to multicast group. ๐Ÿ”ข

๐Ÿ’ฅ Destructor: ~TRTPSessionBase ๐Ÿ’ฅ

template<class RTPDataChannel  = DualRTPUDPIPv4Channel, class RTCPChannel  = DualRTPUDPIPv4Channel, class ServiceQueue  = AVPQueue> virtual TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::~TRTPSessionBase () [inline],  [virtual]

This is the destructor, bestie. It cleans up everything. ๐Ÿงนโœจ

๐Ÿ’– Member Function Documentation ๐Ÿ’–

okay bestie, this is the main character section. every single one of these has the same iconic template preamble, and we are keeping it exactly as written. no cap, no edits, no merging. periodt. ๐Ÿ’…

  • dispatchBYE โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> virtual size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::dispatchBYE (const std::string & str) [inline], [virtual] Reimplemented from QueueRTCPManager. Reimplemented in SingleThreadRTPSession< RTPDataChannel, RTCPChannel, ServiceQueue >.
  • endSocket โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::endSocket () [inline], [protected] no extra description in the manpage, just the protected vibe. ๐Ÿซถ
  • getControlRecvSocket โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlRecvSocket () const [inline], [protected] (the manpage is quiet here, so we keep it cute and exact.)
  • getControlSender โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getControlSender (tpport_t * port = NULL) const [inline], [protected]
  • getDataRecvSocket โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> SOCKET TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataRecvSocket () const [inline], [protected]
  • getDataSender โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> InetHostAddress TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDataSender (tpport_t * port = NULL) const [inline], [protected]
  • getDSO โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> RTPDataChannel * TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getDSO (void) [inline]
  • getNextDataPacketSize โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::getNextDataPacketSize () const [inline], [protected], [virtual] Implements IncomingDataQueue.
  • isPendingControl โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> bool TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingControl (microtimeout_t timeout) [inline], [protected], [virtual]
    • Parameters
      • timeout โ€” maximum timeout to wait, in microseconds
    • Returns
      • whether there are packets waiting to be picked Implements QueueRTCPManager.
  • isPendingData โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> bool TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::isPendingData (microtimeout_t timeout) [inline], [protected], [virtual]
    • Parameters
      • timeout โ€” maximum timeout to wait, in microseconds Implements RTPDataQueue.
  • joinGroup โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::joinGroup (const InetMcastAddress & ia, uint32 iface) [inline], [protected] Join a multicast group.
    • Parameters
      • ia โ€” address of the multicast group
    • Returns
      • error code from the socket operation
  • leaveGroup โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::leaveGroup (const InetMcastAddress & ia) [inline], [protected] Leave a multicast group.
    • Parameters
      • ia โ€” address of the multicast group
    • Returns
      • error code from the socket operation
  • recvControl โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::recvControl (unsigned char * buffer, size_t len, InetHostAddress & na, tpport_t & tp) [inline], [protected], [virtual] Receive data from the control channel/socket.
    • Parameters
      • buffer โ€” Buffer where to get data.
      • len โ€” Maximum number of octets to get.
      • na โ€” Source network address.
      • tp โ€” Source transport port.
    • Returns
      • Number of octets actually read. Implements QueueRTCPManager.
  • recvData โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::recvData (unsigned char * buffer, size_t len, InetHostAddress & na, tpport_t & tp) [inline], [protected], [virtual] Receive data from the data channel/socket.
    • Parameters
      • buffer โ€” Memory region to read to.
      • len โ€” Maximum number of octets to get.
      • na โ€” Source network address.
      • tp โ€” Source transport port.
    • Returns
      • Number of octets actually read. Implements IncomingDataQueue.
  • sendControl โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::sendControl (const unsigned char *const buffer, size_t len) [inline], [protected], [virtual]
    • Returns
      • number of octets actually written
    • Parameters
      • buffer
      • len Implements QueueRTCPManager.
  • sendData โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> size_t TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::sendData (const unsigned char *const buffer, size_t len) [inline], [protected], [virtual]
    • Parameters
      • buffer โ€” memory region to write from
      • len โ€” number of octets to write Reimplemented from OutgoingDataQueue.
  • setControlPeer โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setControlPeer (const InetAddress & host, tpport_t port) [inline], [protected], [virtual] Reimplemented from OutgoingDataQueue.
  • setDataPeer โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> void TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setDataPeer (const InetAddress & host, tpport_t port) [inline], [protected], [virtual] Reimplemented from OutgoingDataQueue.
  • setMcastTTL โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> Socket::Error TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::setMcastTTL (uint8 ttl) [inline] Set the value of the TTL field in the sent packets.
    • Parameters
      • ttl โ€” Time To Live
    • Returns
      • error code from the socket operation

  • template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> friend class RTPSessionBaseHandler [friend] a friend class? iconic. the manpage said it, we're just relaying the message. ๐Ÿ’–

๐ŸŒธ Member Data Documentation ๐ŸŒธ

  • cso โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> RTCPChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::cso [protected]
  • dso โ€” template<class RTPDataChannel = DualRTPUDPIPv4Channel, class RTCPChannel = DualRTPUDPIPv4Channel, class ServiceQueue = AVPQueue> RTPDataChannel* TRTPSessionBase< RTPDataChannel, RTCPChannel, ServiceQueue >::dso [protected]

๐Ÿ’… Author ๐Ÿ’…

Generated automatically by Doxygen for ccRTP from the source code.

not a human, just doxygen doing its thing, and honestly it ate. ๐Ÿค–โœจ


and that's the whole page, bestie! the footer says ccRTP as the source/version, and the date is right there on that last line โ€” go peep it. mwah. ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from