Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Latency monitor. More...
#include <latency_monitor.h>
Public Member Functions | |
LatencyMonitor (IFrameReader &frame_reader, const packet::SortedQueue &incoming_queue, const Depacketizer &depacketizer, ResamplerReader *resampler, const LatencyMonitorConfig &config, core::nanoseconds_t target_latency, const SampleSpec &input_sample_spec, const SampleSpec &output_sample_spec) | |
Constructor. More... | |
bool | is_valid () const |
Check if the object was initialized successfully. More... | |
bool | is_alive () const |
Check if the stream is still alive. More... | |
LatencyMonitorMetrics | metrics () const |
Get metrics. More... | |
virtual bool | read (Frame &frame) |
Read audio frame from a pipeline. More... | |
bool | reclock (core::nanoseconds_t playback_timestamp) |
Report playback timestamp of last frame returned by read. More... | |
Public Member Functions inherited from roc::core::ListNode | |
ListNodeData * | list_node_data () const |
Get list node data. More... | |
Latency monitor.
Features
Flow
Definition at line 140 of file latency_monitor.h.
roc::audio::LatencyMonitor::LatencyMonitor | ( | IFrameReader & | frame_reader, |
const packet::SortedQueue & | incoming_queue, | ||
const Depacketizer & | depacketizer, | ||
ResamplerReader * | resampler, | ||
const LatencyMonitorConfig & | config, | ||
core::nanoseconds_t | target_latency, | ||
const SampleSpec & | input_sample_spec, | ||
const SampleSpec & | output_sample_spec | ||
) |
Constructor.
Parameters
frame_reader
is inner frame reader for E2E latency calculationincoming_queue
and depacketizer
are used to NIQ latency calculationresampler
is used to set the scaling factor to compensate clock drift according to calculated latencyconfig
defines calculation parameterstarget_latency
defines target latency that we should maintaininput_sample_spec
is the sample spec of the input packetsoutput_sample_spec
is the sample spec of the output frames (after resampling) bool roc::audio::LatencyMonitor::is_alive | ( | ) | const |
Check if the stream is still alive.
bool roc::audio::LatencyMonitor::is_valid | ( | ) | const |
Check if the object was initialized successfully.
LatencyMonitorMetrics roc::audio::LatencyMonitor::metrics | ( | ) | const |
Get metrics.
|
virtual |
Read audio frame from a pipeline.
Implements roc::audio::IFrameReader.
bool roc::audio::LatencyMonitor::reclock | ( | core::nanoseconds_t | playback_timestamp | ) |
Report playback timestamp of last frame returned by read.