Commit d1671644 authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

V4L2SliceVDA: Fold DecodeSurface() into callers

Sister CL to crrev.com/c/1176279 -- this CL folds
V4L2SliceVideoDecodeAccelerator::DecodeSurface() into callers.

This simplifies extracting CreateSurface() and SurfaceReady()
into an interface, in turn allowing better unit testing.

Bug: 875005
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I07d6934316cac629b2e78e2e96b66a19864bdd9e
Reviewed-on: https://chromium-review.googlesource.com/1178322Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583796}
parent 74b7f4ed
......@@ -2580,7 +2580,8 @@ V4L2SliceVideoDecodeAccelerator::V4L2H264Accelerator::SubmitDecode(
Reset();
v4l2_dec_->DecodeSurface(dec_surface);
DVLOGF(4) << "Submitting decode for surface: " << dec_surface->ToString();
v4l2_dec_->Enqueue(dec_surface);
return Status::kOk;
}
......@@ -2815,7 +2816,8 @@ bool V4L2SliceVideoDecodeAccelerator::V4L2VP8Accelerator::SubmitDecode(
frame_hdr->frame_size))
return false;
v4l2_dec_->DecodeSurface(dec_surface);
DVLOGF(4) << "Submitting decode for surface: " << dec_surface->ToString();
v4l2_dec_->Enqueue(dec_surface);
return true;
}
......@@ -3118,7 +3120,8 @@ bool V4L2SliceVideoDecodeAccelerator::V4L2VP9Accelerator::SubmitDecode(
frame_hdr->frame_size))
return false;
v4l2_dec_->DecodeSurface(dec_surface);
DVLOGF(4) << "Submitting decode for surface: " << dec_surface->ToString();
v4l2_dec_->Enqueue(dec_surface);
return true;
}
......@@ -3202,14 +3205,6 @@ V4L2SliceVideoDecodeAccelerator::V4L2VP9Accelerator::
return v4l2_pic->dec_surface();
}
void V4L2SliceVideoDecodeAccelerator::DecodeSurface(
const scoped_refptr<V4L2DecodeSurface>& dec_surface) {
DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread());
DVLOGF(4) << "Submitting decode for surface: " << dec_surface->ToString();
Enqueue(dec_surface);
}
void V4L2SliceVideoDecodeAccelerator::SurfaceReady(
int32_t bitstream_id,
const scoped_refptr<V4L2DecodeSurface>& dec_surface) {
......
......@@ -134,10 +134,6 @@ class MEDIA_GPU_EXPORT V4L2SliceVideoDecodeAccelerator
// Return true if the driver exposes V4L2 control |ctrl_id|, false otherwise.
bool IsCtrlExposed(uint32_t ctrl_id);
// Decode of |dec_surface| is ready to be submitted and all codec-specific
// settings are set in hardware.
void DecodeSurface(const scoped_refptr<V4L2DecodeSurface>& dec_surface);
// |dec_surface| is ready to be outputted once decode is finished.
// This can be called before decode is actually done in hardware, and this
// method is responsible for maintaining the ordering, i.e. the surfaces will
......
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