#include "media/gpu/test/video_player/test_vda_video_decoder.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "gpu/config/gpu_preferences.h"
#include "media/base/media_log.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
#include "media/base/waiting.h"
#include "media/gpu/gpu_video_decode_accelerator_factory.h"
#include "media/gpu/macros.h"
#include "media/gpu/test/video_player/frame_renderer_dummy.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
#include "media/gpu/chromeos/platform_video_frame_utils.h"
#include "media/gpu/chromeos/vd_video_decode_accelerator.h"
#include "media/gpu/chromeos/video_decoder_pipeline.h"
#endif
namespace media {
namespace test {
namespace {
constexpr size_t kTimestampCacheSize = …;
}
TestVDAVideoDecoder::TestVDAVideoDecoder(
bool use_vd_vda,
OnProvidePictureBuffersCB on_provide_picture_buffers_cb,
const gfx::ColorSpace& target_color_space,
FrameRendererDummy* const frame_renderer,
bool linear_output)
: … { … }
TestVDAVideoDecoder::~TestVDAVideoDecoder() { … }
VideoDecoderType TestVDAVideoDecoder::GetDecoderType() const { … }
bool TestVDAVideoDecoder::IsPlatformDecoder() const { … }
void TestVDAVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool low_delay,
CdmContext* cdm_context,
InitCB init_cb,
const OutputCB& output_cb,
const WaitingCB& waiting_cb) { … }
void TestVDAVideoDecoder::NotifyInitializationComplete(DecoderStatus status) { … }
void TestVDAVideoDecoder::Decode(scoped_refptr<DecoderBuffer> buffer,
DecodeCB decode_cb) { … }
void TestVDAVideoDecoder::Reset(base::OnceClosure reset_cb) { … }
bool TestVDAVideoDecoder::NeedsBitstreamConversion() const { … }
bool TestVDAVideoDecoder::CanReadWithoutStalling() const { … }
int TestVDAVideoDecoder::GetMaxDecodeRequests() const { … }
void TestVDAVideoDecoder::ProvidePictureBuffersWithVisibleRect(
uint32_t requested_num_of_buffers,
VideoPixelFormat format,
const gfx::Size& dimensions,
const gfx::Rect& visible_rect) { … }
void TestVDAVideoDecoder::DismissPictureBuffer(int32_t picture_buffer_id) { … }
void TestVDAVideoDecoder::PictureReady(const Picture& picture) { … }
void TestVDAVideoDecoder::ReusePictureBufferThunk(
std::optional<base::WeakPtr<TestVDAVideoDecoder>> vda_video_decoder,
scoped_refptr<base::SequencedTaskRunner> task_runner,
int32_t picture_buffer_id) { … }
void TestVDAVideoDecoder::ReusePictureBufferTask(int32_t picture_buffer_id) { … }
void TestVDAVideoDecoder::NotifyEndOfBitstreamBuffer(
int32_t bitstream_buffer_id) { … }
void TestVDAVideoDecoder::NotifyFlushDone() { … }
void TestVDAVideoDecoder::NotifyResetDone() { … }
void TestVDAVideoDecoder::NotifyError(VideoDecodeAccelerator::Error error) { … }
int32_t TestVDAVideoDecoder::GetNextBitstreamBufferId() { … }
int32_t TestVDAVideoDecoder::GetNextPictureBufferId() { … }
}
}