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 bool os_win = false; | |
374 // FIXME: after moving to D3D11, remove this workaround. crbug.com/438691 | |
375 #if defined(OS_WIN) | |
376 os_win = true; | |
377 #endif | |
373 if (texture_target_ == GL_TEXTURE_EXTERNAL_OES || | 378 if (texture_target_ == GL_TEXTURE_EXTERNAL_OES || |
374 texture_target_ == GL_TEXTURE_RECTANGLE) { | 379 texture_target_ == GL_TEXTURE_RECTANGLE || os_win) { |
380 GLenum format = os_win ? GL_BGRA_EXT : GL_RGBA; | |
Ken Russell (switch to Gerrit)
2014/12/04 01:25:18
Please define some sort of API that is overridden
| |
375 // These textures have their dimensions defined by the underlying storage. | 381 // These textures have their dimensions defined by the underlying storage. |
376 // Use |texture_dimensions_| for this size. | 382 // Use |texture_dimensions_| for this size. |
377 texture_manager->SetLevelInfo(texture_ref, | 383 texture_manager->SetLevelInfo(texture_ref, |
378 texture_target_, | 384 texture_target_, |
379 0, | 385 0, |
380 GL_RGBA, | 386 format, |
381 texture_dimensions_.width(), | 387 texture_dimensions_.width(), |
382 texture_dimensions_.height(), | 388 texture_dimensions_.height(), |
383 1, | 389 1, |
384 0, | 390 0, |
385 GL_RGBA, | 391 format, |
386 0, | 392 0, |
387 false); | 393 false); |
388 } else { | 394 } else { |
389 // For other targets, texture dimensions should already be defined. | 395 // For other targets, texture dimensions should already be defined. |
390 GLsizei width = 0, height = 0; | 396 GLsizei width = 0, height = 0; |
391 info->GetLevelSize(texture_target_, 0, &width, &height); | 397 info->GetLevelSize(texture_target_, 0, &width, &height); |
392 if (width != texture_dimensions_.width() || | 398 if (width != texture_dimensions_.width() || |
393 height != texture_dimensions_.height()) { | 399 height != texture_dimensions_.height()) { |
394 DLOG(ERROR) << "Size mismatch for texture id " << texture_ids[i]; | 400 DLOG(ERROR) << "Size mismatch for texture id " << texture_ids[i]; |
395 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 401 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 return stub_->channel()->Send(message); | 512 return stub_->channel()->Send(message); |
507 } | 513 } |
508 | 514 |
509 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 515 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
510 bool succeeded) { | 516 bool succeeded) { |
511 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 517 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
512 Send(message); | 518 Send(message); |
513 } | 519 } |
514 | 520 |
515 } // namespace content | 521 } // namespace content |
OLD | NEW |