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