| 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" |
| 49 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 50 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 50 #endif | 51 #endif |
| 51 | 52 |
| 52 #include "ui/gfx/geometry/size.h" | 53 #include "ui/gfx/geometry/size.h" |
| 53 | 54 |
| 54 namespace content { | 55 namespace content { |
| 55 | 56 |
| 56 static bool MakeDecoderContextCurrent( | 57 static bool MakeDecoderContextCurrent( |
| 57 const base::WeakPtr<GpuCommandBufferStub> stub) { | 58 const base::WeakPtr<GpuCommandBufferStub> stub) { |
| 58 if (!stub) { | 59 if (!stub) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); | 375 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); |
| 375 #endif | 376 #endif |
| 376 return decoder.Pass(); | 377 return decoder.Pass(); |
| 377 } | 378 } |
| 378 | 379 |
| 379 scoped_ptr<media::VideoDecodeAccelerator> | 380 scoped_ptr<media::VideoDecodeAccelerator> |
| 380 GpuVideoDecodeAccelerator::CreateAndroidVDA() { | 381 GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
| 381 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 382 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 382 #if defined(OS_ANDROID) | 383 #if defined(OS_ANDROID) |
| 383 decoder.reset(new AndroidVideoDecodeAccelerator( | 384 decoder.reset(new AndroidVideoDecodeAccelerator( |
| 384 stub_->decoder()->AsWeakPtr(), | 385 stub_->decoder()->AsWeakPtr(), make_context_current_, |
| 385 make_context_current_)); | 386 make_scoped_ptr(new AndroidCopyingBackingStrategy()))); |
| 386 #endif | 387 #endif |
| 387 return decoder.Pass(); | 388 return decoder.Pass(); |
| 388 } | 389 } |
| 389 | 390 |
| 390 // static | 391 // static |
| 391 gpu::VideoDecodeAcceleratorSupportedProfiles | 392 gpu::VideoDecodeAcceleratorSupportedProfiles |
| 392 GpuVideoDecodeAccelerator::GetSupportedProfiles() { | 393 GpuVideoDecodeAccelerator::GetSupportedProfiles() { |
| 393 media::VideoDecodeAccelerator::SupportedProfiles profiles; | 394 media::VideoDecodeAccelerator::SupportedProfiles profiles; |
| 394 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 395 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 395 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | 396 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 return stub_->channel()->Send(message); | 611 return stub_->channel()->Send(message); |
| 611 } | 612 } |
| 612 | 613 |
| 613 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 614 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 614 bool succeeded) { | 615 bool succeeded) { |
| 615 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 616 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 616 Send(message); | 617 Send(message); |
| 617 } | 618 } |
| 618 | 619 |
| 619 } // namespace content | 620 } // namespace content |
| OLD | NEW |