Skip to content

Commit

Permalink
media/gpu/VDA unittest: Stop passing texture id in import mode
Browse files Browse the repository at this point in the history
The VDA client for ARC++ (GpuArcVideoDecodeAccelerator) doesn't assign texture
id for PictureBuffer. On the other hand, VDA unittest assigns the texture ids
in import mode. This CL changes the test to pass no texture id to VDA and makes
the test to follow the GpuArcVideoDecodeAccelerator implementation.

Bug: None
Test: video_decode_accelerator_unittest on kevin
Change-Id: Id5edb0eccd90556eba6624da8fc47967a6036b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773078
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691480}
  • Loading branch information
Hirokazu Honda authored and Commit Bot committed Aug 29, 2019
1 parent 3127099 commit 2250cdf
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions media/gpu/video_decode_accelerator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,22 @@ void GLRenderingVDAClient::ProvidePictureBuffers(
texture_target_, g_test_import, pixel_format, dimensions);
LOG_ASSERT(texture_ref);
int32_t picture_buffer_id = next_picture_buffer_id_++;
int irrelevant_id = picture_buffer_id;
LOG_ASSERT(
active_textures_.insert(std::make_pair(picture_buffer_id, texture_ref))
.second);

PictureBuffer::TextureIds texture_ids(1, texture_ref->texture_id());
buffers.push_back(PictureBuffer(picture_buffer_id, dimensions,
PictureBuffer::TextureIds{irrelevant_id++},
texture_ids, texture_target, pixel_format));
if (g_test_import) {
// Texture ids are not needed in import mode. GpuArcVideoDecodeAccelerator
// actually doesn't pass them. This test code follows the implementation.
buffers.push_back(PictureBuffer(picture_buffer_id, dimensions));
} else {
int irrelevant_id = picture_buffer_id;
PictureBuffer::TextureIds texture_ids(1, texture_ref->texture_id());
buffers.push_back(
PictureBuffer(picture_buffer_id, dimensions,
PictureBuffer::TextureIds{irrelevant_id++}, texture_ids,
texture_target, pixel_format));
}
}
decoder_->AssignPictureBuffers(buffers);

Expand Down Expand Up @@ -1228,6 +1235,14 @@ TEST_P(VideoDecodeAcceleratorParamTest, MAYBE_TestSimpleDecode) {
return;
}

if (render_as_thumbnails && g_test_import) {
// We cannot renderer a thumbnail in import mode because we don't assign
// texture id to PictureBuffer. Since the frame soundness should be ensured
// by frame validator in import mode. So this will not reduces the test
// coverage.
GTEST_SKIP();
}

if (test_video_files_.size() > 1)
num_concurrent_decoders = test_video_files_.size();

Expand Down

0 comments on commit 2250cdf

Please sign in to comment.