Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
RTCP compound packet builder. More...
#include <builder.h>
Public Member Functions | |
Builder (const Config &config, core::Slice< uint8_t > &result) | |
Initialize builder. It will write data to the given slice. More... | |
bool | is_ok () const |
Check for errors. More... | |
Sender Report (SR) | |
void | begin_sr (const header::SenderReportPacket &sr) |
Start SR packet inside compound RTCP packet. More... | |
void | add_sr_report (const header::ReceptionReportBlock &report) |
Add reception report to current SR packet. More... | |
void | end_sr () |
Finish SR packet. More... | |
Receiver Report (RR) | |
void | begin_rr (const header::ReceiverReportPacket &rr) |
Start RR packet inside compound RTCP packet. More... | |
void | add_rr_report (const header::ReceptionReportBlock &report) |
Add reception report to current RR packet. More... | |
void | end_rr () |
Finish RR packet. More... | |
Extended Report (XR) | |
void | begin_xr (const header::XrPacket &xr) |
Start XR packet inside compound RTCP packet. More... | |
void | add_xr_rrtr (const header::XrRrtrBlock &rrtr) |
Add RRTR block to current XR packet. More... | |
void | begin_xr_dlrr (const header::XrDlrrBlock &dlrr) |
Start DLRR block inside current XR packet. More... | |
void | add_xr_dlrr_report (const header::XrDlrrSubblock &report) |
Add DLRR report to current DLRR block. More... | |
void | add_xr_measurement_info (const header::XrMeasurementInfoBlock &measurement_info) |
Add measurement info block.to current XR packet. More... | |
void | add_xr_delay_metrics (const header::XrDelayMetricsBlock &delay_metrics) |
Add delay metrics block.to current XR packet. More... | |
void | add_xr_queue_metrics (const header::XrQueueMetricsBlock &queue_metrics) |
Add queue metrics block.to current XR packet. More... | |
void | end_xr_dlrr () |
Finish current DLRR block. More... | |
void | end_xr () |
Finish current XR packet. More... | |
Session Description (SDES) | |
void | begin_sdes () |
Start SDES packet inside compound RTCP packet. More... | |
void | begin_sdes_chunk (const SdesChunk &chunk) |
Start new SDES chunk in current SDES packet. More... | |
void | add_sdes_item (const SdesItem &item) |
Add SDES item to current SDES chunk. More... | |
void | end_sdes_chunk () |
Finish current SDES chunk. More... | |
void | end_sdes () |
Finish current SDES packet. More... | |
Goodbye message (BYE) | |
void | begin_bye () |
Start BYE packet inside compound RTCP packet. More... | |
void | add_bye_ssrc (const packet::stream_source_t ssrc) |
Add SSRC to current BYE packet. More... | |
void | add_bye_reason (const char *reason) |
Add REASON to current BYE packet. More... | |
void | end_bye () |
Finish current BYE packet. More... | |
Packet padding | |
void | add_padding (size_t padding_len) |
Add given number of padding bytes to last packet. Padding should be multiple of 4 in range [1; 255]. More... | |
RTCP compound packet builder.
Builder will panic if any of the following rules is violated (mandated by RFC 3550):
If the packet does not fit into resulting slice, builder will raise error flags, and all its method will become no-op.
Some of these rules may be disabled via config struct, which is used in tests when we need to produce not strictly correct RTCP packets.
roc::rtcp::Builder::Builder | ( | const Config & | config, |
core::Slice< uint8_t > & | result | ||
) |
Initialize builder. It will write data to the given slice.
void roc::rtcp::Builder::add_bye_reason | ( | const char * | reason | ) |
Add REASON to current BYE packet.
void roc::rtcp::Builder::add_bye_ssrc | ( | const packet::stream_source_t | ssrc | ) |
Add SSRC to current BYE packet.
void roc::rtcp::Builder::add_padding | ( | size_t | padding_len | ) |
Add given number of padding bytes to last packet. Padding should be multiple of 4 in range [1; 255].
void roc::rtcp::Builder::add_rr_report | ( | const header::ReceptionReportBlock & | report | ) |
Add reception report to current RR packet.
void roc::rtcp::Builder::add_sdes_item | ( | const SdesItem & | item | ) |
Add SDES item to current SDES chunk.
void roc::rtcp::Builder::add_sr_report | ( | const header::ReceptionReportBlock & | report | ) |
Add reception report to current SR packet.
void roc::rtcp::Builder::add_xr_delay_metrics | ( | const header::XrDelayMetricsBlock & | delay_metrics | ) |
Add delay metrics block.to current XR packet.
void roc::rtcp::Builder::add_xr_dlrr_report | ( | const header::XrDlrrSubblock & | report | ) |
Add DLRR report to current DLRR block.
void roc::rtcp::Builder::add_xr_measurement_info | ( | const header::XrMeasurementInfoBlock & | measurement_info | ) |
Add measurement info block.to current XR packet.
void roc::rtcp::Builder::add_xr_queue_metrics | ( | const header::XrQueueMetricsBlock & | queue_metrics | ) |
Add queue metrics block.to current XR packet.
void roc::rtcp::Builder::add_xr_rrtr | ( | const header::XrRrtrBlock & | rrtr | ) |
Add RRTR block to current XR packet.
void roc::rtcp::Builder::begin_bye | ( | ) |
Start BYE packet inside compound RTCP packet.
void roc::rtcp::Builder::begin_rr | ( | const header::ReceiverReportPacket & | rr | ) |
Start RR packet inside compound RTCP packet.
void roc::rtcp::Builder::begin_sdes | ( | ) |
Start SDES packet inside compound RTCP packet.
void roc::rtcp::Builder::begin_sdes_chunk | ( | const SdesChunk & | chunk | ) |
Start new SDES chunk in current SDES packet.
void roc::rtcp::Builder::begin_sr | ( | const header::SenderReportPacket & | sr | ) |
Start SR packet inside compound RTCP packet.
void roc::rtcp::Builder::begin_xr | ( | const header::XrPacket & | xr | ) |
Start XR packet inside compound RTCP packet.
void roc::rtcp::Builder::begin_xr_dlrr | ( | const header::XrDlrrBlock & | dlrr | ) |
Start DLRR block inside current XR packet.
void roc::rtcp::Builder::end_bye | ( | ) |
Finish current BYE packet.
void roc::rtcp::Builder::end_rr | ( | ) |
Finish RR packet.
void roc::rtcp::Builder::end_sdes | ( | ) |
Finish current SDES packet.
void roc::rtcp::Builder::end_sdes_chunk | ( | ) |
Finish current SDES chunk.
void roc::rtcp::Builder::end_sr | ( | ) |
Finish SR packet.
void roc::rtcp::Builder::end_xr | ( | ) |
Finish current XR packet.
void roc::rtcp::Builder::end_xr_dlrr | ( | ) |
Finish current DLRR block.
bool roc::rtcp::Builder::is_ok | ( | ) | const |
Check for errors.