summaryrefslogtreecommitdiffstats
path: root/media/base/media_switches.cc
diff options
context:
space:
mode:
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 02:36:53 +0000
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-05 02:36:53 +0000
commit0963ed0baeba491e4099e180a5107b5cd26cd699 (patch)
treeb96c39372ea502ae8fb6701f9b6d601b933dda55 /media/base/media_switches.cc
parent0273b0615b4cdb87d6164e461c0c62c601849f37 (diff)
downloadchromium_src-0963ed0baeba491e4099e180a5107b5cd26cd699.zip
chromium_src-0963ed0baeba491e4099e180a5107b5cd26cd699.tar.gz
chromium_src-0963ed0baeba491e4099e180a5107b5cd26cd699.tar.bz2
Use the browser UI thread for audio on OSX.
After months of attempted workarounds, there appears no avenue left except to move CoreAudio calls onto the main thread. Sadly that turns out to be the UI thread. This CL swaps the message loop normally used by AudioManagerBase with a pointer to the message loop on which the audio manager is created (the UI loop in Chrome). The audio thread used by Chrome is spun up on demand if a class asks for it. Currently only Tab Audio capture will use this thread. BUG=158170 TEST=No more crashes. miu manually tested tab capture. Review URL: https://chromiumcodereview.appspot.com/14273018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/media_switches.cc')
-rw-r--r--media/base/media_switches.cc68
1 files changed, 37 insertions, 31 deletions
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index ad03556..98c0279 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -9,57 +9,63 @@ namespace switches {
// Allow users to specify a custom buffer size for debugging purpose.
const char kAudioBufferSize[] = "audio-buffer-size";
+// Enable EAC3 playback in MSE.
+const char kEnableEac3Playback[] = "enable-eac3-playback";
+
+// Enables Opus playback in media elements.
+const char kEnableOpusPlayback[] = "enable-opus-playback";
+
+// Enables VP8 Alpha playback in media elements.
+const char kEnableVp8AlphaPlayback[] = "enable-vp8-alpha-playback";
+
+// Enables VP9 playback in media elements.
+const char kEnableVp9Playback[] = "enable-vp9-playback";
+
+// Set number of threads to use for video decoding.
+const char kVideoThreads[] = "video-threads";
+
+#if defined(GOOGLE_TV)
+// Use external video surface for video with more than or equal pixels to
+// specified value. For example, value of 0 will enable external video surface
+// for all videos, and value of 921600 (=1280*720) will enable external video
+// surface for 720p video and larger.
+const char kUseExternalVideoSurfaceThresholdInPixels[] =
+ "use-external-video-surface-threshold-in-pixels";
+#endif
+
#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_SOLARIS)
-// The Alsa device to use when opening an audio stream.
-const char kAlsaOutputDevice[] = "alsa-output-device";
// The Alsa device to use when opening an audio input stream.
const char kAlsaInputDevice[] = "alsa-input-device";
+// The Alsa device to use when opening an audio stream.
+const char kAlsaOutputDevice[] = "alsa-output-device";
#endif
-#if defined(USE_CRAS)
-// Use CRAS, the ChromeOS audio server.
-const char kUseCras[] = "use-cras";
+#if defined(OS_MACOSX)
+// Unlike other platforms, OSX requires CoreAudio calls to happen on the main
+// thread of the process. Provide a way to disable this until support is well
+// tested. See http://crbug.com/158170.
+// TODO(dalecurtis): Remove this once we're sure nothing has exploded.
+const char kDisableMainThreadAudio[] = "disable-main-thread-audio";
#endif
#if defined(OS_WIN)
// Use exclusive mode audio streaming for Windows Vista and higher.
// Leads to lower latencies for audio streams which uses the
// AudioParameters::AUDIO_PCM_LOW_LATENCY audio path.
-// See http://msdn.microsoft.com/en-us/library/windows/desktop/dd370844(v=vs.85).aspx
+// See http://msdn.microsoft.com/en-us/library/windows/desktop/dd370844.aspx
// for details.
const char kEnableExclusiveAudio[] = "enable-exclusive-audio";
// Use Windows WaveOut/In audio API even if Core Audio is supported.
const char kForceWaveAudio[] = "force-wave-audio";
-#endif
-
-// Set number of threads to use for video decoding.
-const char kVideoThreads[] = "video-threads";
-
-// Enables Opus playback in media elements.
-const char kEnableOpusPlayback[] = "enable-opus-playback";
-// Enables VP9 playback in media elements.
-const char kEnableVp9Playback[] = "enable-vp9-playback";
-
-// Enables VP8 Alpha playback in media elements.
-const char kEnableVp8AlphaPlayback[] = "enable-vp8-alpha-playback";
-
-// Enable EAC3 playback in MSE.
-const char kEnableEac3Playback[] = "enable-eac3-playback";
-
-#if defined(OS_WIN)
+// Number of buffers to use for WaveOut.
const char kWaveOutBuffers[] = "waveout-buffers";
#endif
-#if defined(GOOGLE_TV)
-// Use external video surface for video with more than or equal pixels to
-// specified value. For example, value of 0 will enable external video surface
-// for all videos, and value of 921600 (=1280*720) will enable external video
-// surface for 720p video and larger.
-const char kUseExternalVideoSurfaceThresholdInPixels[] =
- "use-external-video-surface-threshold-in-pixels";
+#if defined(USE_CRAS)
+// Use CRAS, the ChromeOS audio server.
+const char kUseCras[] = "use-cras";
#endif
-
} // namespace switches