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

Side by Side Diff: media/base/media_switches.cc

Issue 2837023002: Create autoplay policy flag and merge cross-origin autoplay blocking into it. (Closed)
Patch Set: Created 3 years, 8 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 (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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "media/base/media_switches.h" 6 #include "media/base/media_switches.h"
7 #include "ppapi/features/features.h" 7 #include "ppapi/features/features.h"
8 8
9 namespace switches { 9 namespace switches {
10 10
11 // Allow users to specify a custom buffer size for debugging purpose. 11 // Allow users to specify a custom buffer size for debugging purpose.
12 const char kAudioBufferSize[] = "audio-buffer-size"; 12 const char kAudioBufferSize[] = "audio-buffer-size";
13 13
14 // Command line flag name to set the autoplay policy.
15 const char kAutoplayPolicy[] = "autoplay-policy";
16
14 // Set number of threads to use for video decoding. 17 // Set number of threads to use for video decoding.
15 const char kVideoThreads[] = "video-threads"; 18 const char kVideoThreads[] = "video-threads";
16 19
17 // Suspend media pipeline on background tabs. 20 // Suspend media pipeline on background tabs.
18 const char kEnableMediaSuspend[] = "enable-media-suspend"; 21 const char kEnableMediaSuspend[] = "enable-media-suspend";
19 const char kDisableMediaSuspend[] = "disable-media-suspend"; 22 const char kDisableMediaSuspend[] = "disable-media-suspend";
20 23
21 // Force to report VP9 as an unsupported MIME type. 24 // Force to report VP9 as an unsupported MIME type.
22 const char kReportVp9AsAnUnsupportedMimeType[] = 25 const char kReportVp9AsAnUnsupportedMimeType[] =
23 "report-vp9-as-an-unsupported-mime-type"; 26 "report-vp9-as-an-unsupported-mime-type";
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const char kEnableVp9InMp4[] = "enable-vp9-in-mp4"; 131 const char kEnableVp9InMp4[] = "enable-vp9-in-mp4";
129 132
130 // Force media player using SurfaceView instead of SurfaceTexture on Android. 133 // Force media player using SurfaceView instead of SurfaceTexture on Android.
131 const char kForceVideoOverlays[] = "force-video-overlays"; 134 const char kForceVideoOverlays[] = "force-video-overlays";
132 135
133 // Allows explicitly specifying MSE audio/video buffer sizes. 136 // Allows explicitly specifying MSE audio/video buffer sizes.
134 // Default values are 150M for video and 12M for audio. 137 // Default values are 150M for video and 12M for audio.
135 const char kMSEAudioBufferSizeLimit[] = "mse-audio-buffer-size-limit"; 138 const char kMSEAudioBufferSizeLimit[] = "mse-audio-buffer-size-limit";
136 const char kMSEVideoBufferSizeLimit[] = "mse-video-buffer-size-limit"; 139 const char kMSEVideoBufferSizeLimit[] = "mse-video-buffer-size-limit";
137 140
141 namespace autoplay {
142
143 // Autoplay policy to require a user gesture in ordor to play for cross origin
Alexei Svitkine (slow) 2017/04/24 18:45:07 order
144 // iframes.
145 const char kCrossOriginUserGestureRequiredPolicy[] =
146 "cross-origin-user-gesture-required";
147
148 // Autoplay policy to require a user gesture in order to play.
149 const char kUserGestureRequiredPolicy[] = "user-gesture-required";
150
151 // No autoplay policy.
152 const char kNoRestrictionsPolicy[] = "none";
153
154 } // namespace autoplay
155
138 } // namespace switches 156 } // namespace switches
139 157
140 namespace media { 158 namespace media {
141 159
142 #if defined(OS_WIN)
143 // Enables video decode acceleration using the D3D11 video decoder api.
144 // This is completely insecure - DO NOT USE except for testing.
145 const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding",
146 base::FEATURE_DISABLED_BY_DEFAULT};
147
148 // Enables H264 HW encode acceleration using Media Foundation for Windows.
149 const base::Feature kMediaFoundationH264Encoding{
150 "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
151 #endif // defined(OS_WIN)
152
153 // Use new audio rendering mixer. 160 // Use new audio rendering mixer.
154 const base::Feature kNewAudioRenderingMixingStrategy{ 161 const base::Feature kNewAudioRenderingMixingStrategy{
155 "NewAudioRenderingMixingStrategy", base::FEATURE_DISABLED_BY_DEFAULT}; 162 "NewAudioRenderingMixingStrategy", base::FEATURE_DISABLED_BY_DEFAULT};
156 163
157 // Only used for disabling overlay fullscreen (aka SurfaceView) in Clank. 164 // Only used for disabling overlay fullscreen (aka SurfaceView) in Clank.
158 const base::Feature kOverlayFullscreenVideo{"overlay-fullscreen-video", 165 const base::Feature kOverlayFullscreenVideo{"overlay-fullscreen-video",
159 base::FEATURE_ENABLED_BY_DEFAULT}; 166 base::FEATURE_ENABLED_BY_DEFAULT};
160 167
161 // Let videos be resumed via remote controls (for example, the notification) 168 // Let videos be resumed via remote controls (for example, the notification)
162 // when in background. 169 // when in background.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 "VideoFullscreenOrientationLock", base::FEATURE_ENABLED_BY_DEFAULT}; 214 "VideoFullscreenOrientationLock", base::FEATURE_ENABLED_BY_DEFAULT};
208 215
209 // An experimental feature to enable persistent-license type support in MediaDrm 216 // An experimental feature to enable persistent-license type support in MediaDrm
210 // when using Encrypted Media Extensions (EME) API. 217 // when using Encrypted Media Extensions (EME) API.
211 // TODO(xhwang): Remove this after feature launch. See http://crbug.com/493521 218 // TODO(xhwang): Remove this after feature launch. See http://crbug.com/493521
212 const base::Feature kMediaDrmPersistentLicense{ 219 const base::Feature kMediaDrmPersistentLicense{
213 "MediaDrmPersistentLicense", base::FEATURE_DISABLED_BY_DEFAULT}; 220 "MediaDrmPersistentLicense", base::FEATURE_DISABLED_BY_DEFAULT};
214 221
215 #endif 222 #endif
216 223
224 #if defined(OS_WIN)
225 // Enables video decode acceleration using the D3D11 video decoder api.
226 // This is completely insecure - DO NOT USE except for testing.
227 const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding",
228 base::FEATURE_DISABLED_BY_DEFAULT};
229
230 // Enables H264 HW encode acceleration using Media Foundation for Windows.
231 const base::Feature kMediaFoundationH264Encoding{
232 "MediaFoundationH264Encoding", base::FEATURE_ENABLED_BY_DEFAULT};
233 #endif // defined(OS_WIN)
234
217 } // namespace media 235 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698