Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
RTCP report processor and generator. More...
#include <reporter.h>
Public Member Functions | |
Reporter (const Config &config, IParticipant &participant, core::IArena &arena) | |
Initialize. More... | |
bool | is_valid () const |
Check if initialization succeeded. More... | |
bool | is_sending () const |
Check if there is local sending stream. More... | |
bool | is_receiving () const |
Check if there are local receiving streams. More... | |
size_t | total_destinations () const |
Get number of tracked destination addresses, for testing. More... | |
size_t | total_streams () const |
Get number of tracked streams, for testing. More... | |
Report processing | |
ROC_ATTR_NODISCARD status::StatusCode | begin_processing (const address::SocketAddr &report_addr, core::nanoseconds_t report_time) |
Begin report processing. Invoked before process_xxx() functions. More... | |
void | process_cname (const SdesChunk &chunk, const SdesItem &item) |
Process SDES CNAME. More... | |
void | process_sr (const header::SenderReportPacket &sr) |
Process SR header. More... | |
void | process_reception_block (packet::stream_source_t ssrc, const header::ReceptionReportBlock &blk) |
Process SR/RR reception block. More... | |
void | process_dlrr_subblock (const header::XrPacket &xr, const header::XrDlrrSubblock &blk) |
Process XR DLRR sub-block (extended sender report). More... | |
void | process_rrtr_block (const header::XrPacket &xr, const header::XrRrtrBlock &blk) |
Process XR RRTR block (extended receiver report). More... | |
void | process_measurement_info_block (const header::XrPacket &xr, const header::XrMeasurementInfoBlock &blk) |
Process XR Measurement Info block (extended receiver report). More... | |
void | process_delay_metrics_block (const header::XrPacket &xr, const header::XrDelayMetricsBlock &blk) |
Process XR Delay Metrics block (extended receiver report). More... | |
void | process_queue_metrics_block (const header::XrPacket &xr, const header::XrQueueMetricsBlock &blk) |
Process XR Queue Metrics block (extended receiver report). More... | |
void | process_goodbye (packet::stream_source_t ssrc) |
Process BYE message. More... | |
ROC_ATTR_NODISCARD status::StatusCode | end_processing () |
End report processing. Invoked after process_xxx() functions. More... | |
Report generation | |
ROC_ATTR_NODISCARD status::StatusCode | begin_generation (core::nanoseconds_t report_time) |
Begin report generation. Invoked before genrate_xxx() functions. More... | |
size_t | num_dest_addresses () const |
Get number of destination addresses to which to send reports. More... | |
size_t | num_sending_streams (size_t addr_index) const |
Get number of sending streams to be reported. addr_index should be in range [0; num_dest_addresses()-1]. More... | |
size_t | num_receiving_streams (size_t addr_index) const |
Get number of receiving streams to be reported. addr_index should be in range [0; num_dest_addresses()-1]. More... | |
void | generate_dest_address (size_t addr_index, address::SocketAddr &addr) |
Generate destination address. addr_index should be in range [0; num_dest_addresses()-1]. More... | |
void | generate_cname (SdesChunk &chunk, SdesItem &item) |
Generate SDES chunk with CNAME item. More... | |
void | generate_sr (header::SenderReportPacket &sr) |
Generate SR header. More... | |
void | generate_rr (header::ReceiverReportPacket &rr) |
Generate RR header. More... | |
void | generate_reception_block (size_t addr_index, size_t stream_index, header::ReceptionReportBlock &blk) |
Generate SR/RR reception block. addr_index should be in range [0; num_dest_addresses()-1]. stream_index should be in range [0; num_receiving_streams()-1]. More... | |
void | generate_xr (header::XrPacket &xr) |
Generate XR header. More... | |
void | generate_dlrr_subblock (size_t addr_index, size_t stream_index, header::XrDlrrSubblock &blk) |
Generate XR DLRR sub-block (extended sender report). addr_index should be in range [0; num_dest_addresses()-1]. stream_index should be in range [0; num_sending_streams()-1]. More... | |
void | generate_rrtr_block (header::XrRrtrBlock &blk) |
Generate XR RRTR header (extended receiver report). More... | |
void | generate_measurement_info_block (size_t addr_index, size_t stream_index, header::XrMeasurementInfoBlock &blk) |
Generate XR Measurement Info block (extended receiver report). addr_index should be in range [0; num_dest_addresses()-1]. stream_index should be in range [0; num_receiving_streams()-1]. More... | |
void | generate_delay_metrics_block (size_t addr_index, size_t stream_index, header::XrDelayMetricsBlock &blk) |
Generate XR Delay Metrics block (extended receiver report). addr_index should be in range [0; num_dest_addresses()-1]. stream_index should be in range [0; num_receiving_streams()-1]. More... | |
void | generate_queue_metrics_block (size_t addr_index, size_t stream_index, header::XrQueueMetricsBlock &blk) |
Generate XR Queue Metrics block (extended receiver report). addr_index should be in range [0; num_dest_addresses()-1]. stream_index should be in range [0; num_receiving_streams()-1]. More... | |
bool | need_goodbye () const |
Check if BYE message should be included. More... | |
void | generate_goodbye (packet::stream_source_t &ssrc) |
Generate BYE message. More... | |
ROC_ATTR_NODISCARD status::StatusCode | end_generation () |
End report generation. Invoked after generate_xxx() functions. More... | |
RTCP report processor and generator.
Used by rtcp::Communicator to incrementally process and generate individual blocks of compound RTCP packets. Collects data from RTCP traffic and local pipeline (IParticipant).
Features:
Workflow of incoming packets processing:
Workflow of outgoing packet generation:
Definition at line 90 of file reporter.h.
roc::rtcp::Reporter::Reporter | ( | const Config & | config, |
IParticipant & | participant, | ||
core::IArena & | arena | ||
) |
Initialize.
ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Reporter::begin_generation | ( | core::nanoseconds_t | report_time | ) |
Begin report generation. Invoked before genrate_xxx() functions.
ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Reporter::begin_processing | ( | const address::SocketAddr & | report_addr, |
core::nanoseconds_t | report_time | ||
) |
Begin report processing. Invoked before process_xxx() functions.
ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Reporter::end_generation | ( | ) |
End report generation. Invoked after generate_xxx() functions.
ROC_ATTR_NODISCARD status::StatusCode roc::rtcp::Reporter::end_processing | ( | ) |
End report processing. Invoked after process_xxx() functions.
Generate SDES chunk with CNAME item.
void roc::rtcp::Reporter::generate_delay_metrics_block | ( | size_t | addr_index, |
size_t | stream_index, | ||
header::XrDelayMetricsBlock & | blk | ||
) |
Generate XR Delay Metrics block (extended receiver report). addr_index
should be in range [0; num_dest_addresses()-1]. stream_index
should be in range [0; num_receiving_streams()-1].
void roc::rtcp::Reporter::generate_dest_address | ( | size_t | addr_index, |
address::SocketAddr & | addr | ||
) |
Generate destination address. addr_index
should be in range [0; num_dest_addresses()-1].
void roc::rtcp::Reporter::generate_dlrr_subblock | ( | size_t | addr_index, |
size_t | stream_index, | ||
header::XrDlrrSubblock & | blk | ||
) |
Generate XR DLRR sub-block (extended sender report). addr_index
should be in range [0; num_dest_addresses()-1]. stream_index
should be in range [0; num_sending_streams()-1].
void roc::rtcp::Reporter::generate_goodbye | ( | packet::stream_source_t & | ssrc | ) |
Generate BYE message.
void roc::rtcp::Reporter::generate_measurement_info_block | ( | size_t | addr_index, |
size_t | stream_index, | ||
header::XrMeasurementInfoBlock & | blk | ||
) |
Generate XR Measurement Info block (extended receiver report). addr_index
should be in range [0; num_dest_addresses()-1]. stream_index
should be in range [0; num_receiving_streams()-1].
void roc::rtcp::Reporter::generate_queue_metrics_block | ( | size_t | addr_index, |
size_t | stream_index, | ||
header::XrQueueMetricsBlock & | blk | ||
) |
Generate XR Queue Metrics block (extended receiver report). addr_index
should be in range [0; num_dest_addresses()-1]. stream_index
should be in range [0; num_receiving_streams()-1].
void roc::rtcp::Reporter::generate_reception_block | ( | size_t | addr_index, |
size_t | stream_index, | ||
header::ReceptionReportBlock & | blk | ||
) |
Generate SR/RR reception block. addr_index
should be in range [0; num_dest_addresses()-1]. stream_index
should be in range [0; num_receiving_streams()-1].
void roc::rtcp::Reporter::generate_rr | ( | header::ReceiverReportPacket & | rr | ) |
Generate RR header.
void roc::rtcp::Reporter::generate_rrtr_block | ( | header::XrRrtrBlock & | blk | ) |
Generate XR RRTR header (extended receiver report).
void roc::rtcp::Reporter::generate_sr | ( | header::SenderReportPacket & | sr | ) |
Generate SR header.
void roc::rtcp::Reporter::generate_xr | ( | header::XrPacket & | xr | ) |
Generate XR header.
bool roc::rtcp::Reporter::is_receiving | ( | ) | const |
Check if there are local receiving streams.
bool roc::rtcp::Reporter::is_sending | ( | ) | const |
Check if there is local sending stream.
bool roc::rtcp::Reporter::is_valid | ( | ) | const |
Check if initialization succeeded.
bool roc::rtcp::Reporter::need_goodbye | ( | ) | const |
Check if BYE message should be included.
size_t roc::rtcp::Reporter::num_dest_addresses | ( | ) | const |
Get number of destination addresses to which to send reports.
size_t roc::rtcp::Reporter::num_receiving_streams | ( | size_t | addr_index | ) | const |
Get number of receiving streams to be reported. addr_index
should be in range [0; num_dest_addresses()-1].
size_t roc::rtcp::Reporter::num_sending_streams | ( | size_t | addr_index | ) | const |
Get number of sending streams to be reported. addr_index
should be in range [0; num_dest_addresses()-1].
Process SDES CNAME.
void roc::rtcp::Reporter::process_delay_metrics_block | ( | const header::XrPacket & | xr, |
const header::XrDelayMetricsBlock & | blk | ||
) |
Process XR Delay Metrics block (extended receiver report).
void roc::rtcp::Reporter::process_dlrr_subblock | ( | const header::XrPacket & | xr, |
const header::XrDlrrSubblock & | blk | ||
) |
Process XR DLRR sub-block (extended sender report).
void roc::rtcp::Reporter::process_goodbye | ( | packet::stream_source_t | ssrc | ) |
Process BYE message.
void roc::rtcp::Reporter::process_measurement_info_block | ( | const header::XrPacket & | xr, |
const header::XrMeasurementInfoBlock & | blk | ||
) |
Process XR Measurement Info block (extended receiver report).
void roc::rtcp::Reporter::process_queue_metrics_block | ( | const header::XrPacket & | xr, |
const header::XrQueueMetricsBlock & | blk | ||
) |
Process XR Queue Metrics block (extended receiver report).
void roc::rtcp::Reporter::process_reception_block | ( | packet::stream_source_t | ssrc, |
const header::ReceptionReportBlock & | blk | ||
) |
Process SR/RR reception block.
void roc::rtcp::Reporter::process_rrtr_block | ( | const header::XrPacket & | xr, |
const header::XrRrtrBlock & | blk | ||
) |
Process XR RRTR block (extended receiver report).
void roc::rtcp::Reporter::process_sr | ( | const header::SenderReportPacket & | sr | ) |
Process SR header.
size_t roc::rtcp::Reporter::total_destinations | ( | ) | const |
Get number of tracked destination addresses, for testing.
size_t roc::rtcp::Reporter::total_streams | ( | ) | const |
Get number of tracked streams, for testing.