| Index: media/gpu/vaapi_video_decode_accelerator.cc
|
| diff --git a/media/gpu/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi_video_decode_accelerator.cc
|
| index cbf1796db167891402ee265e68414fc4f76f3b61..f5cd0b2a6d701c573c43461ebe67b65ae113743f 100644
|
| --- a/media/gpu/vaapi_video_decode_accelerator.cc
|
| +++ b/media/gpu/vaapi_video_decode_accelerator.cc
|
| @@ -637,6 +637,18 @@ void VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange(size_t num_pics,
|
| TryFinishSurfaceSetChange();
|
| }
|
|
|
| +static VideoPixelFormat BufferFormatToVideoPixelFormat(
|
| + gfx::BufferFormat format) {
|
| + switch (format) {
|
| + case gfx::BufferFormat::BGRA_8888:
|
| + return PIXEL_FORMAT_ARGB;
|
| +
|
| + default:
|
| + LOG(FATAL) << "Add more cases as needed";
|
| + return PIXEL_FORMAT_UNKNOWN;
|
| + }
|
| +}
|
| +
|
| void VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange() {
|
| DCHECK_EQ(message_loop_, base::MessageLoop::current());
|
|
|
| @@ -676,10 +688,12 @@ void VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange() {
|
| DVLOG(1) << "Requesting " << requested_num_pics_
|
| << " pictures of size: " << requested_pic_size_.ToString();
|
|
|
| + VideoPixelFormat format =
|
| + BufferFormatToVideoPixelFormat(kOutputPictureFormat);
|
| message_loop_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&Client::ProvidePictureBuffers, client_, requested_num_pics_,
|
| - 1, requested_pic_size_, VaapiPicture::GetGLTextureTarget()));
|
| + FROM_HERE, base::Bind(&Client::ProvidePictureBuffers, client_,
|
| + requested_num_pics_, format, 1, requested_pic_size_,
|
| + VaapiPicture::GetGLTextureTarget()));
|
| }
|
|
|
| void VaapiVideoDecodeAccelerator::Decode(
|
| @@ -1044,22 +1058,6 @@ bool VaapiVideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread(
|
| return false;
|
| }
|
|
|
| -static VideoPixelFormat BufferFormatToVideoPixelFormat(
|
| - gfx::BufferFormat format) {
|
| - switch (format) {
|
| - case gfx::BufferFormat::BGRA_8888:
|
| - return PIXEL_FORMAT_ARGB;
|
| -
|
| - default:
|
| - LOG(FATAL) << "Add more cases as needed";
|
| - return PIXEL_FORMAT_UNKNOWN;
|
| - }
|
| -}
|
| -
|
| -VideoPixelFormat VaapiVideoDecodeAccelerator::GetOutputFormat() const {
|
| - return BufferFormatToVideoPixelFormat(kOutputPictureFormat);
|
| -}
|
| -
|
| bool VaapiVideoDecodeAccelerator::DecodeSurface(
|
| const scoped_refptr<VaapiDecodeSurface>& dec_surface) {
|
| if (!vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(
|
|
|