| 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 28 matching lines...) Expand all Loading... |
| 39 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" | 39 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" |
| 40 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 40 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
| 41 #endif | 41 #endif |
| 42 #if defined(ARCH_CPU_X86_FAMILY) | 42 #if defined(ARCH_CPU_X86_FAMILY) |
| 43 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 43 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 44 #include "ui/gl/gl_implementation.h" | 44 #include "ui/gl/gl_implementation.h" |
| 45 #endif | 45 #endif |
| 46 #elif defined(USE_OZONE) | 46 #elif defined(USE_OZONE) |
| 47 #include "media/ozone/media_ozone_platform.h" | 47 #include "media/ozone/media_ozone_platform.h" |
| 48 #elif defined(OS_ANDROID) | 48 #elif defined(OS_ANDROID) |
| 49 #include "content/common/gpu/media/android_copying_backing_strategy.h" | |
| 50 #include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h
" | |
| 51 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 49 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 52 #endif | 50 #endif |
| 53 | 51 |
| 54 #include "ui/gfx/geometry/size.h" | 52 #include "ui/gfx/geometry/size.h" |
| 55 | 53 |
| 56 namespace content { | 54 namespace content { |
| 57 | 55 |
| 58 static bool MakeDecoderContextCurrent( | 56 static bool MakeDecoderContextCurrent( |
| 59 const base::WeakPtr<GpuCommandBufferStub> stub) { | 57 const base::WeakPtr<GpuCommandBufferStub> stub) { |
| 60 if (!stub) { | 58 if (!stub) { |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 media::MediaOzonePlatform::GetInstance(); | 463 media::MediaOzonePlatform::GetInstance(); |
| 466 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); | 464 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); |
| 467 #endif | 465 #endif |
| 468 return decoder.Pass(); | 466 return decoder.Pass(); |
| 469 } | 467 } |
| 470 | 468 |
| 471 scoped_ptr<media::VideoDecodeAccelerator> | 469 scoped_ptr<media::VideoDecodeAccelerator> |
| 472 GpuVideoDecodeAccelerator::CreateAndroidVDA() { | 470 GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
| 473 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 471 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 474 #if defined(OS_ANDROID) | 472 #if defined(OS_ANDROID) |
| 475 decoder.reset(new AndroidVideoDecodeAccelerator( | 473 decoder.reset(new AndroidVideoDecodeAccelerator(stub_->decoder()->AsWeakPtr(), |
| 476 stub_->decoder()->AsWeakPtr(), make_context_current_, | 474 make_context_current_)); |
| 477 make_scoped_ptr( | |
| 478 #if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID) | |
| 479 new AndroidDeferredRenderingBackingStrategy() | |
| 480 #else | |
| 481 new AndroidCopyingBackingStrategy() | |
| 482 #endif | |
| 483 ))); | |
| 484 #endif | 475 #endif |
| 485 return decoder.Pass(); | 476 return decoder.Pass(); |
| 486 } | 477 } |
| 487 | 478 |
| 488 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { | 479 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { |
| 489 DCHECK(video_decode_accelerator_); | 480 DCHECK(video_decode_accelerator_); |
| 490 video_decode_accelerator_->SetCdm(cdm_id); | 481 video_decode_accelerator_->SetCdm(cdm_id); |
| 491 } | 482 } |
| 492 | 483 |
| 493 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is | 484 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 uncleared_textures_.erase(it); | 629 uncleared_textures_.erase(it); |
| 639 } | 630 } |
| 640 | 631 |
| 641 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 632 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 642 bool succeeded) { | 633 bool succeeded) { |
| 643 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 634 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 644 Send(message); | 635 Send(message); |
| 645 } | 636 } |
| 646 | 637 |
| 647 } // namespace content | 638 } // namespace content |
| OLD | NEW |