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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 363 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
364 return; | 364 return; |
365 } | 365 } |
366 gpu::gles2::Texture* info = texture_ref->texture(); | 366 gpu::gles2::Texture* info = texture_ref->texture(); |
367 if (info->target() != texture_target_) { | 367 if (info->target() != texture_target_) { |
368 DLOG(ERROR) << "Texture target mismatch for texture id " | 368 DLOG(ERROR) << "Texture target mismatch for texture id " |
369 << texture_ids[i]; | 369 << texture_ids[i]; |
370 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 370 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
371 return; | 371 return; |
372 } | 372 } |
373 if (texture_target_ == GL_TEXTURE_EXTERNAL_OES) { | 373 if (texture_target_ == GL_TEXTURE_EXTERNAL_OES || |
374 // GL_TEXTURE_EXTERNAL_OES textures have their dimensions defined by the | 374 texture_target_ == GL_TEXTURE_RECTANGLE) { |
375 // underlying EGLImage. Use |texture_dimensions_| for this size. | 375 // These textures have their dimensions defined by the underlying storage. |
| 376 // Use |texture_dimensions_| for this size. |
376 texture_manager->SetLevelInfo(texture_ref, | 377 texture_manager->SetLevelInfo(texture_ref, |
377 GL_TEXTURE_EXTERNAL_OES, | 378 texture_target_, |
378 0, | 379 0, |
379 0, | 380 0, |
380 texture_dimensions_.width(), | 381 texture_dimensions_.width(), |
381 texture_dimensions_.height(), | 382 texture_dimensions_.height(), |
382 1, | 383 1, |
383 0, | 384 0, |
384 0, | 385 0, |
385 0, | 386 0, |
386 false); | 387 false); |
387 } else { | 388 } else { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return stub_->channel()->Send(message); | 506 return stub_->channel()->Send(message); |
506 } | 507 } |
507 | 508 |
508 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 509 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
509 bool succeeded) { | 510 bool succeeded) { |
510 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 511 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
511 Send(message); | 512 Send(message); |
512 } | 513 } |
513 | 514 |
514 } // namespace content | 515 } // namespace content |
OLD | NEW |