| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } else { | 388 } else { |
| 389 // For other targets, texture dimensions should already be defined. | 389 // For other targets, texture dimensions should already be defined. |
| 390 GLsizei width = 0, height = 0; | 390 GLsizei width = 0, height = 0; |
| 391 info->GetLevelSize(texture_target_, 0, &width, &height); | 391 info->GetLevelSize(texture_target_, 0, &width, &height); |
| 392 if (width != texture_dimensions_.width() || | 392 if (width != texture_dimensions_.width() || |
| 393 height != texture_dimensions_.height()) { | 393 height != texture_dimensions_.height()) { |
| 394 DLOG(ERROR) << "Size mismatch for texture id " << texture_ids[i]; | 394 DLOG(ERROR) << "Size mismatch for texture id " << texture_ids[i]; |
| 395 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 395 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
| 396 return; | 396 return; |
| 397 } | 397 } |
| 398 |
| 399 // FIXME: after moving to D3D11, remove this workaround. crbug.com/438691 |
| 400 GLenum format = |
| 401 video_decode_accelerator_.get()->GetSurfaceInternalFormat(); |
| 402 if (format != GL_RGBA) { |
| 403 texture_manager->SetLevelInfo(texture_ref, texture_target_, 0, format, |
| 404 width, height, 1, 0, format, 0, false); |
| 405 } |
| 398 } | 406 } |
| 399 uint32 service_texture_id; | 407 uint32 service_texture_id; |
| 400 if (!command_decoder->GetServiceTextureId( | 408 if (!command_decoder->GetServiceTextureId( |
| 401 texture_ids[i], &service_texture_id)) { | 409 texture_ids[i], &service_texture_id)) { |
| 402 DLOG(ERROR) << "Failed to translate texture!"; | 410 DLOG(ERROR) << "Failed to translate texture!"; |
| 403 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 411 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 404 return; | 412 return; |
| 405 } | 413 } |
| 406 buffers.push_back(media::PictureBuffer( | 414 buffers.push_back(media::PictureBuffer( |
| 407 buffer_ids[i], texture_dimensions_, service_texture_id)); | 415 buffer_ids[i], texture_dimensions_, service_texture_id)); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 return stub_->channel()->Send(message); | 514 return stub_->channel()->Send(message); |
| 507 } | 515 } |
| 508 | 516 |
| 509 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 517 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 510 bool succeeded) { | 518 bool succeeded) { |
| 511 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 519 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 512 Send(message); | 520 Send(message); |
| 513 } | 521 } |
| 514 | 522 |
| 515 } // namespace content | 523 } // namespace content |
| OLD | NEW |