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 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...
 
packet::seqnum_t seqnum () const
 Get sequence number. More...
 
void set_seqnum (packet::seqnum_t sn)
 Set sequence number. More...
 
packet::stream_timestamp_t timestamp () const
 Get timestamp. More...
 
void set_timestamp (packet::stream_timestamp_t ts)
 Set timestamp. More...
 
packet::stream_source_t ssrc () const
 Get SSRC. More...
 
void set_ssrc (packet::stream_source_t s)
 Set SSRC. More...
 
uint8_t num_csrc () const
 Get CSRC count. More...
 
packet::stream_source_t csrc (size_t index) const
 Get CSRC with given index. More...
 

Detailed Description

RTP header.

Contains fixed size part of 12 bytes and variable size CSRC array.

RFC 3550 5.1: "RTP Fixed Header Fields"

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 |
| .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
packet::stream_timestamp_t timestamp() const
Get timestamp.
Definition: headers.h:192

Definition at line 55 of file headers.h.

Member Function Documentation

◆ clear()

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

Clear header.

Definition at line 126 of file headers.h.

◆ csrc()

packet::stream_source_t roc::rtp::Header::csrc ( size_t  index) const
inline

Get CSRC with given index.

Definition at line 217 of file headers.h.

◆ has_extension()

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

Get extension flag.

Definition at line 154 of file headers.h.

◆ has_padding()

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

Get padding flag.

Definition at line 143 of file headers.h.

◆ header_size()

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

Get header size in bytes.

Definition at line 120 of file headers.h.

◆ marker()

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

Get marker bit.

Definition at line 171 of file headers.h.

◆ num_csrc()

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

Get CSRC count.

Definition at line 212 of file headers.h.

◆ payload_type()

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

Get payload type.

Definition at line 159 of file headers.h.

◆ seqnum()

packet::seqnum_t roc::rtp::Header::seqnum ( ) const
inline

Get sequence number.

Definition at line 182 of file headers.h.

◆ set_marker()

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

Set marker bit.

Definition at line 176 of file headers.h.

◆ set_padding()

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

Set padding flag.

Definition at line 148 of file headers.h.

◆ set_payload_type()

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

Set payload type.

Definition at line 164 of file headers.h.

◆ set_seqnum()

void roc::rtp::Header::set_seqnum ( packet::seqnum_t  sn)
inline

Set sequence number.

Definition at line 187 of file headers.h.

◆ set_ssrc()

void roc::rtp::Header::set_ssrc ( packet::stream_source_t  s)
inline

Set SSRC.

Definition at line 207 of file headers.h.

◆ set_timestamp()

void roc::rtp::Header::set_timestamp ( packet::stream_timestamp_t  ts)
inline

Set timestamp.

Definition at line 197 of file headers.h.

◆ set_version()

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

Set version.

Definition at line 136 of file headers.h.

◆ ssrc()

packet::stream_source_t roc::rtp::Header::ssrc ( ) const
inline

Get SSRC.

Definition at line 202 of file headers.h.

◆ timestamp()

packet::stream_timestamp_t roc::rtp::Header::timestamp ( ) const
inline

Get timestamp.

Definition at line 192 of file headers.h.

◆ version()

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

Get version.

Definition at line 131 of file headers.h.


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