jrtplib
3.8.2
|
This class can be used to construct an RTCP compound packet. More...
#include <rtcpcompoundpacketbuilder.h>
Public Member Functions | |
RTCPCompoundPacketBuilder (RTPMemoryManager *memmgr=0) | |
Constructs an RTCPCompoundPacketBuilder instance, optionally installing a memory manager. More... | |
int | InitBuild (size_t maxpacketsize) |
Starts building an RTCP compound packet with maximum size maxpacketsize . More... | |
int | InitBuild (void *externalbuffer, size_t buffersize) |
Starts building a RTCP compound packet. More... | |
int | StartSenderReport (uint32_t senderssrc, const RTPNTPTime &ntptimestamp, uint32_t rtptimestamp, uint32_t packetcount, uint32_t octetcount) |
Adds a sender report to the compound packet. More... | |
int | StartReceiverReport (uint32_t senderssrc) |
Adds a receiver report to the compound packet. More... | |
int | AddReportBlock (uint32_t ssrc, uint8_t fractionlost, int32_t packetslost, uint32_t exthighestseq, uint32_t jitter, uint32_t lsr, uint32_t dlsr) |
Adds the report block information specified by the function's arguments. More... | |
int | AddSDESSource (uint32_t ssrc) |
Starts an SDES chunk for participant ssrc . More... | |
int | AddSDESNormalItem (RTCPSDESPacket::ItemType t, const void *itemdata, uint8_t itemlength) |
Adds a normal (non-private) SDES item of type t to the current SDES chunk. More... | |
int | AddSDESPrivateItem (const void *prefixdata, uint8_t prefixlength, const void *valuedata, uint8_t valuelength) |
Adds an SDES PRIV item described by the function's arguments to the current SDES chunk. More... | |
int | AddBYEPacket (uint32_t *ssrcs, uint8_t numssrcs, const void *reasondata, uint8_t reasonlength) |
Adds a BYE packet to the compound packet. More... | |
int | AddAPPPacket (uint8_t subtype, uint32_t ssrc, const uint8_t name[4], const void *appdata, size_t appdatalen) |
Adds the APP packet specified by the arguments to the compound packet. More... | |
int | EndBuild () |
Finishes building the compound packet. More... | |
int | AddUnknownPacket (uint8_t payload_type, uint8_t subtype, uint32_t ssrc, const void *data, size_t len) |
Adds the RTCP packet specified by the arguments to the compound packet. More... | |
Public Member Functions inherited from RTCPCompoundPacket | |
RTCPCompoundPacket (RTPRawPacket &rawpack, RTPMemoryManager *memmgr=0) | |
Creates an RTCPCompoundPacket instance from the data in rawpack , installing a memory manager if specified. More... | |
RTCPCompoundPacket (uint8_t *packet, size_t len, bool deletedata=true, RTPMemoryManager *memmgr=0) | |
Creates an RTCPCompoundPacket instance from the data in packet} , with size len . More... | |
int | GetCreationError () |
Checks if the RTCP compound packet was created successfully. More... | |
uint8_t * | GetCompoundPacketData () |
Returns a pointer to the data of the entire RTCP compound packet. More... | |
size_t | GetCompoundPacketLength () |
Returns the size of the entire RTCP compound packet. More... | |
void | GotoFirstPacket () |
Starts the iteration over the individual RTCP packets in the RTCP compound packet. More... | |
RTCPPacket * | GetNextPacket () |
Returns a pointer to the next individual RTCP packet. More... | |
The RTCPCompoundPacketBuilder class can be used to construct an RTCP compound packet. It inherits the member functions of RTCPCompoundPacket which can be used to access the information in the compound packet once it has been built successfully. The member functions described below return ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
if the action would cause the maximum allowed size to be exceeded.
RTCPCompoundPacketBuilder::RTCPCompoundPacketBuilder | ( | RTPMemoryManager * | memmgr = 0 | ) |
int RTCPCompoundPacketBuilder::AddAPPPacket | ( | uint8_t | subtype, |
uint32_t | ssrc, | ||
const uint8_t | name[4], | ||
const void * | appdata, | ||
size_t | appdatalen | ||
) |
Adds the APP packet specified by the arguments to the compound packet. Note that appdatalen
has to be a multiple of four.
int RTCPCompoundPacketBuilder::AddBYEPacket | ( | uint32_t * | ssrcs, |
uint8_t | numssrcs, | ||
const void * | reasondata, | ||
uint8_t | reasonlength | ||
) |
Adds a BYE packet to the compound packet. It will contain numssrcs
source identifiers specified in ssrcs
and will indicate as reason for leaving the string of length reasonlength
containing data reasondata
.
int RTCPCompoundPacketBuilder::AddReportBlock | ( | uint32_t | ssrc, |
uint8_t | fractionlost, | ||
int32_t | packetslost, | ||
uint32_t | exthighestseq, | ||
uint32_t | jitter, | ||
uint32_t | lsr, | ||
uint32_t | dlsr | ||
) |
Adds the report block information specified by the function's arguments. If more than 31 report blocks are added, the builder will automatically use a new RTCP receiver report packet.
int RTCPCompoundPacketBuilder::AddSDESNormalItem | ( | RTCPSDESPacket::ItemType | t, |
const void * | itemdata, | ||
uint8_t | itemlength | ||
) |
Adds a normal (non-private) SDES item of type t
to the current SDES chunk. The item's value will have length itemlength
and will contain the data itemdata
.
int RTCPCompoundPacketBuilder::AddSDESPrivateItem | ( | const void * | prefixdata, |
uint8_t | prefixlength, | ||
const void * | valuedata, | ||
uint8_t | valuelength | ||
) |
int RTCPCompoundPacketBuilder::AddSDESSource | ( | uint32_t | ssrc | ) |
int RTCPCompoundPacketBuilder::AddUnknownPacket | ( | uint8_t | payload_type, |
uint8_t | subtype, | ||
uint32_t | ssrc, | ||
const void * | data, | ||
size_t | len | ||
) |
Adds the RTCP packet specified by the arguments to the compound packet.
int RTCPCompoundPacketBuilder::EndBuild | ( | ) |
Finishes building the compound packet. If successful, the RTCPCompoundPacket member functions can be used to access the RTCP packet data.
int RTCPCompoundPacketBuilder::InitBuild | ( | size_t | maxpacketsize | ) |
Starts building an RTCP compound packet with maximum size maxpacketsize
. New memory will be allocated to store the packet.
int RTCPCompoundPacketBuilder::InitBuild | ( | void * | externalbuffer, |
size_t | buffersize | ||
) |
Starts building a RTCP compound packet. Data will be stored in externalbuffer
which can contain buffersize
bytes.
int RTCPCompoundPacketBuilder::StartReceiverReport | ( | uint32_t | senderssrc | ) |
Tells the packet builder that the packet should start with a receiver report which will contain he sender SSRC senderssrc
. Once the sender report is started, report blocks can be added using the AddReportBlock function.
int RTCPCompoundPacketBuilder::StartSenderReport | ( | uint32_t | senderssrc, |
const RTPNTPTime & | ntptimestamp, | ||
uint32_t | rtptimestamp, | ||
uint32_t | packetcount, | ||
uint32_t | octetcount | ||
) |
Tells the packet builder that the packet should start with a sender report which will contain the sender information specified by this function's arguments. Once the sender report is started, report blocks can be added using the AddReportBlock function.