12#ifndef ROC_AUDIO_LATENCY_MONITOR_H_
13#define ROC_AUDIO_LATENCY_MONITOR_H_
186 void compute_niq_latency_();
193 bool init_scaling_(
size_t input_sample_rate,
size_t output_sample_rate);
219 bool has_niq_latency_;
220 bool has_e2e_latency_;
226 const float max_scaling_delta_;
bool reclock(core::nanoseconds_t playback_timestamp)
Report playback timestamp of last frame returned by read.
LatencyMonitorMetrics metrics() const
Get metrics.
virtual bool read(Frame &frame)
Read audio frame from a pipeline.
bool is_valid() const
Check if the object was initialized successfully.
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.
bool is_alive() const
Check if the stream is still alive.
Resampler element for reading pipeline.
Sample specification. Describes sample rate and channels.
Base class for non-copyable objects.
Optionally constructed object.
FreqEstimatorProfile
FreqEstimator paremeter preset.
@ FreqEstimatorProfile_Gradual
Slow and smooth tuning. Good for higher network latency and jitter.
@ FreqEstimatorProfile_Responsive
Fast and responsive tuning. Good for lower network latency and jitter.
const nanoseconds_t Millisecond
One millisecond represented in nanoseconds.
int64_t nanoseconds_t
Nanoseconds.
uint32_t stream_timestamp_t
Packet stream timestamp.
int32_t stream_timestamp_diff_t
Packet stream timestamp delta.
Optionally constructed object.
Parameters for latency monitor.
void deduce_latency_tolerance(core::nanoseconds_t target_latency)
Automatically deduce latency_tolerance from target_latency.
FreqEstimatorProfile fe_profile
FreqEstimator profile.
bool fe_enable
Enable FreqEstimator.
void deduce_fe_profile(const core::nanoseconds_t target_latency)
Automatically deduce FreqEstimator profile from target latency.
core::nanoseconds_t fe_update_interval
FreqEstimator update interval, nanoseconds. How often to run FreqEstimator and update Resampler scali...
core::nanoseconds_t latency_tolerance
Maximum allowed deviation from target latency, nanoseconds. If the latency goes out of bounds,...
float scaling_tolerance
Maximum allowed deviation of freq_coeff from 1.0. If the scaling goes out of bounds,...
Metrics of latency monitor.
core::nanoseconds_t e2e_latency
Estimated E2E latency. E2E = end-to-end. Defines how much time passed between frame entered sender pi...
core::nanoseconds_t niq_latency
Estimated NIQ latency. NIQ = network incoming queue. Defines how many samples are buffered in receive...
Various units used in packets.