Chromium Code Reviews| Index: content/common/gpu/media/gpu_video_encode_accelerator.cc |
| diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc |
| index 12c7b10b3259eeaf75acba1cd9a041f4f9915c9f..7178101797c4dd091f7c342ce25bfe7f6cd53c51 100644 |
| --- a/content/common/gpu/media/gpu_video_encode_accelerator.cc |
| +++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc |
| @@ -15,8 +15,15 @@ |
| #include "media/base/limits.h" |
| #include "media/base/video_frame.h" |
| -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
| +#if defined(OS_CHROMEOS) && defined(USE_X11) |
| + |
| +#if defined(ARCH_CPU_ARMEL) |
| #include "content/common/gpu/media/v4l2_video_encode_accelerator.h" |
| +#elif defined(ARCH_CPU_X86_FAMILY) |
| +#include "content/common/gpu/media/vaapi_video_encode_accelerator.h" |
| +#include "ui/gfx/x/x11_types.h" |
| +#endif |
| + |
| #elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC) |
| #include "content/common/gpu/media/android_video_encode_accelerator.h" |
| #endif |
| @@ -158,8 +165,12 @@ std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
| GpuVideoEncodeAccelerator::GetSupportedProfiles() { |
| std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; |
| -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
| +#if defined(OS_CHROMEOS) && defined(USE_X11) |
| +#if defined(ARCH_CPU_ARMEL) |
| profiles = V4L2VideoEncodeAccelerator::GetSupportedProfiles(); |
| +#elif defined(ARCH_CPU_X86_FAMILY) |
| + profiles = VaapiVideoEncodeAccelerator::GetSupportedProfiles(); |
| +#endif |
| #elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC) |
| profiles = AndroidVideoEncodeAccelerator::GetSupportedProfiles(); |
| #endif |
| @@ -170,12 +181,16 @@ GpuVideoEncodeAccelerator::GetSupportedProfiles() { |
| void GpuVideoEncodeAccelerator::CreateEncoder() { |
| DCHECK(!encoder_); |
| -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
| +#if defined(OS_CHROMEOS) && defined(USE_X11) |
| +#if defined(ARCH_CPU_ARMEL) |
| scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kEncoder); |
| if (!device.get()) |
| return; |
| encoder_.reset(new V4L2VideoEncodeAccelerator(device.Pass())); |
| +#elif defined(ARCH_CPU_X86_FAMILY) |
| + encoder_.reset(new VaapiVideoEncodeAccelerator(gfx::GetXDisplay())); |
| +#endif |
|
piman
2014/06/20 17:10:22
Should this be gated on the flag? Rationale: don't
Pawel Osciak
2014/06/20 22:28:11
It actually is, just in a convoluted way. As I men
piman
2014/06/21 01:27:06
The idea is that the gpu process is privileged, it
Pawel Osciak
2014/06/21 03:13:12
Good point. Done. This makes we want to do the sam
|
| #elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC) |
| encoder_.reset(new AndroidVideoEncodeAccelerator()); |
| #endif |