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

Side by Side Diff: chrome/gpu/arc_gpu_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: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h" 5 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h" 10 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 DCHECK(thread_checker_.CalledOnValidThread()); 226 DCHECK(thread_checker_.CalledOnValidThread());
227 if (!vda_) { 227 if (!vda_) {
228 DLOG(ERROR) << "VDA not initialized"; 228 DLOG(ERROR) << "VDA not initialized";
229 return; 229 return;
230 } 230 }
231 vda_->Reset(); 231 vda_->Reset();
232 } 232 }
233 233
234 void ArcGpuVideoDecodeAccelerator::ProvidePictureBuffers( 234 void ArcGpuVideoDecodeAccelerator::ProvidePictureBuffers(
235 uint32_t requested_num_of_buffers, 235 uint32_t requested_num_of_buffers,
236 media::VideoPixelFormat output_format,
236 uint32_t textures_per_buffer, 237 uint32_t textures_per_buffer,
237 const gfx::Size& dimensions, 238 const gfx::Size& dimensions,
238 uint32_t texture_target) { 239 uint32_t texture_target) {
239 DVLOG(5) << "ProvidePictureBuffers(" 240 DVLOG(5) << "ProvidePictureBuffers("
240 << "requested_num_of_buffers=" << requested_num_of_buffers 241 << "requested_num_of_buffers=" << requested_num_of_buffers
241 << ", dimensions=" << dimensions.ToString() << ")"; 242 << ", dimensions=" << dimensions.ToString() << ")";
242 DCHECK(thread_checker_.CalledOnValidThread()); 243 DCHECK(thread_checker_.CalledOnValidThread());
243 coded_size_ = dimensions; 244 coded_size_ = dimensions;
244 245
245 VideoFormat video_format; 246 VideoFormat video_format;
246 media::VideoPixelFormat output_format = vda_->GetOutputFormat();
247 switch (output_format) { 247 switch (output_format) {
248 case media::PIXEL_FORMAT_I420: 248 case media::PIXEL_FORMAT_I420:
249 case media::PIXEL_FORMAT_YV12: 249 case media::PIXEL_FORMAT_YV12:
250 case media::PIXEL_FORMAT_NV12: 250 case media::PIXEL_FORMAT_NV12:
251 case media::PIXEL_FORMAT_NV21: 251 case media::PIXEL_FORMAT_NV21:
252 // HAL_PIXEL_FORMAT_YCbCr_420_888 is the flexible pixel format in Android 252 // HAL_PIXEL_FORMAT_YCbCr_420_888 is the flexible pixel format in Android
253 // which handles all 420 formats, with both orderings of chroma (CbCr and 253 // which handles all 420 formats, with both orderings of chroma (CbCr and
254 // CrCb) as well as planar and semi-planar layouts. 254 // CrCb) as well as planar and semi-planar layouts.
255 video_format.pixel_format = HAL_PIXEL_FORMAT_YCbCr_420_888; 255 video_format.pixel_format = HAL_PIXEL_FORMAT_YCbCr_420_888;
256 break; 256 break;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 return true; 418 return true;
419 default: 419 default:
420 DLOG(ERROR) << "Invalid port: " << port; 420 DLOG(ERROR) << "Invalid port: " << port;
421 return false; 421 return false;
422 } 422 }
423 } 423 }
424 424
425 } // namespace arc 425 } // namespace arc
426 } // namespace chromeos 426 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698