#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "video_bitrate_allocation.h"
#include <cstring>
#include <limits>
#include <numeric>
#include <sstream>
#include "base/check_op.h"
#include "base/numerics/checked_math.h"
#include "media/base/bitrate.h"
namespace {
static media::Bitrate MakeReplacementBitrate(const media::Bitrate& old,
uint32_t target_bps,
uint32_t peak_bps) { … }
}
namespace media {
constexpr size_t VideoBitrateAllocation::kMaxSpatialLayers;
constexpr size_t VideoBitrateAllocation::kMaxTemporalLayers;
VideoBitrateAllocation::VideoBitrateAllocation(Bitrate::Mode mode) { … }
bool VideoBitrateAllocation::SetPeakBps(uint32_t peak_bps) { … }
bool VideoBitrateAllocation::SetBitrate(size_t spatial_index,
size_t temporal_index,
uint32_t bitrate_bps) { … }
uint32_t VideoBitrateAllocation::GetBitrateBps(size_t spatial_index,
size_t temporal_index) const { … }
uint32_t VideoBitrateAllocation::GetSumBps() const { … }
uint32_t VideoBitrateAllocation::GetPeakBps() const { … }
const Bitrate VideoBitrateAllocation::GetSumBitrate() const { … }
Bitrate::Mode VideoBitrateAllocation::GetMode() const { … }
std::string VideoBitrateAllocation::ToString() const { … }
bool VideoBitrateAllocation::operator==(
const VideoBitrateAllocation& other) const { … }
}