Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: content/public/browser/gpu_utils.cc

Issue 2839823002: Android: enable HW encoding (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/public/browser/gpu_utils.h" 5 #include "content/public/browser/gpu_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "content/browser/gpu/gpu_process_host.h" 10 #include "content/browser/gpu/gpu_process_host.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 gpu_preferences.ui_prioritize_in_gpu_process = 56 gpu_preferences.ui_prioritize_in_gpu_process =
57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); 57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
58 gpu_preferences.disable_accelerated_video_decode = 58 gpu_preferences.disable_accelerated_video_decode =
59 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); 59 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
60 #if defined(OS_CHROMEOS) 60 #if defined(OS_CHROMEOS)
61 gpu_preferences.disable_vaapi_accelerated_video_encode = 61 gpu_preferences.disable_vaapi_accelerated_video_encode =
62 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); 62 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
63 #endif 63 #endif
64 #if BUILDFLAG(ENABLE_WEBRTC) 64 #if BUILDFLAG(ENABLE_WEBRTC)
65 gpu_preferences.disable_web_rtc_hw_encoding = 65 gpu_preferences.disable_web_rtc_hw_encoding =
66 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) || 66 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
67 (command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) &&
68 !base::FeatureList::IsEnabled(features::kWebRtcHWH264Encoding));
69 #endif 67 #endif
70 #if defined(OS_WIN) 68 #if defined(OS_WIN)
71 uint32_t enable_accelerated_vpx_decode_val = 69 uint32_t enable_accelerated_vpx_decode_val =
72 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; 70 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT;
73 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode, 71 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode,
74 &enable_accelerated_vpx_decode_val)) { 72 &enable_accelerated_vpx_decode_val)) {
75 gpu_preferences.enable_accelerated_vpx_decode = 73 gpu_preferences.enable_accelerated_vpx_decode =
76 static_cast<gpu::GpuPreferences::VpxDecodeVendors>( 74 static_cast<gpu::GpuPreferences::VpxDecodeVendors>(
77 enable_accelerated_vpx_decode_val); 75 enable_accelerated_vpx_decode_val);
78 } 76 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void StopGpuProcess(const base::Closure& callback) { 133 void StopGpuProcess(const base::Closure& callback) {
136 content::GpuProcessHost::CallOnIO( 134 content::GpuProcessHost::CallOnIO(
137 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, 135 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
138 false /* force_create */, 136 false /* force_create */,
139 base::Bind(&StopGpuProcessImpl, 137 base::Bind(&StopGpuProcessImpl,
140 base::Bind(RunTaskOnTaskRunner, 138 base::Bind(RunTaskOnTaskRunner,
141 base::ThreadTaskRunnerHandle::Get(), callback))); 139 base::ThreadTaskRunnerHandle::Get(), callback)));
142 } 140 }
143 141
144 } // namespace content 142 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698