From 54deb9811ca9bd2327def5c05ba6987b8c7a0897 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Tue, 29 Sep 2020 01:02:22 +0000 Subject: [PATCH] Check for enable-accelerated-video-decode on Linux Video decoding was being accelerated on Linux even though the newly added "enable-accelerated-video-decode" flag was not specified. The chrome://gpu page was misleadingly showing this feature as disabled: > Video Decode: Software only. Hardware acceleration disabled This change adds a check for --enable-accelerated-video-decode when considering if video decoding should be activated. (Only on Linux.) Extra context: https://crbug.com/1097029#c18 (and also comment 20). Bug: 1066176, 1097029 Change-Id: I534115f5f6ceed0ee3511fcf5c2d0f1dd04b9b7e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431434 Reviewed-by: John Abd-El-Malek Reviewed-by: Dale Curtis Commit-Queue: Ted Meyer Cr-Commit-Position: refs/heads/master@{#811480} --- content/renderer/render_thread_impl.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index f13c94ddab7..0352f127171 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -1121,7 +1121,11 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() { kGpuStreamPriorityMedia); const bool enable_video_accelerator = +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + cmd_line->HasSwitch(switches::kEnableAcceleratedVideoDecode) && +#else !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) && +#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) (gpu_channel_host->gpu_feature_info() .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] == gpu::kGpuFeatureStatusEnabled);