TRTPSESSIONBASE(3)
โจ 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 thessrcidentifier 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 ownssrcfor 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 delaymicrotimeout_t getEnd2EndDelay () constโ the current end to end delayvoid 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 CryptoContextvoid removeOutQueueCryptoContextCtrl (CryptoContextCtrl *cc)โ removes the output queue CryptoContextCryptoContextCtrl * getOutQueueCryptoContextCtrl (uint32 ssrc)โ gets an output queue CryptoContext identified by SSRC ๐void setInQueueCryptoContextCtrl (CryptoContextCtrl *cc)โ sets the input queue CryptoContextvoid removeInQueueCryptoContextCtrl (CryptoContextCtrl *cc)โ removes the input queue CryptoContextCryptoContextCtrl * 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 flaguint32 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 sessionuint32 getDefaultSessionBandwidth () constโ the default session bandwidthuint32 getSessionBandwidth () constโ the current session bandwidthvoid 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, bestieSyncSourcesIterator end ()โ end, bestieconst 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 queuevoid 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 sequenceuint8 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 misorderuint16 getDefaultMaxPacketMisorder () constโ the default max packet misorderuint16 getMaxPacketMisorder () constโ the current max packet misordervoid 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 dropoutuint16 getMaxPacketDropout () constโ the current max packet dropoutvoid setInQueueCryptoContext (CryptoContext *cc)โ sets the input queue CryptoContextvoid removeInQueueCryptoContext (CryptoContext *cc)โ removes the input queue CryptoContextCryptoContext * 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 sizesize_t getMaxRecvPacketSize () constโ the current max receive packet sizevoid 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 SSRCuint32 getCurrentRTPClockRate () constโ gets the clock rate in RTP clock units, like8000units per second for PCMU, or90000units per second for MP2T ๐PayloadType getCurrentPayloadType () constโ the current payload typetimeval 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 destinationbool 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 destinationvoid addContributor (uint32 csrc)โ addscsrcas the CSRC identifier of a new contributor ๐ซถbool removeContributor (uint32 csrc)โ removes CSRC from the list of contributorsbool 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 paddingvoid 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 packetsize_t setPartial (uint32 timestamp, unsigned char *data, size_t offset, size_t max)โ sets partial data for an already queued packetmicrotimeout_t getDefaultSchedulingTimeout () constโ the default scheduling timeoutvoid 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 timeoutvoid 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 timeoutuint32 getSendPacketCount () constโ the total number of packets sent so faruint32 getSendOctetCount () constโ the total number of octets sent so far, payload only bestie ๐ฆuint16 getSequenceNumber () constโ the sequence number of the next outgoing packetvoid setOutQueueCryptoContext (CryptoContext *cc)โ sets the output queue CryptoContextvoid removeOutQueueCryptoContext (CryptoContext *cc)โ removes the output queue CryptoContextCryptoContext * 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 sizevoid 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 peersize_t sendData (const unsigned char *const buffer, size_t len)โ sends dataSOCKET getDataRecvSocket () constโ the data receive socketbool 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 peersize_t sendControl (const unsigned char *const buffer, size_t len)โ sends controlSOCKET getControlRecvSocket () constโ the control receive socketSocket::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 atimeval.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 givenssrc, 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 fromstateActivetostateInactive, or before deleting the source after it's been sitting instateInactive. 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 thesrcdefault isNULL.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 failbool 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,ssrcdefaults toNULL.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 theRTPSourcestructures 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 thessrcSSRC identifier.SyncSourceLink * getSourceBySSRC (uint32 ssrc, bool &created)โ gets the description of a source by itsssrcidentifier. thecreatedflag tells you if it got made on the spot.bool BYESource (uint32 ssrc)โ marks the source identified byssrcas having sent a BYE packet. bye bestie ๐bool removeSource (uint32 ssrc)โ removes the description of the source identified byssrc.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 ton.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 requiresSyncSourceโSyncSourceHandlerfriendship. 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,mtudefaults todefaultPathMTU.~RTCPCompoundHandler ()โ destructor.bool checkCompoundRTCPHeader (size_t len)โ performs the RTCP compound packet header validity check, exactly as specified indraft-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! PicktosBestEffortortosEnhanced. โจ (fromrtp.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 is1500. ๐ฆ
๐ 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 fromQueueRTCPManager. Reimplemented inSingleThreadRTPSession< 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]ImplementsIncomingDataQueue.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.
- whether there are packets waiting to be picked Implements
- Parameters
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 ImplementsRTPDataQueue.
- Parameters
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
- Parameters
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
- Parameters
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.
- Number of octets actually read. Implements
- Parameters
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.
- Number of octets actually read. Implements
- Parameters
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
bufferlenImplementsQueueRTCPManager.
- Returns
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 fromlenโ number of octets to write Reimplemented fromOutgoingDataQueue.
- Parameters
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 fromOutgoingDataQueue.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 fromOutgoingDataQueue.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
- Parameters
๐ซถ Friends And Related Symbol Documentation ๐ซถ
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
- 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