Commit d23ff3f3 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Fix new video decoder performance tests in allocate mode.

The video_decode_accelerator_perf_tests currently only work in import mode. This
CL introduces fixes to support running the performance tests in allocate mode.

TEST=./video_decode_accelerator_perf_tests on nyan_big

BUG=981712

Change-Id: Ic6b4c5315be4bd51b808b124dfc49f5b510adf0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1686669
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676265}
parent e411e02d
...@@ -43,13 +43,6 @@ VideoDecoderClient::VideoDecoderClient( ...@@ -43,13 +43,6 @@ VideoDecoderClient::VideoDecoderClient(
video_(video) { video_(video) {
DETACH_FROM_SEQUENCE(decoder_client_sequence_checker_); DETACH_FROM_SEQUENCE(decoder_client_sequence_checker_);
// Video frame processors are currently only supported in import mode, as
// wrapping texture-backed video frames is not supported (See
// http://crbug/362521).
LOG_ASSERT(config.allocation_mode == AllocationMode::kImport ||
frame_processors.size() == 0)
<< "Video frame processors are only supported when using import mode";
weak_this_ = weak_this_factory_.GetWeakPtr(); weak_this_ = weak_this_factory_.GetWeakPtr();
} }
...@@ -339,12 +332,8 @@ void VideoDecoderClient::FrameReadyTask(scoped_refptr<VideoFrame> video_frame) { ...@@ -339,12 +332,8 @@ void VideoDecoderClient::FrameReadyTask(scoped_refptr<VideoFrame> video_frame) {
frame_renderer_->RenderFrame(video_frame); frame_renderer_->RenderFrame(video_frame);
// When using allocate mode, direct texture memory access is not supported. for (auto& frame_processor : frame_processors_)
// Since this is required by the video frame processors we can't use these. frame_processor->ProcessVideoFrame(video_frame, current_frame_index_);
if (decoder_client_config_.allocation_mode == AllocationMode::kImport) {
for (auto& frame_processor : frame_processors_)
frame_processor->ProcessVideoFrame(video_frame, current_frame_index_);
}
// Notify the test a frame has been decoded. We should only do this after // Notify the test a frame has been decoded. We should only do this after
// scheduling the frame to be processed, so calling WaitForFrameProcessors() // scheduling the frame to be processed, so calling WaitForFrameProcessors()
......
...@@ -317,6 +317,10 @@ class VideoDecoderTest : public ::testing::Test { ...@@ -317,6 +317,10 @@ class VideoDecoderTest : public ::testing::Test {
VideoDecoderClientConfig config; VideoDecoderClientConfig config;
config.use_vd = g_env->UseVD(); config.use_vd = g_env->UseVD();
// Force allocate mode if import mode is not supported.
if (!g_env->ImportSupported())
config.allocation_mode = AllocationMode::kAllocate;
return VideoPlayer::Create(video, std::move(frame_renderer), return VideoPlayer::Create(video, std::move(frame_renderer),
std::move(frame_processors), config); std::move(frame_processors), config);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment