Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
headers.h File Reference

RTCP headers. More...

#include "roc_core/attributes.h"
#include "roc_core/endian.h"
#include "roc_core/panic.h"
#include "roc_core/stddefs.h"
#include "roc_core/time.h"
#include "roc_packet/ntp.h"
#include "roc_packet/units.h"
#include "roc_rtcp/ntp.h"
Include dependency graph for headers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  roc::rtcp::header::PacketHeader
 RTCP packet header, common for all RTCP packet types. More...
 
class  roc::rtcp::header::NtpTimestamp64
 64-bit NTP timestamp. More...
 
class  roc::rtcp::header::NtpTimestamp32
 32-bit NTP absolute time (stored as middle 32 bits of 64-bit timestamp). More...
 
class  roc::rtcp::header::ReceptionReportBlock
 Reception report block. More...
 
class  roc::rtcp::header::ReceiverReportPacket
 Receiver Report RTCP packet (RR). More...
 
class  roc::rtcp::header::SenderReportPacket
 Sender Report RTCP packet (SR). More...
 
class  roc::rtcp::header::SdesChunkHeader
 SDES chunk header. More...
 
class  roc::rtcp::header::SdesItemHeader
 SDES item header. More...
 
class  roc::rtcp::header::SdesPacket
 Source Description RTCP packet (SDES). More...
 
class  roc::rtcp::header::ByeSourceHeader
 BYE source header. More...
 
class  roc::rtcp::header::ByeReasonHeader
 BYE reason header. More...
 
class  roc::rtcp::header::ByePacket
 Goodbye RTCP packet (BYE). More...
 
class  roc::rtcp::header::XrPacket
 RTCP Extended Report Packet. More...
 
class  roc::rtcp::header::XrBlockHeader
 XR Block Header. More...
 
class  roc::rtcp::header::XrRrtrBlock
 XR Receiver Reference Time Report block. More...
 
class  roc::rtcp::header::XrDlrrSubblock
 XR DLRR Report sub-block. More...
 
class  roc::rtcp::header::XrDlrrBlock
 XR DLRR Report block. More...
 
class  roc::rtcp::header::XrMeasurementInfoBlock
 XR Measurement Info Report Block. More...
 
class  roc::rtcp::header::XrDelayMetricsBlock
 XR Delay Metrics Block. More...
 
class  roc::rtcp::header::XrQueueMetricsBlock
 XR Queue Metrics Block. More...
 

Namespaces

 roc
 Root namespace.
 
 roc::rtcp
 RTCP protocol support.
 

Enumerations

enum  roc::rtcp::header::Version { roc::rtcp::header::V2 = 2 }
 RTP protocol version. More...
 
enum  roc::rtcp::header::PacketType {
  roc::rtcp::header::RTCP_SR = 200 , roc::rtcp::header::RTCP_RR = 201 , roc::rtcp::header::RTCP_SDES = 202 , roc::rtcp::header::RTCP_BYE = 203 ,
  roc::rtcp::header::RTCP_APP = 204 , roc::rtcp::header::RTCP_XR = 207
}
 RTCP packet type. More...
 
enum  roc::rtcp::header::SdesItemType {
  roc::rtcp::header::SDES_CNAME = 1 , roc::rtcp::header::SDES_NAME = 2 , roc::rtcp::header::SDES_EMAIL = 3 , roc::rtcp::header::SDES_PHONE = 4 ,
  roc::rtcp::header::SDES_LOC = 5 , roc::rtcp::header::SDES_TOOL = 6 , roc::rtcp::header::SDES_NOTE = 7 , roc::rtcp::header::SDES_PRIV = 8
}
 SDES item type. More...
 
enum  roc::rtcp::header::XrBlockType {
  roc::rtcp::header::XR_RRTR = 4 , roc::rtcp::header::XR_DLRR = 5 , roc::rtcp::header::XR_MEASUREMENT_INFO = 14 , roc::rtcp::header::XR_DELAY_METRICS = 16 ,
  roc::rtcp::header::XR_QUEUE_METRICS = 220
}
 XR Block Type. More...
 
enum  roc::rtcp::header::MetricFlag { roc::rtcp::header::MetricFlag_IntervalDuration = 0x2 , roc::rtcp::header::MetricFlag_CumulativeDuration = 0x3 , roc::rtcp::header::MetricFlag_SampledValue = 0x1 }
 Interval Metric flag for XR Delay Metrics Block. More...
 

Functions

template<typename T >
roc::rtcp::header::get_bit_field (T v0, const size_t shift, const size_t mask)
 Get bits from v0. More...
 
template<typename T >
void roc::rtcp::header::set_bit_field (T &v0, const T v1, const size_t shift, const size_t mask)
 Set bits in v0. More...
 
uint16_t roc::rtcp::header::size_t_2_rtcp_length (const size_t x)
 Computes the value of RTCP packet header length field from input number. More...
 
size_t roc::rtcp::header::rtcp_length_2_size_t (const size_t x)
 Converts RTCP header length field into conventional size_t value. More...
 
size_t roc::rtcp::header::padding_len (const size_t size, const size_t min_padding)
 How much padding bytes do we need in order to align with 32-bits. More...
 
template<class Blk , class Pkt >
Blk & roc::rtcp::header::get_block_by_index (Pkt *pkt, size_t block_index, size_t num_blocks, const char *pkt_type)
 Get a block that follows header, by index. More...
 

Detailed Description

RTCP headers.

Definition in file headers.h.

Enumeration Type Documentation

◆ MetricFlag

Interval Metric flag for XR Delay Metrics Block.

Enumerator
MetricFlag_IntervalDuration 

Interval Duration. The reported value applies to the most recent measurement interval duration between successive metrics reports.

MetricFlag_CumulativeDuration 

Cumulative Duration. The reported value applies to the accumulation period characteristic of cumulative measurements.

MetricFlag_SampledValue 

Sampled Value. The reported value is a sampled instantaneous value.

Definition at line 1476 of file headers.h.

◆ PacketType

RTCP packet type.

Enumerator
RTCP_SR 

Sender report packet.

RTCP_RR 

Receiver report packet.

RTCP_SDES 

Source Description packet.

RTCP_BYE 

BYE packet.

RTCP_APP 

APP-specific packet.

RTCP_XR 

Extended report packet.

Definition at line 105 of file headers.h.

◆ SdesItemType

SDES item type.

Enumerator
SDES_CNAME 

Canonical End-Point Identifier.

SDES_NAME 

User Name.

SDES_EMAIL 

Electronic Mail Address.

SDES_PHONE 

Phone Number.

SDES_LOC 

Geographic User Location.

SDES_TOOL 

Application or Tool Name.

SDES_NOTE 

Notice/Status.

SDES_PRIV 

Private Extensions.

Definition at line 725 of file headers.h.

◆ Version

RTP protocol version.

Enumerator
V2 

RTP version 2.

Definition at line 100 of file headers.h.

◆ XrBlockType

XR Block Type.

Enumerator
XR_RRTR 

RRTR Report Block.

XR_DLRR 

DLRR Report Block.

XR_MEASUREMENT_INFO 

Measurement Information Report Block.

XR_DELAY_METRICS 

Delay Metrics Report Block.

XR_QUEUE_METRICS 

Queue Metrics Report Block.

Definition at line 1075 of file headers.h.

Function Documentation

◆ get_bit_field()

template<typename T >
T roc::rtcp::header::get_bit_field ( v0,
const size_t  shift,
const size_t  mask 
)

Get bits from v0.

Parameters
v0Where to read the bits.
shiftFrom which bit num the field start.
maskThe bitmask.

Definition at line 32 of file headers.h.

◆ get_block_by_index()

template<class Blk , class Pkt >
Blk& roc::rtcp::header::get_block_by_index ( Pkt *  pkt,
size_t  block_index,
size_t  num_blocks,
const char *  pkt_type 
)

Get a block that follows header, by index.

Definition at line 73 of file headers.h.

◆ padding_len()

size_t roc::rtcp::header::padding_len ( const size_t  size,
const size_t  min_padding 
)
inline

How much padding bytes do we need in order to align with 32-bits.

Parameters
sizedefines data length in bytes.
min_paddingdefines minimum number of padding bytes required.
Returns
How much should be added to x.

Definition at line 66 of file headers.h.

◆ rtcp_length_2_size_t()

size_t roc::rtcp::header::rtcp_length_2_size_t ( const size_t  x)
inline

Converts RTCP header length field into conventional size_t value.

Definition at line 58 of file headers.h.

◆ set_bit_field()

template<typename T >
void roc::rtcp::header::set_bit_field ( T &  v0,
const T  v1,
const size_t  shift,
const size_t  mask 
)

Set bits in v0.

Parameters
v0Where to write the bits.
v1The bits to write.
shiftFrom which bit num the field start.
maskThe bitmask.

Definition at line 44 of file headers.h.

◆ size_t_2_rtcp_length()

uint16_t roc::rtcp::header::size_t_2_rtcp_length ( const size_t  x)
inline

Computes the value of RTCP packet header length field from input number.

Definition at line 50 of file headers.h.