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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 media::MediaOzonePlatform::GetInstance(); | 372 media::MediaOzonePlatform::GetInstance(); |
372 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); | 373 decoder.reset(platform->CreateVideoDecodeAccelerator(make_context_current_)); |
373 #endif | 374 #endif |
374 return decoder.Pass(); | 375 return decoder.Pass(); |
375 } | 376 } |
376 | 377 |
377 scoped_ptr<media::VideoDecodeAccelerator> | 378 scoped_ptr<media::VideoDecodeAccelerator> |
378 GpuVideoDecodeAccelerator::CreateAndroidVDA() { | 379 GpuVideoDecodeAccelerator::CreateAndroidVDA() { |
379 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 380 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
380 #if defined(OS_ANDROID) | 381 #if defined(OS_ANDROID) |
381 decoder.reset(new AndroidVideoDecodeAccelerator( | 382 decoder.reset(AndroidVideoDecodeAccelerator::Create( |
382 stub_->decoder()->AsWeakPtr(), | 383 stub_->decoder()->AsWeakPtr(), |
383 make_context_current_)); | 384 make_context_current_, |
| 385 new AndroidCopyingBackingStrategy())); |
384 #endif | 386 #endif |
385 return decoder.Pass(); | 387 return decoder.Pass(); |
386 } | 388 } |
387 | 389 |
388 // static | 390 // static |
389 gpu::VideoDecodeAcceleratorSupportedProfiles | 391 gpu::VideoDecodeAcceleratorSupportedProfiles |
390 GpuVideoDecodeAccelerator::GetSupportedProfiles() { | 392 GpuVideoDecodeAccelerator::GetSupportedProfiles() { |
391 media::VideoDecodeAccelerator::SupportedProfiles profiles; | 393 media::VideoDecodeAccelerator::SupportedProfiles profiles; |
392 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 394 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
393 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | 395 if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 return stub_->channel()->Send(message); | 606 return stub_->channel()->Send(message); |
605 } | 607 } |
606 | 608 |
607 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 609 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
608 bool succeeded) { | 610 bool succeeded) { |
609 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 611 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
610 Send(message); | 612 Send(message); |
611 } | 613 } |
612 | 614 |
613 } // namespace content | 615 } // namespace content |
OLD | NEW |