t a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc index 025d971..cdadc1d 100644 --- a/content/common/gpu/media/gpu_video_decode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc @@ -31,7 +31,7 @@ #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" #include "content/common/gpu/media/v4l2_video_device.h" -#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) +#elif (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" #include "ui/gl/gl_context_glx.h" #include "ui/gl/gl_implementation.h" @@ -273,7 +273,7 @@ void GpuVideoDecodeAccelerator::Initialize( make_context_current_, device.Pass(), io_message_loop_)); -#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) +#elif (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { VLOG(1) << "HW video decode acceleration not available without " "DesktopGL (GLX)."; diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc index 3fe89d3..9d05701 100644 --- a/content/common/gpu/media/gpu_video_encode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc @@ -17,7 +17,7 @@ #include "media/base/limits.h" #include "media/base/video_frame.h" -#if defined(OS_CHROMEOS) && defined(USE_X11) +#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_X11) #if defined(ARCH_CPU_ARMEL) #include "content/common/gpu/media/v4l2_video_encode_accelerator.h" @@ -174,7 +174,7 @@ GpuVideoEncodeAccelerator::GetSupportedProfiles() { scoped_ptr GpuVideoEncodeAccelerator::CreateEncoder() { scoped_ptr encoder; -#if defined(OS_CHROMEOS) && defined(USE_X11) +#if (defined(OS_CHROMEOS) || defined(OS_LINUX)) && defined(USE_X11) #if defined(ARCH_CPU_ARMEL) scoped_ptr device = V4L2Device::Create(V4L2Device::kEncoder); if (device) diff --git a/content/content_common.gypi b/content/content_common.gypi index c902ca7..91e0bc7 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -763,7 +763,7 @@ '<(DEPTH)/third_party/khronos', ], }], - ['target_arch != "arm" and chromeos == 1 and use_x11 == 1', { + ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1) and use_x11 == 1', { 'dependencies': [ '../media/media.gyp:media', '../third_party/libyuv/libyuv.gyp:libyuv', diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi index 4400ec8..a464fcb 100644 --- a/content/content_gpu.gypi +++ b/content/content_gpu.gypi @@ -40,7 +40,7 @@ ], }, }], - ['target_arch!="arm" and chromeos == 1', { + ['target_arch!="arm" and (chromeos == 1 or desktop_linux == 1)', { 'include_dirs': [ '<(DEPTH)/third_party/libva', ], diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 4f3744d..effd27d 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -1518,7 +1518,7 @@ }, ] }], - ['chromeos==1 and use_x11 == 1 and target_arch != "arm"', { + ['(chromeos==1 or desktop_linux==1) and use_x11 == 1 and target_arch != "arm"', { 'targets': [ { 'target_name': 'vaapi_h264_decoder_unittest', diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 4d5ce41..21dd525 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -918,7 +918,9 @@ const char kDisableWebAudio[] = "disable-webaudio"; #if defined(OS_CHROMEOS) // Disables panel fitting (used for mirror mode). const char kDisablePanelFitting[] = "disable-panel-fitting"; +#endif +#if defined(OS_CHROMEOS) || defined(OS_LINUX) // Enables VA-API accelerated video encode. const char kDisableVaapiAcceleratedVideoEncode[] = "disable-vaapi-accelerated-video-encode"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 463e6ed..78aa026 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -265,6 +265,9 @@ CONTENT_EXPORT extern const char kDisableWebAudio[]; #if defined(OS_CHROMEOS) CONTENT_EXPORT extern const char kDisablePanelFitting[]; +#endif + +#if defined(OS_CHROMEOS) || defined(OS_LINUX) CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[]; #endif diff --git a/media/media.gyp b/media/media.gyp index 661d5c7..300480c 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -663,7 +663,7 @@ ], }], # For VaapiVideoEncodeAccelerator. - ['target_arch != "arm" and chromeos == 1 and use_x11 == 1', { + ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1) and use_x11 == 1', { 'sources': [ 'filters/h264_bitstream_buffer.cc', 'filters/h264_bitstream_buffer.h', @@ -1367,7 +1367,7 @@ }], ], }], - ['target_arch != "arm" and chromeos == 1 and use_x11 == 1', { + ['target_arch != "arm" and (chromeos == 1 or desktop_linux == 1) and use_x11 == 1', { 'sources': [ 'filters/h264_bitstream_buffer_unittest.cc', ],