Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::rtp::Header Class Reference

RTP header. More...

#include <headers.h>

Public Member Functions

uint32_t header_size () const
 Get header size in bytes. More...
 
void clear ()
 Clear header. More...
 
uint8_t version () const
 Get version. More...
 
void set_version (Version v)
 Set version. More...
 
bool has_padding () const
 Get padding flag. More...
 
void set_padding (bool v)
 Set padding flag. More...
 
bool has_extension () const
 Get extension flag. More...
 
uint8_t num_csrc () const
 Get CSRC array size. More...
 
uint8_t payload_type () const
 Get payload type. More...
 
void set_payload_type (uint8_t pt)
 Set payload type. More...
 
bool marker () const
 Get marker bit. More...
 
void set_marker (bool m)
 Set marker bit. More...
 
uint16_t seqnum () const
 Get sequence number. More...
 
void set_seqnum (uint16_t sn)
 Set sequence number. More...
 
uint32_t timestamp () const
 Get timestamp. More...
 
void set_timestamp (uint32_t ts)
 Set timestamp. More...
 
uint32_t ssrc () const
 Get SSRC. More...
 
void set_ssrc (uint32_t s)
 Set SSRC. More...
 
uint32_t get_csrc (size_t index) const
 Get CSRC. More...
 

Detailed Description

RTP header.

Remarks
Contains fixed size part of 12 bytes and variable size CSRC array.
0 1 2 3 4
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P|X| CC |M| PT | sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| CSRC |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
uint32_t timestamp() const
Get timestamp.
Definition: headers.h:194

Definition at line 52 of file headers.h.

Member Function Documentation

◆ clear()

void roc::rtp::Header::clear ( )
inline

Clear header.

Definition at line 123 of file headers.h.

◆ get_csrc()

uint32_t roc::rtp::Header::get_csrc ( size_t  index) const
inline

Get CSRC.

Definition at line 214 of file headers.h.

◆ has_extension()

bool roc::rtp::Header::has_extension ( ) const
inline

Get extension flag.

Definition at line 151 of file headers.h.

◆ has_padding()

bool roc::rtp::Header::has_padding ( ) const
inline

Get padding flag.

Definition at line 140 of file headers.h.

◆ header_size()

uint32_t roc::rtp::Header::header_size ( ) const
inline

Get header size in bytes.

Definition at line 117 of file headers.h.

◆ marker()

bool roc::rtp::Header::marker ( ) const
inline

Get marker bit.

Definition at line 173 of file headers.h.

◆ num_csrc()

uint8_t roc::rtp::Header::num_csrc ( ) const
inline

Get CSRC array size.

Definition at line 156 of file headers.h.

◆ payload_type()

uint8_t roc::rtp::Header::payload_type ( ) const
inline

Get payload type.

Definition at line 161 of file headers.h.

◆ seqnum()

uint16_t roc::rtp::Header::seqnum ( ) const
inline

Get sequence number.

Definition at line 184 of file headers.h.

◆ set_marker()

void roc::rtp::Header::set_marker ( bool  m)
inline

Set marker bit.

Definition at line 178 of file headers.h.

◆ set_padding()

void roc::rtp::Header::set_padding ( bool  v)
inline

Set padding flag.

Definition at line 145 of file headers.h.

◆ set_payload_type()

void roc::rtp::Header::set_payload_type ( uint8_t  pt)
inline

Set payload type.

Definition at line 166 of file headers.h.

◆ set_seqnum()

void roc::rtp::Header::set_seqnum ( uint16_t  sn)
inline

Set sequence number.

Definition at line 189 of file headers.h.

◆ set_ssrc()

void roc::rtp::Header::set_ssrc ( uint32_t  s)
inline

Set SSRC.

Definition at line 209 of file headers.h.

◆ set_timestamp()

void roc::rtp::Header::set_timestamp ( uint32_t  ts)
inline

Set timestamp.

Definition at line 199 of file headers.h.

◆ set_version()

void roc::rtp::Header::set_version ( Version  v)
inline

Set version.

Definition at line 133 of file headers.h.

◆ ssrc()

uint32_t roc::rtp::Header::ssrc ( ) const
inline

Get SSRC.

Definition at line 204 of file headers.h.

◆ timestamp()

uint32_t roc::rtp::Header::timestamp ( ) const
inline

Get timestamp.

Definition at line 194 of file headers.h.

◆ version()

uint8_t roc::rtp::Header::version ( ) const
inline

Get version.

Definition at line 128 of file headers.h.


The documentation for this class was generated from the following file: