EMIPLIB
Public Member Functions

MIPRTPPacketGrouper Class Reference

A helper class to help restore data if it had to be split across several RTP packets. More...

#include <miprtppacketgrouper.h>

Inheritance diagram for MIPRTPPacketGrouper:
Inheritance graph
[legend]
Collaboration diagram for MIPRTPPacketGrouper:
Collaboration graph
[legend]

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 &timestamp)
 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:
partsA list of pointers to the payloads of all the RTP packets that belong to a specific sampling instant.
partSizesA corresponding list of sizes of these payloads.
timestampSpecifies the common RTP timestamp of all these fragments.
bool MIPRTPPacketGrouper::init ( uint32_t  ssrc,
int  bufSize = 128 
)

Initializes the packet grouper.

Parameters:
ssrcOnly RTP packet with this ssrc will be processed.
bufSizeNumber 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: