#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/cast/encoding/vpx_encoder.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "media/base/media_switches.h"
#include "media/base/video_codecs.h"
#include "media/base/video_encoder_metrics_provider.h"
#include "media/base/video_frame.h"
#include "media/cast/common/openscreen_conversion_helpers.h"
#include "media/cast/common/sender_encoded_frame.h"
#include "media/cast/constants.h"
#include "media/cast/encoding/encoding_util.h"
#include "third_party/libvpx/source/libvpx/vpx/vp8cx.h"
#include "third_party/openscreen/src/cast/streaming/encoded_frame.h"
Dependency;
namespace media {
namespace cast {
namespace {
const int kRestartFramePeriods = …;
const int kEncodingSpeedAccHalfLife = …;
const double kHiTargetEncoderUtilization = …;
const double kMidTargetEncoderUtilization = …;
const double kLoTargetEncoderUtilization = …;
const double kEquivalentEncodingSpeedStepPerQpStep = …;
const int kHighestEncodingSpeed = …;
const int kLowestEncodingSpeed = …;
bool HasSufficientFeedback(
const FeedbackSignalAccumulator<base::TimeDelta>& accumulator) { … }
}
VpxEncoder::VpxEncoder(
const FrameSenderConfig& video_config,
std::unique_ptr<VideoEncoderMetricsProvider> metrics_provider)
: … { … }
VpxEncoder::~VpxEncoder() { … }
void VpxEncoder::Initialize() { … }
void VpxEncoder::ConfigureForNewFrameSize(const gfx::Size& frame_size) { … }
void VpxEncoder::Encode(scoped_refptr<media::VideoFrame> video_frame,
base::TimeTicks reference_time,
SenderEncodedFrame* encoded_frame) { … }
void VpxEncoder::UpdateRates(uint32_t new_bitrate) { … }
void VpxEncoder::GenerateKeyFrame() { … }
}
}