OLD | NEW |
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) { | 213 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) { |
214 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete( | 214 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete( |
215 host_route_id_, success))) | 215 host_route_id_, success))) |
216 DLOG(ERROR) | 216 DLOG(ERROR) |
217 << "Send(AcceleratedVideoDecoderHostMsg_InitializationComplete) failed"; | 217 << "Send(AcceleratedVideoDecoderHostMsg_InitializationComplete) failed"; |
218 } | 218 } |
219 | 219 |
220 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( | 220 void GpuVideoDecodeAccelerator::ProvidePictureBuffers( |
221 uint32_t requested_num_of_buffers, | 221 uint32_t requested_num_of_buffers, |
| 222 VideoPixelFormat format, |
222 uint32_t textures_per_buffer, | 223 uint32_t textures_per_buffer, |
223 const gfx::Size& dimensions, | 224 const gfx::Size& dimensions, |
224 uint32_t texture_target) { | 225 uint32_t texture_target) { |
225 if (dimensions.width() > media::limits::kMaxDimension || | 226 if (dimensions.width() > media::limits::kMaxDimension || |
226 dimensions.height() > media::limits::kMaxDimension || | 227 dimensions.height() > media::limits::kMaxDimension || |
227 dimensions.GetArea() > media::limits::kMaxCanvas) { | 228 dimensions.GetArea() > media::limits::kMaxCanvas) { |
228 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 229 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
229 return; | 230 return; |
230 } | 231 } |
231 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( | 232 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( |
232 host_route_id_, requested_num_of_buffers, textures_per_buffer, | 233 host_route_id_, format, requested_num_of_buffers, textures_per_buffer, |
233 dimensions, texture_target))) { | 234 dimensions, texture_target))) { |
234 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " | 235 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " |
235 << "failed"; | 236 << "failed"; |
236 } | 237 } |
237 texture_dimensions_ = dimensions; | 238 texture_dimensions_ = dimensions; |
238 textures_per_buffer_ = textures_per_buffer; | 239 textures_per_buffer_ = textures_per_buffer; |
239 texture_target_ = texture_target; | 240 texture_target_ = texture_target; |
240 } | 241 } |
241 | 242 |
242 void GpuVideoDecodeAccelerator::DismissPictureBuffer( | 243 void GpuVideoDecodeAccelerator::DismissPictureBuffer( |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 GLenum target = texture_ref->texture()->target(); | 518 GLenum target = texture_ref->texture()->target(); |
518 gpu::gles2::TextureManager* texture_manager = | 519 gpu::gles2::TextureManager* texture_manager = |
519 stub_->decoder()->GetContextGroup()->texture_manager(); | 520 stub_->decoder()->GetContextGroup()->texture_manager(); |
520 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 521 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
521 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 522 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
522 } | 523 } |
523 uncleared_textures_.erase(it); | 524 uncleared_textures_.erase(it); |
524 } | 525 } |
525 | 526 |
526 } // namespace media | 527 } // namespace media |
OLD | NEW |