| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 uint32_t textures_per_buffer, | 222 uint32_t textures_per_buffer, |
| 223 const gfx::Size& dimensions, | 223 const gfx::Size& dimensions, |
| 224 uint32_t texture_target) { | 224 uint32_t texture_target) { |
| 225 if (dimensions.width() > media::limits::kMaxDimension || | 225 if (dimensions.width() > media::limits::kMaxDimension || |
| 226 dimensions.height() > media::limits::kMaxDimension || | 226 dimensions.height() > media::limits::kMaxDimension || |
| 227 dimensions.GetArea() > media::limits::kMaxCanvas) { | 227 dimensions.GetArea() > media::limits::kMaxCanvas) { |
| 228 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 228 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 229 return; | 229 return; |
| 230 } | 230 } |
| 231 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( | 231 if (!Send(new AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers( |
| 232 host_route_id_, requested_num_of_buffers, textures_per_buffer, | 232 host_route_id_, video_decode_accelerator_->GetOutputFormat(), |
| 233 dimensions, texture_target))) { | 233 requested_num_of_buffers, textures_per_buffer, dimensions, |
| 234 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( |
| 243 int32_t picture_buffer_id) { | 244 int32_t picture_buffer_id) { |
| (...skipping 273 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 |