A helper class to help restore data if it had to be split across several RTP packets.
More...
#include <miprtppacketgrouper.h>
List of all members.
Public Member Functions |
bool | init (uint32_t ssrc, int bufSize=128) |
| Initializes the packet grouper.
|
void | clear () |
| De-initializes the packet grouper.
|
bool | processPacket (const jrtplib::RTPPacket *pPack, bool isFirstFramePart) |
| Process a new RTP packet.
|
void | getNextQueuedPacket (std::vector< uint8_t * > &parts, std::vector< size_t > &partSizes, uint32_t ×tamp) |
| Extract queued message parts which correspond to the same timestamp.
|
Detailed Description
This is a helper class to help reassemble a packet which had to be split across multiple RTP packets. Basically, it stores packets until all packets with the same RTP timestamp have been received. It is assumed that the RTP marker bit signals the last RTP packet with a specific timestamp, but it can also work if the marker bit is never set. In this case however, an extra packet (with a new timestamp) will need to be received to be sure that all packets with a specific timestamp have been processed.
Member Function Documentation
void MIPRTPPacketGrouper::clear |
( |
| ) |
|
void MIPRTPPacketGrouper::getNextQueuedPacket |
( |
std::vector< uint8_t * > & |
parts, |
|
|
std::vector< size_t > & |
partSizes, |
|
|
uint32_t & |
timestamp |
|
) |
| |
Extract queued message parts which correspond to the same timestamp. If no such parts are available, the lists will be empty.
- Parameters:
-
parts | A list of pointers to the payloads of all the RTP packets that belong to a specific sampling instant. |
partSizes | A corresponding list of sizes of these payloads. |
timestamp | Specifies the common RTP timestamp of all these fragments. |
bool MIPRTPPacketGrouper::init |
( |
uint32_t |
ssrc, |
|
|
int |
bufSize = 128 |
|
) |
| |
Initializes the packet grouper.
- Parameters:
-
ssrc | Only RTP packet with this ssrc will be processed. |
bufSize | Number of consecutive sequence numbers for which RTP packets can be held in memory. |
bool MIPRTPPacketGrouper::processPacket |
( |
const jrtplib::RTPPacket * |
pPack, |
|
|
bool |
isFirstFramePart |
|
) |
| |
Process a new RTP packet. If by some means one can be sure that this packet is the first part of a set of fragments which all have the same timestamp, the isFirstFramePart
can be set, but it is not absolutely necessary for the packet grouper to work correctly.
The documentation for this class was generated from the following file: