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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 return decoder.Pass(); | 334 return decoder.Pass(); |
335 } | 335 } |
336 | 336 |
337 void GpuVideoDecodeAccelerator::BindImage(uint32 client_texture_id, | 337 void GpuVideoDecodeAccelerator::BindImage(uint32 client_texture_id, |
338 uint32 texture_target, | 338 uint32 texture_target, |
339 scoped_refptr<gfx::GLImage> image) { | 339 scoped_refptr<gfx::GLImage> image) { |
340 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); | 340 gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); |
341 gpu::gles2::TextureManager* texture_manager = | 341 gpu::gles2::TextureManager* texture_manager = |
342 command_decoder->GetContextGroup()->texture_manager(); | 342 command_decoder->GetContextGroup()->texture_manager(); |
343 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); | 343 gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id); |
344 if (ref) | 344 if (ref) { |
345 texture_manager->SetLevelImage(ref, texture_target, 0, image.get()); | 345 texture_manager->SetLevelImage(ref, texture_target, 0, image.get(), |
| 346 gpu::gles2::Texture::BOUND); |
| 347 } |
346 } | 348 } |
347 | 349 |
348 scoped_ptr<media::VideoDecodeAccelerator> | 350 scoped_ptr<media::VideoDecodeAccelerator> |
349 GpuVideoDecodeAccelerator::CreateVaapiVDA() { | 351 GpuVideoDecodeAccelerator::CreateVaapiVDA() { |
350 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 352 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
351 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 353 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
352 decoder.reset(new VaapiVideoDecodeAccelerator( | 354 decoder.reset(new VaapiVideoDecodeAccelerator( |
353 make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage, | 355 make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage, |
354 base::Unretained(this)))); | 356 base::Unretained(this)))); |
355 #endif | 357 #endif |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 return stub_->channel()->Send(message); | 620 return stub_->channel()->Send(message); |
619 } | 621 } |
620 | 622 |
621 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 623 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
622 bool succeeded) { | 624 bool succeeded) { |
623 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 625 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
624 Send(message); | 626 Send(message); |
625 } | 627 } |
626 | 628 |
627 } // namespace content | 629 } // namespace content |
OLD | NEW |