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

Side by Side Diff: media/gpu/ipc/service/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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/gpu/ipc/service/gpu_video_decode_accelerator.h" 5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) { 212 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) {
213 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete( 213 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete(
214 host_route_id_, success))) 214 host_route_id_, success)))
215 DLOG(ERROR) 215 DLOG(ERROR)
216 << "Send(AcceleratedVideoDecoderHostMsg_InitializationComplete) failed"; 216 << "Send(AcceleratedVideoDecoderHostMsg_InitializationComplete) failed";
217 } 217 }
218 218
219 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( 219 void GpuVideoDecodeAccelerator::ProvidePictureBuffers(
220 uint32_t requested_num_of_buffers, 220 uint32_t requested_num_of_buffers,
221 VideoPixelFormat format,
221 uint32_t textures_per_buffer, 222 uint32_t textures_per_buffer,
222 const gfx::Size& dimensions, 223 const gfx::Size& dimensions,
223 uint32_t texture_target) { 224 uint32_t texture_target) {
224 if (dimensions.width() > media::limits::kMaxDimension || 225 if (dimensions.width() > media::limits::kMaxDimension ||
225 dimensions.height() > media::limits::kMaxDimension || 226 dimensions.height() > media::limits::kMaxDimension ||
226 dimensions.GetArea() > media::limits::kMaxCanvas) { 227 dimensions.GetArea() > media::limits::kMaxCanvas) {
227 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 228 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
228 return; 229 return;
229 } 230 }
230 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( 231 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers(
231 host_route_id_, requested_num_of_buffers, textures_per_buffer, 232 host_route_id_, requested_num_of_buffers, format, textures_per_buffer,
232 dimensions, texture_target))) { 233 dimensions, texture_target))) {
233 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " 234 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) "
234 << "failed"; 235 << "failed";
235 } 236 }
236 texture_dimensions_ = dimensions; 237 texture_dimensions_ = dimensions;
237 textures_per_buffer_ = textures_per_buffer; 238 textures_per_buffer_ = textures_per_buffer;
238 texture_target_ = texture_target; 239 texture_target_ = texture_target;
239 } 240 }
240 241
241 void GpuVideoDecodeAccelerator::DismissPictureBuffer( 242 void GpuVideoDecodeAccelerator::DismissPictureBuffer(
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 GLenum target = texture_ref->texture()->target(); 512 GLenum target = texture_ref->texture()->target();
512 gpu::gles2::TextureManager* texture_manager = 513 gpu::gles2::TextureManager* texture_manager =
513 stub_->decoder()->GetContextGroup()->texture_manager(); 514 stub_->decoder()->GetContextGroup()->texture_manager();
514 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 515 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
515 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 516 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
516 } 517 }
517 uncleared_textures_.erase(it); 518 uncleared_textures_.erase(it);
518 } 519 }
519 520
520 } // namespace media 521 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/ipc/service/gpu_video_decode_accelerator.h ('k') | media/gpu/v4l2_slice_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698