OutgoingRTPPkt(3)
π OutgoingRTPPkt β NAME β¨
okay so bestie, welcome to OutgoingRTPPkt π
β this is a manual page from the Library Functions Manual, and it's all about RTP packets being sent. yes, the ones going OUT. the main character packets. π€β¨
π¦ SYNOPSIS π¦
#include <rtppkt.h>
Inherits RTPPacket. so like, it's giving nepo baby but make it OOP π
π Public Member Functions π
OutgoingRTPPkt (const uint32 *const csrcs, uint16 numcsrc, const unsigned char *const hdrext, uint32 hdrextlen, const unsigned char *const data, size_t datalen, uint8 paddinglen=0, CryptoContext *pcc=NULL)β construct a brand new packet to be sent, and it's holding several contributing source identifiers, header extensions, and payload. the full-course meal πOutgoingRTPPkt (const uint32 *const csrcs, uint16 numcsrc, const unsigned char *const data, size_t datalen, uint8 paddinglen=0, CryptoContext *pcc=NULL)β construct a new packet to be sent, this time with several contributing source identifiers and payload (no header extension, we're keeping it cute and simple).OutgoingRTPPkt (const unsigned char *const data, size_t datalen, uint8 paddinglen=0, CryptoContext *pcc=NULL)β construct a new packet to be sent, fast variant, with no contributing sources and no header extension. speed. β‘~OutgoingRTPPkt ()void setPayloadType (PayloadType pt)void setSeqNum (uint16 seq)void setTimestamp (uint32 pts)void setSSRC (uint32 ssrc) constβ set the synchronization source numeric identifier.void setSSRCNetwork (uint32 ssrc) constβ set the synchronization source numeric identifier (network-order flavour).void setMarker (bool mark)β specify the value of the marker bit.void protect (uint32 ssrc, CryptoContext *pcc)β called packet is setup.bool operator== (const OutgoingRTPPkt &p) constβ outgoing packets are equal if their sequence numbers match. twin behavior π«bool operator!= (const OutgoingRTPPkt &p) constβ outgoing packets are not equal if their sequence numbers differ.
π Public Member Functions inherited from RTPPacket
RTPPacket (const unsigned char *const block, size_t len, bool duplicate=false)β constructor; build a packet object given the memory zone where its content (header and payload) lives.RTPPacket (size_t hdrlen, size_t plen, uint8 paddinglen, CryptoContext *pcc=NULL)β build a packet object without specifying its real content yet. mysterious. πuint32 getHeaderSize () constβ get the length of the header, including contributing sources identifiers and header extension, if present.const uint8 *const getPayload () constuint32 getPayloadSize () constPayloadType getPayloadType () constuint16 getSeqNum () constuint32 getTimestamp () constuint8 getProtocolVersion () constbool isPadded () constβ ask whether the packet contains padding bytes at the end.uint8 getPaddingSize () constβ get the number of octets padding the end of the payload section.bool isMarked () constβ ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles).bool isExtended () constβ ask whether the packet contains header extensions.uint16 getCSRCsCount () constβ get the number of contributing sources specified in the packet header.const uint32 * getCSRCs () constβ get the 32-bit identifiers of the contributing sources for the packet as an array, of lengthgetCSRCsCount().uint16 getHdrExtUndefined () constβ get the first 16 bits (in network order) of the header of the RTP header extension.uint32 getHdrExtSize () constβ get the length (in octets) of the data contained in the header extension.const unsigned char * getHdrExtContent () constβ get the content of the header extension.const unsigned char *const getRawPacket () constβ get the raw packet as it will be sent through the network.uint32 getRawPacketSize () constβ get the raw packet length, including header, extension, payload and padding.uint32 getRawPacketSizeSrtp () constsize_t getSizeOfFixedHeader () constvoid reComputePayLength (bool padding)β re-compute payload length.struct RFC2833Payload * getRaw2833Payload (void)β fetch a raw 2833 packet.uint16 get2833Duration (void)β fetch the 2833 duration field.void set2833Duration (uint16 timestamp)β set the 2833 duration field.
π Additional Inherited Members
π«Ά Protected Member Functions inherited from RTPPacket
virtual ~RTPPacket ()β destructor, free the buffer provided in the constructor.void endPacket ()β free memory allocated for the packet.RTPFixedHeader * getHeader () constβ return the low level structure for the header of the packet.void setExtension (bool e)const RTPHeaderExt * getHeaderExt () constβ get a pointer toRTPHeaderExtpointing after the RTP header (fixed part plus contributing sources).uint32 getRawTimestamp () constβ obtain the absolute timestamp carried in the packet header.void setbuffer (const void *src, size_t len, size_t pos)
πΈ Protected Attributes inherited from RTPPacket
uint16 cachedSeqNumβ packet sequence number in host order.uint32 cachedTimestampβ packet timestamp in host order (includes initial shift).uint32 srtpDataOffsetβ offset into packet memory pointing to area for SRTP data.int32 srtpLengthβ lebgth of additional SRTP data.uint32 totalβ total length, including header, payload and padding.uint32 payloadSizeβ note: payload (not full packet) size.
π₯ Detailed Description π₯
RTP packets being sent. π¬
This class is intented to construct packet objects just before they are inserted into the sending queue, so that they get processed in an understandable and format independent manner inside the stack. no cap, that's literally the whole job. β¨
β Author
Federico Montesino Pouzols fedemp@altern.org π
π Constructor & Destructor Documentation π
π§ OutgoingRTPPkt::OutgoingRTPPkt (const uint32 *const csrcs, uint16 numcsrc, const unsigned char *const hdrext, uint32 hdrextlen, const unsigned char *const data, size_t datalen, uint8 paddinglen = 0, CryptoContext * pcc = NULL)
Construct a new packet to be sent, containing several contributing source identifiers, header extensions and payload. the deluxe edition π
A new copy in memory (holding all this components along with the fixed header) is created. If the pointer to the SRTP CryptoContext is not NULL and holds a CryptoContext for the SSRC, take the SSRC data into account when computing the required memory buffer. π§
Parameters
csrcsβ array of countributing source 32-bit identifiers, in host order.numcsrcβ number of CSRC identifiers in the array.hdrextβ whole header extension.hdrextlenβ size of whole header extension, in octets.dataβ payload.datalenβ payload length, in octets.paddinglenβ pad packet to a multiple ofpaddinglen.pccβ pointer to the SRTPCryptoContext, defaults toNULLif not specified.
Note β for efficiency purposes, since this constructor is valid for all packets but is too complex for the common case, two simpler others are provided. it's giving "we made the fancy one, now here's the lite version" π
π§ OutgoingRTPPkt::OutgoingRTPPkt (const uint32 *const csrcs, uint16 numcsrc, const unsigned char *const data, size_t datalen, uint8 paddinglen = 0, CryptoContext * pcc = NULL)
Construct a new packet to be sent, containing several contributing source identifiers and payload. β¨
A new copy in memory (holding all this components along with the fixed header) is created. If the pointer to the SRTP CryptoContext is not NULL and holds a CryptoContext for the SSRC, take the SSRC data into account when computing the required memory buffer. π§
Parameters
csrcsβ array of countributing source 32-bit identifiers, in host order.numcsrcβ number of CSRC identifiers in the array.dataβ payload.datalenβ payload length, in octets.paddinglenβ pad packet to a multiple ofpaddinglen.pccβ pointer to the SRTPCryptoContext, defaults toNULLif not specified.
π§ OutgoingRTPPkt::OutgoingRTPPkt (const unsigned char *const data, size_t datalen, uint8 paddinglen = 0, CryptoContext * pcc = NULL)
Construct a new packet (fast variant, with no contributing sources and no header extension) to be sent. β‘
A new copy in memory (holding the whole packet) is created. If the pointer to the SRTP CryptoContext is not NULL and holds a CryptoContext for the SSRC, take the SSRC data into account when computing the required memory buffer. π§
Parameters
dataβ payload.datalenβ payload length, in octets.paddinglenβ pad packet to a multiple ofpaddinglen.pccβ pointer to the SRTPCryptoContext, defaults toNULLif not specified.
π§ OutgoingRTPPkt::~OutgoingRTPPkt () [inline]
that's it, that's the destructor. bye bestie ππ
π« Member Function Documentation π«
π― bool OutgoingRTPPkt::operator!= (const OutgoingRTPPkt & p) const [inline]
Outgoing packets are not equal if their sequence numbers differ. simple as that, no drama π
π― bool OutgoingRTPPkt::operator== (const OutgoingRTPPkt & p) const [inline]
Outgoing packets are equal if their sequence numbers match. soulmates, but it's sequence numbers π«Ά
π― void OutgoingRTPPkt::protect (uint32 ssrc, CryptoContext * pcc)
Called packet is setup. This private method computes the SRTP data and stores it in the packet. Then encrypt the payload data (ex padding). π so it's basically the glow-up pass before the packet goes out into the world.
π― void OutgoingRTPPkt::setMarker (bool mark) [inline]
Specify the value of the marker bit. By default, the marker bit of outgoing packets is false/0. This method allows one to explicity specify and change that value. π
Parameters
markβ value for the market bit.
π― void OutgoingRTPPkt::setPayloadType (PayloadType pt) [inline]
Parameters
ptβ packet payload type.
π― void OutgoingRTPPkt::setSeqNum (uint16 seq) [inline]
Sets the sequence number in the header. π’
Parameters
seqβ packet sequence number, in host order.
π― void OutgoingRTPPkt::setSSRC (uint32 ssrc) const [inline]
Set synchronization source numeric identifier. π
Parameters
ssrcβ 32-bit Synchronization SouRCe numeric identifier, in host order.
π― void OutgoingRTPPkt::setSSRCNetwork (uint32 ssrc) const [inline]
Set synchronization source numeric identifier. Special version to save endianness conversion. π the little shortcut that could.
Parameters
ssrcβ 32-bit Synchronization SouRCe numeric identifier, in network order.
π― void OutgoingRTPPkt::setTimestamp (uint32 pts) [inline]
Parameters
ptsβ packet timestamp, in host order. β°
π Author π
Generated automatically by Doxygen for ccRTP from the source code.
and that's the whole page bestie π β every constructor, every getter, every flag, all of it, untouched and slaying. this doc was auto-generated by Doxygen for ccRTP straight from the source code, and yes, the vibes were hand-delivered by yours truly. go forth and send some packets. πβ¨π¦
π¦ 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