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

VaapiVDA: fold DecodeVASurface into callers

VaapiVideoDecodeAccelerator::DecodeVASurface() is superfluous because
the callers can do the call to |vaapi_wrapper_| themselves.  Moreover,
DecodeVaSurface() needs no logging because the underlying method
ExecuteAndDestroyPendingBuffers() has already a lot of logs.

Bug: 717265
Test: v_d_a vp8/vp9/h264 working as before on nautilus. simplechrome too.

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: Ibc40329808e744f6ca7af98cb7de4e13a7af5016
Reviewed-on: https://chromium-review.googlesource.com/1176279Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583477}
parent 2cf091a7
......@@ -296,9 +296,9 @@ Status VaapiH264Accelerator::SubmitDecode(
const scoped_refptr<H264Picture>& pic) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return vaapi_dec_->DecodeVASurface(pic->AsVaapiH264Picture()->va_surface())
? Status::kOk
: Status::kFail;
const bool success = vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(
pic->AsVaapiH264Picture()->va_surface()->id());
return success ? Status::kOk : Status::kFail;
}
bool VaapiH264Accelerator::OutputPicture(
......
......@@ -872,15 +872,6 @@ bool VaapiVideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread(
return false;
}
bool VaapiVideoDecodeAccelerator::DecodeVASurface(
const scoped_refptr<VASurface>& va_surface) {
const bool result =
vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(va_surface->id());
if (!result)
VLOGF(1) << "Failed decoding picture";
return result;
}
void VaapiVideoDecodeAccelerator::VASurfaceReady(
const scoped_refptr<VASurface>& va_surface,
int32_t bitstream_id,
......
......@@ -83,10 +83,6 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
//
// Below methods are used by accelerator implementations.
//
// Decode of |va_surface| is ready to be submitted and all codec-specific
// settings are set in hardware.
bool DecodeVASurface(const scoped_refptr<VASurface>& va_surface);
// The |visible_rect| area of |va_surface| associated with |bitstream_id| 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
......@@ -98,8 +94,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
void VASurfaceReady(const scoped_refptr<VASurface>& va_surface,
int32_t bitstream_id,
const gfx::Rect& visible_rect);
// Return a new VASurface for decoding into, or nullptr if not available.
// Returns a new VASurface for decoding into, or nullptr if not available.
scoped_refptr<VASurface> CreateVASurface();
private:
......
......@@ -220,7 +220,8 @@ bool VaapiVP8Accelerator::SubmitDecode(
frame_hdr->frame_size, frame_hdr->data))
return false;
return vaapi_dec_->DecodeVASurface(pic->AsVaapiVP8Picture()->va_surface());
return vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(
pic->AsVaapiVP8Picture()->va_surface()->id());
}
bool VaapiVP8Accelerator::OutputPicture(const scoped_refptr<VP8Picture>& pic) {
......
......@@ -158,7 +158,8 @@ bool VaapiVP9Accelerator::SubmitDecode(
frame_hdr->frame_size, frame_hdr->data))
return false;
return vaapi_dec_->DecodeVASurface(pic->AsVaapiVP9Picture()->va_surface());
return vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(
pic->AsVaapiVP9Picture()->va_surface()->id());
}
bool VaapiVP9Accelerator::OutputPicture(const scoped_refptr<VP9Picture>& pic) {
......
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