12 #ifndef ROC_AUDIO_LATENCY_TUNER_H_
13 #define ROC_AUDIO_LATENCY_TUNER_H_
217 bool has_new_freq_coeff_;
219 const float freq_coeff_max_delta_;
224 const bool enable_tuning_;
225 const bool enable_bounds_;
227 bool has_niq_latency_;
231 bool has_e2e_latency_;
float fetch_scaling()
If scaling has changed, returns updated value. Otherwise, returns zero.
void advance_stream(packet::stream_timestamp_t duration)
Advance stream by given number of samples. Should be called after updating stream.
bool is_valid() const
Check if the object was initialized successfully.
bool update_stream()
Update stream latency and scaling. This method performs all actual work:
void write_metrics(const LatencyMetrics &latency_metrics, const packet::LinkMetrics &link_metrics)
Pass updated metrics to tuner. Tuner will use new values next time when update_stream() is called.
LatencyTuner(const LatencyConfig &config, const SampleSpec &sample_spec)
Initialize.
Sample specification. Describes sample rate and channels.
Base class for non-copyable objects.
Optionally constructed object.
LatencyTunerBackend
Latency tuner backend. Defines which latency we monitor and tune to achieve target.
@ LatencyTunerBackend_Niq
Latency is Network Incoming Queue length. Calculated on receiver without use of any signaling protoco...
@ LatencyTunerBackend_E2e
Latency is End-to-end delay. Can on receiver if RTCP XR is supported by both sides....
@ LatencyTunerBackend_Default
Deduce best default for given settings.
const char * latency_tuner_profile_to_str(LatencyTunerProfile tuner)
Get string name of latency tuner.
LatencyTunerProfile
Latency tuner profile. Defines whether and how we tune latency on fly to compensate clock drift and j...
@ LatencyTunerProfile_Responsive
Fast and responsive tuning. Good for lower network latency and jitter.
@ LatencyTunerProfile_Default
Deduce best default for given settings.
@ LatencyTunerProfile_Gradual
Slow and smooth tuning. Good for higher network latency and jitter.
@ LatencyTunerProfile_Intact
Do not tune latency.
const char * latency_tuner_backend_to_str(LatencyTunerBackend backend)
Get string name of latency backend.
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.
core::nanoseconds_t target_latency
Target latency.
LatencyTunerProfile tuner_profile
Latency tuner profile to use.
core::nanoseconds_t latency_tolerance
Maximum allowed deviation from target latency.
LatencyConfig()
Initialize.
void deduce_defaults(core::nanoseconds_t default_target_latency, bool is_receiver)
Automatically fill missing settings.
core::nanoseconds_t scaling_interval
Scaling update interval.
float scaling_tolerance
Maximum allowed deviation of freq_coeff from 1.0.
core::nanoseconds_t stale_tolerance
Maximum delay since last packet before queue is considered stalling.
LatencyTunerBackend tuner_backend
Latency tuner backend to use.
core::nanoseconds_t niq_latency
Estimated network incoming queue latency. An estimate of how much media is buffered in receiver packe...
core::nanoseconds_t e2e_latency
Estimated end-to-end latency. An estimate of the time from recording a frame on sender to playing it ...
core::nanoseconds_t niq_stalling
Delay since last received packet. In other words, how long there were no new packets in network incom...
Various units used in packets.