vdr-plugin-softhddevice-drm-gles 1.6.2
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
29
38
54{
55 std::lock_guard<std::mutex> lock(m_mutex);
56
58
60
61 switch (m_state) {
62 case UNINITIALIZED:
64 m_bufferFillLevelFramesAvg = bufferFillLevelFrames; // init with current value to speed up settling
67 break;
68 case SETTLING:
71 // fixate the current buffer fill level as target value, but guarantee a minimum buffer size
74 }
75 break;
76 case SETTLED:
77 // nothing
78 break;
79 }
80}
81
90{
91 switch(state) {
92 case UNINITIALIZED: return "UNINITIALIZED";
93 case SETTLING: return "SETTLING";
94 case SETTLED: return "SETTLED";
95 }
96 return "Unknown";
97}
98
static constexpr double FLOATING_AVERAGE_ALPHA_NORMAL
Definition filllevel.h:44
static constexpr double FLOATING_AVERAGE_ALPHA_SETTLING
Definition filllevel.h:43
static constexpr int SETTLING_DURATION_PACKETS
Definition filllevel.h:45
Low-pass Filter for Audio Buffer Fill Level Measurement Header File.
void ResetFramesCounters()
Resets the received and written frames counters.
Definition filllevel.cpp:33
void UpdateAvgBufferFillLevel(int)
Updates the buffer fill level average.
Definition filllevel.cpp:53
const char * StateToString(State d)
Converts the filter state to a string representation.
Definition filllevel.cpp:89
void Reset()
Resets the filter state.
Definition filllevel.cpp:23
Logger Header File.