#include "media/cast/encoding/video_encoder_impl.h"
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "media/base/video_codecs.h"
#include "media/base/video_frame.h"
#include "third_party/libaom/libaom_buildflags.h"
#if BUILDFLAG(ENABLE_LIBAOM)
#include "media/cast/encoding/av1_encoder.h"
#endif
#include "media/base/video_encoder_metrics_provider.h"
#include "media/cast/common/sender_encoded_frame.h"
#include "media/cast/encoding/fake_software_video_encoder.h"
#include "media/cast/encoding/vpx_encoder.h"
namespace media {
namespace cast {
namespace {
void InitializeEncoderOnEncoderThread(
const scoped_refptr<CastEnvironment>& environment,
SoftwareVideoEncoder* encoder) { … }
void EncodeVideoFrameOnEncoderThread(
scoped_refptr<CastEnvironment> environment,
SoftwareVideoEncoder* encoder,
scoped_refptr<media::VideoFrame> video_frame,
base::TimeTicks reference_time,
const VideoEncoderImpl::CodecDynamicConfig& dynamic_config,
VideoEncoderImpl::FrameEncodedCallback frame_encoded_callback) { … }
}
VideoEncoderImpl::VideoEncoderImpl(
scoped_refptr<CastEnvironment> cast_environment,
const FrameSenderConfig& video_config,
std::unique_ptr<VideoEncoderMetricsProvider> metrics_provider,
StatusChangeCallback status_change_cb)
: … { … }
VideoEncoderImpl::~VideoEncoderImpl() { … }
bool VideoEncoderImpl::EncodeVideoFrame(
scoped_refptr<media::VideoFrame> video_frame,
base::TimeTicks reference_time,
FrameEncodedCallback frame_encoded_callback) { … }
void VideoEncoderImpl::SetBitRate(int new_bit_rate) { … }
void VideoEncoderImpl::GenerateKeyFrame() { … }
}
}