vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
filllevel.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
10#include <algorithm>
11
12#include "filllevel.h"
13#include "logger.h"
14
24
33
49{
50 std::lock_guard<std::mutex> lock(m_mutex);
51
53
55
56 switch (m_state) {
57 case UNINITIALIZED:
59 m_bufferFillLevelFramesAvg = bufferFillLevelFrames; // init with current value to speed up settling
62 break;
63 case SETTLING:
66 // fixate the current buffer fill level as target value, but guarantee a minimum buffer size
69 }
70 break;
71 case SETTLED:
72 // nothing
73 break;
74 }
75}
76
85{
86 switch(state) {
87 case UNINITIALIZED: return "UNINITIALIZED";
88 case SETTLING: return "SETTLING";
89 case SETTLED: return "SETTLED";
90 }
91 return "Unknown";
92}
void ResetFramesCounters()
Resets the received and written frames counters.
Definition filllevel.cpp:28
void UpdateAvgBufferFillLevel(int)
Updates the buffer fill level average.
Definition filllevel.cpp:48
static constexpr double FLOATING_AVERAGE_ALPHA_NORMAL
Definition filllevel.h:41
const char * StateToString(State d)
Converts the filter state to a string representation.
Definition filllevel.cpp:84
static constexpr double FLOATING_AVERAGE_ALPHA_SETTLING
Definition filllevel.h:40
static constexpr int SETTLING_DURATION_PACKETS
Definition filllevel.h:42
void Reset()
Resets the filter state.
Definition filllevel.cpp:18
Low-pass Filter for Audio Buffer Fill Level Measurement Header File.
Logger Header File.