| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | |
| 222 uint32_t textures_per_buffer, | 221 uint32_t textures_per_buffer, |
| 223 const gfx::Size& dimensions, | 222 const gfx::Size& dimensions, |
| 224 uint32_t texture_target) { | 223 uint32_t texture_target) { |
| 225 if (dimensions.width() > media::limits::kMaxDimension || | 224 if (dimensions.width() > media::limits::kMaxDimension || |
| 226 dimensions.height() > media::limits::kMaxDimension || | 225 dimensions.height() > media::limits::kMaxDimension || |
| 227 dimensions.GetArea() > media::limits::kMaxCanvas) { | 226 dimensions.GetArea() > media::limits::kMaxCanvas) { |
| 228 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 227 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 229 return; | 228 return; |
| 230 } | 229 } |
| 231 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( | 230 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( |
| 232 host_route_id_, requested_num_of_buffers, format, textures_per_buffer, | 231 host_route_id_, requested_num_of_buffers, textures_per_buffer, |
| 233 dimensions, texture_target))) { | 232 dimensions, texture_target))) { |
| 234 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " | 233 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " |
| 235 << "failed"; | 234 << "failed"; |
| 236 } | 235 } |
| 237 texture_dimensions_ = dimensions; | 236 texture_dimensions_ = dimensions; |
| 238 textures_per_buffer_ = textures_per_buffer; | 237 textures_per_buffer_ = textures_per_buffer; |
| 239 texture_target_ = texture_target; | 238 texture_target_ = texture_target; |
| 240 } | 239 } |
| 241 | 240 |
| 242 void GpuVideoDecodeAccelerator::DismissPictureBuffer( | 241 void GpuVideoDecodeAccelerator::DismissPictureBuffer( |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 GLenum target = texture_ref->texture()->target(); | 511 GLenum target = texture_ref->texture()->target(); |
| 513 gpu::gles2::TextureManager* texture_manager = | 512 gpu::gles2::TextureManager* texture_manager = |
| 514 stub_->decoder()->GetContextGroup()->texture_manager(); | 513 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 515 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 514 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 516 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 515 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 517 } | 516 } |
| 518 uncleared_textures_.erase(it); | 517 uncleared_textures_.erase(it); |
| 519 } | 518 } |
| 520 | 519 |
| 521 } // namespace media | 520 } // namespace media |
| OLD | NEW |