Bug 1037000: Include "default communications device" in the audio input enumeration for gUM r=padenot
authorRandell Jesup <rjesup@jesup.org>
Thu, 10 Jul 2014 13:15:26 -0400
changeset 193407 f2e5fb7f242cc39c3bc6da568567489673ff9cf0
parent 193406 bb54fa82e9d2740bfaaa5dc9f1c093d43ee5df4a
child 193408 315da0e3c1b499d2dc6c5c3f5f598bc83e9c98dc
push id27117
push userryanvm@gmail.com
push dateThu, 10 Jul 2014 22:23:14 +0000
treeherdermozilla-central@e1a037c085d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1037000
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1037000: Include "default communications device" in the audio input enumeration for gUM r=padenot
content/media/webrtc/MediaEngineWebRTC.cpp
--- a/content/media/webrtc/MediaEngineWebRTC.cpp
+++ b/content/media/webrtc/MediaEngineWebRTC.cpp
@@ -262,17 +262,24 @@ MediaEngineWebRTC::EnumerateAudioDevices
 
   ptrVoEHw = webrtc::VoEHardware::GetInterface(mVoiceEngine);
   if (!ptrVoEHw)  {
     return;
   }
 
   int nDevices = 0;
   ptrVoEHw->GetNumOfRecordingDevices(nDevices);
-  for (int i = 0; i < nDevices; i++) {
+  int i;
+#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+  i = 0; // Bug 1037025 - let the OS handle defaulting for now on android/b2g
+#else
+  // -1 is "default communications device" depending on OS in webrtc.org code
+  i = -1;
+#endif
+  for (; i < nDevices; i++) {
     // We use constants here because GetRecordingDeviceName takes char[128].
     char deviceName[128];
     char uniqueId[128];
     // paranoia; jingle doesn't bother with this
     deviceName[0] = '\0';
     uniqueId[0] = '\0';
 
     int error = ptrVoEHw->GetRecordingDeviceName(i, deviceName, uniqueId);