| 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 gpu::gles2::TextureManager* texture_manager = | 240 gpu::gles2::TextureManager* texture_manager = |
| 241 command_decoder->GetContextGroup()->texture_manager(); | 241 command_decoder->GetContextGroup()->texture_manager(); |
| 242 | 242 |
| 243 std::vector<media::PictureBuffer> buffers; | 243 std::vector<media::PictureBuffer> buffers; |
| 244 for (uint32 i = 0; i < buffer_ids.size(); ++i) { | 244 for (uint32 i = 0; i < buffer_ids.size(); ++i) { |
| 245 if (buffer_ids[i] < 0) { | 245 if (buffer_ids[i] < 0) { |
| 246 DLOG(FATAL) << "Buffer id " << buffer_ids[i] << " out of range"; | 246 DLOG(FATAL) << "Buffer id " << buffer_ids[i] << " out of range"; |
| 247 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 247 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 gpu::gles2::TextureManager::TextureInfo* info = | 250 gpu::gles2::Texture* info = texture_manager->GetTexture(texture_ids[i]); |
| 251 texture_manager->GetTextureInfo(texture_ids[i]); | |
| 252 if (!info) { | 251 if (!info) { |
| 253 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i]; | 252 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i]; |
| 254 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 253 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
| 255 return; | 254 return; |
| 256 } | 255 } |
| 257 GLsizei width, height; | 256 GLsizei width, height; |
| 258 info->GetLevelSize(texture_target_, 0, &width, &height); | 257 info->GetLevelSize(texture_target_, 0, &width, &height); |
| 259 if (width != sizes[i].width() || height != sizes[i].height()) { | 258 if (width != sizes[i].width() || height != sizes[i].height()) { |
| 260 DLOG(FATAL) << "Size mismatch for texture id " << texture_ids[i]; | 259 DLOG(FATAL) << "Size mismatch for texture id " << texture_ids[i]; |
| 261 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 260 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 stub_.reset(); | 336 stub_.reset(); |
| 338 } | 337 } |
| 339 } | 338 } |
| 340 | 339 |
| 341 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 340 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 342 DCHECK(sender_); | 341 DCHECK(sender_); |
| 343 return sender_->Send(message); | 342 return sender_->Send(message); |
| 344 } | 343 } |
| 345 | 344 |
| 346 } // namespace content | 345 } // namespace content |
| OLD | NEW |