media_switches.cc revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "media/base/media_switches.h"
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace switches {
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Allow users to specify a custom buffer size for debugging purpose.
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)const char kAudioBufferSize[] = "audio-buffer-size";
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
12868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Enable EAC3 playback in MSE.
13868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kEnableEac3Playback[] = "enable-eac3-playback";
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
15f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Disables Opus playback in media elements.
16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)const char kDisableOpusPlayback[] = "disable-opus-playback";
17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
1858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Disables VP8 Alpha playback in media elements.
1958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)const char kDisableVp8AlphaPlayback[] = "disable-vp8-alpha-playback";
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Set number of threads to use for video decoding.
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kVideoThreads[] = "video-threads";
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
2458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Enables MP3 stream parser for Media Source Extensions.
2558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)const char kEnableMP3StreamParser[] = "enable-mp3-stream-parser";
2658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
2758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#if defined(OS_ANDROID)
2868043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)// Disables the infobar popup for accessing protected media identifier.
2968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)const char kDisableInfobarForProtectedMediaIdentifier[] =
3068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)    "disable-infobar-for-protected-media-identifier";
3168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)
3258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Enables use of non-compositing MediaDrm decoding by default for Encrypted
3358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)// Media Extensions implementation.
3458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)const char kMediaDrmEnableNonCompositing[] = "mediadrm-enable-non-compositing";
3558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#endif
3658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#if defined(GOOGLE_TV)
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Use external video surface for video with more than or equal pixels to
39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// specified value. For example, value of 0 will enable external video surface
40868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// for all videos, and value of 921600 (=1280*720) will enable external video
41868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// surface for 720p video and larger.
42868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kUseExternalVideoSurfaceThresholdInPixels[] =
43868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    "use-external-video-surface-threshold-in-pixels";
44868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#endif
45868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_SOLARIS)
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The Alsa device to use when opening an audio input stream.
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kAlsaInputDevice[] = "alsa-input-device";
49868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// The Alsa device to use when opening an audio stream.
50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kAlsaOutputDevice[] = "alsa-output-device";
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
53868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#if defined(OS_MACOSX)
54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Unlike other platforms, OSX requires CoreAudio calls to happen on the main
55868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// thread of the process.  Provide a way to disable this until support is well
56868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// tested.  See http://crbug.com/158170.
57868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// TODO(dalecurtis): Remove this once we're sure nothing has exploded.
58868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kDisableMainThreadAudio[] = "disable-main-thread-audio";
59a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
60f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// AVFoundation is available in versions 10.7 and onwards, and is to be used
61f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// http://crbug.com/288562 for both audio and video device monitoring and for
62f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// video capture. Being a dynamically loaded NSBundle and library, it hits the
63f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Chrome startup time (http://crbug.com/311325 and http://crbug.com/311437);
64f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// until development is finished and the library load time issue is solved, the
65a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// usage of this library can be disabled by using this flag.
66a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)const char kDisableAVFoundation[] = "disable-avfoundation";
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use exclusive mode audio streaming for Windows Vista and higher.
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Leads to lower latencies for audio streams which uses the
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// AudioParameters::AUDIO_PCM_LOW_LATENCY audio path.
73868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// See http://msdn.microsoft.com/en-us/library/windows/desktop/dd370844.aspx
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// for details.
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)const char kEnableExclusiveAudio[] = "enable-exclusive-audio";
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
77ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch// Used to troubleshoot problems with different video capture implementations
78ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch// on Windows.  By default we use the Media Foundation API on Windows 7 and up,
79ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch// but specifying this switch will force use of DirectShow always.
80ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch// See bug: http://crbug.com/268412
81ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdochconst char kForceDirectShowVideoCapture[] = "force-directshow";
82ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch
83c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Use Windows WaveOut/In audio API even if Core Audio is supported.
84c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)const char kForceWaveAudio[] = "force-wave-audio";
85c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
863551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// Instead of always using the hardware channel layout, check if a driver
873551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// supports the source channel layout.  Avoids outputting empty channels and
883551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// permits drivers to enable stereo to multichannel expansion.  Kept behind a
893551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// flag since some drivers lie about supported layouts and hang when used.  See
903551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)// http://crbug.com/259165 for more details.
913551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)const char kTrySupportedChannelLayouts[] = "try-supported-channel-layouts";
923551c9c881056c480085172ff9840cab31610854Torne (Richard Coles)
93868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Number of buffers to use for WaveOut.
942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)const char kWaveOutBuffers[] = "waveout-buffers";
952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif
962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
97868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#if defined(USE_CRAS)
98868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Use CRAS, the ChromeOS audio server.
99868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const char kUseCras[] = "use-cras";
100b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#endif
101b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
1020f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)// Disables system sounds manager.
1030f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)const char kDisableSystemSoundsManager[] = "disable-system-sounds-manager";
1040f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
105a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Use a raw video file as fake video capture device.
106a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)const char kUseFileForFakeVideoCapture[] = "use-file-for-fake-video-capture";
107a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace switches
109