#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/cast/encoding/av1_encoder.h"
#include "base/logging.h"
#include "base/strings/strcat.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/libaom/source/libaom/aom/aomcx.h"
#include "third_party/openscreen/src/cast/streaming/encoded_frame.h"
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) { … }
}
Av1Encoder::Av1Encoder(
const FrameSenderConfig& video_config,
std::unique_ptr<VideoEncoderMetricsProvider> metrics_provider)
: … { … }
Av1Encoder::~Av1Encoder() { … }
void Av1Encoder::Initialize() { … }
void Av1Encoder::ConfigureForNewFrameSize(const gfx::Size& frame_size) { … }
void Av1Encoder::Encode(scoped_refptr<media::VideoFrame> video_frame,
base::TimeTicks reference_time,
SenderEncodedFrame* encoded_frame) { … }
void Av1Encoder::UpdateRates(uint32_t new_bitrate) { … }
void Av1Encoder::GenerateKeyFrame() { … }
}
}