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/logging.h" | 10 #include "base/logging.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 | 224 |
225 std::vector<media::PictureBuffer> buffers; | 225 std::vector<media::PictureBuffer> buffers; |
226 for (uint32 i = 0; i < buffer_ids.size(); ++i) { | 226 for (uint32 i = 0; i < buffer_ids.size(); ++i) { |
227 gpu::gles2::TextureManager::TextureInfo* info = | 227 gpu::gles2::TextureManager::TextureInfo* info = |
228 texture_manager->GetTextureInfo(texture_ids[i]); | 228 texture_manager->GetTextureInfo(texture_ids[i]); |
229 if (!info) { | 229 if (!info) { |
230 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i]; | 230 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i]; |
231 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 231 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
232 return; | 232 return; |
233 } | 233 } |
234 GLsizei width, height; | |
235 info->GetLevelSize(0, 0, &width, &height); | |
dwkang1
2013/01/15 08:17:46
crbug says I don't have permission for 168293. So
sheu
2013/01/15 08:25:38
It looks like you're right; I'll have to follow-up
| |
236 if (width != sizes[i].width() || height != sizes[i].height()) { | |
237 DLOG(FATAL) << "Size mismatch for texture id " << texture_ids[i]; | |
238 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | |
239 return; | |
240 } | |
234 if (!texture_manager->ClearRenderableLevels(command_decoder, info)) { | 241 if (!texture_manager->ClearRenderableLevels(command_decoder, info)) { |
235 DLOG(FATAL) << "Failed to Clear texture id " << texture_ids[i]; | 242 DLOG(FATAL) << "Failed to Clear texture id " << texture_ids[i]; |
236 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 243 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
237 return; | 244 return; |
238 } | 245 } |
239 uint32 service_texture_id; | 246 uint32 service_texture_id; |
240 if (!command_decoder->GetServiceTextureId( | 247 if (!command_decoder->GetServiceTextureId( |
241 texture_ids[i], &service_texture_id)) { | 248 texture_ids[i], &service_texture_id)) { |
242 DLOG(FATAL) << "Failed to translate texture!"; | 249 DLOG(FATAL) << "Failed to translate texture!"; |
243 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 250 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 stub_.reset(); | 314 stub_.reset(); |
308 } | 315 } |
309 } | 316 } |
310 | 317 |
311 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 318 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
312 DCHECK(sender_); | 319 DCHECK(sender_); |
313 return sender_->Send(message); | 320 return sender_->Send(message); |
314 } | 321 } |
315 | 322 |
316 } // namespace content | 323 } // namespace content |
OLD | NEW |