Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Unified Diff: media/gpu/vaapi_video_decode_accelerator.cc

Issue 1942123002: Plumb decoded video pixel format from GPU process to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test on bots Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/vaapi_video_decode_accelerator.h ('k') | media/gpu/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « media/gpu/vaapi_video_decode_accelerator.h ('k') | media/gpu/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698