#include "media/gpu/vaapi/vaapi_video_encoder_delegate.h"
#include <va/va.h>
#include "base/memory/ref_counted_memory.h"
#include "base/trace_event/trace_event.h"
#include "media/base/media_util.h"
#include "media/base/video_frame.h"
#include "media/gpu/codec_picture.h"
#include "media/gpu/gpu_video_encode_accelerator_helpers.h"
#include "media/gpu/macros.h"
#include "media/gpu/vaapi/vaapi_utils.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
#include "media/video/video_encode_accelerator.h"
namespace media {
VaapiVideoEncoderDelegate::EncodeJob::EncodeJob(
bool keyframe,
base::TimeDelta timestamp,
uint8_t spatial_index,
bool end_of_picture,
VASurfaceID input_surface_id,
scoped_refptr<CodecPicture> picture,
std::unique_ptr<ScopedVABuffer> coded_buffer)
: … { … }
VaapiVideoEncoderDelegate::EncodeJob::~EncodeJob() = default;
VaapiVideoEncoderDelegate::EncodeResult
VaapiVideoEncoderDelegate::EncodeJob::CreateEncodeResult(
const BitstreamBufferMetadata& metadata) && { … }
base::TimeDelta VaapiVideoEncoderDelegate::EncodeJob::timestamp() const { … }
uint8_t VaapiVideoEncoderDelegate::EncodeJob::spatial_index() const { … }
bool VaapiVideoEncoderDelegate::EncodeJob::end_of_picture() const { … }
VABufferID VaapiVideoEncoderDelegate::EncodeJob::coded_buffer_id() const { … }
VASurfaceID VaapiVideoEncoderDelegate::EncodeJob::input_surface_id() const { … }
const scoped_refptr<CodecPicture>&
VaapiVideoEncoderDelegate::EncodeJob::picture() const { … }
VaapiVideoEncoderDelegate::EncodeResult::EncodeResult(
std::unique_ptr<ScopedVABuffer> coded_buffer,
const BitstreamBufferMetadata& metadata)
: … { … }
VaapiVideoEncoderDelegate::EncodeResult::~EncodeResult() = default;
VaapiVideoEncoderDelegate::EncodeResult::EncodeResult(EncodeResult&&) = default;
VaapiVideoEncoderDelegate::EncodeResult&
VaapiVideoEncoderDelegate::EncodeResult::operator=(EncodeResult&&) = default;
VABufferID VaapiVideoEncoderDelegate::EncodeResult::coded_buffer_id() const { … }
const BitstreamBufferMetadata&
VaapiVideoEncoderDelegate::EncodeResult::metadata() const { … }
VaapiVideoEncoderDelegate::VaapiVideoEncoderDelegate(
scoped_refptr<VaapiWrapper> vaapi_wrapper,
base::RepeatingClosure error_cb)
: … { … }
VaapiVideoEncoderDelegate::~VaapiVideoEncoderDelegate() { … }
size_t VaapiVideoEncoderDelegate::GetBitstreamBufferSize() const { … }
void VaapiVideoEncoderDelegate::BitrateControlUpdate(
const BitstreamBufferMetadata& metadata) { … }
bool VaapiVideoEncoderDelegate::Encode(EncodeJob& encode_job) { … }
std::optional<VaapiVideoEncoderDelegate::EncodeResult>
VaapiVideoEncoderDelegate::GetEncodeResult(
std::unique_ptr<EncodeJob> encode_job) { … }
}