2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
13 class BitstreamStats final
16 // in order not to cause a performance hit, we should only check the clock when
17 // we reach m_nEstimatedBitrate bits.
18 // if this value is 1, we will calculate bitrate on every sample.
19 explicit BitstreamStats(unsigned int nEstimatedBitrate
=(10240*8) /*10Kbit*/);
21 void AddSampleBytes(unsigned int nBytes
);
22 void AddSampleBits(unsigned int nBits
);
24 inline double GetBitrate() const { return m_dBitrate
; }
25 inline double GetMaxBitrate() const { return m_dMaxBitrate
; }
26 inline double GetMinBitrate() const { return m_dMinBitrate
; }
29 void CalculateBitrate();
35 unsigned int m_nBitCount
;
36 unsigned int m_nEstimatedBitrate
; // when we reach this amount of bits we check current bitrate.
38 static int64_t m_tmFreq
;