Backed out changeset cce59c2a2baa (bug 971528) for crashing in mda tests, e.g. dom/media/tests/mochitest/identity/test_peerConnection_asymmetricIsolation.html. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 24 Apr 2017 19:11:46 +0200
changeset 354561 f5c43a9f8510ad50cf45248fe306707aa059b991
parent 354560 f61b1bc0bee770b16ec3dac814ebd088d6044c5a
child 354562 e05f84ea2a338e172a55a0898e3551fff61abb0a
push id41367
push userarchaeopteryx@coole-files.de
push dateMon, 24 Apr 2017 17:12:01 +0000
treeherderautoland@f5c43a9f8510 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs971528
milestone55.0a1
backs outcce59c2a2baaa332ea51f6f92a6a71f2bb52b58c
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
Backed out changeset cce59c2a2baa (bug 971528) for crashing in mda tests, e.g. dom/media/tests/mochitest/identity/test_peerConnection_asymmetricIsolation.html. r=backout
dom/media/GraphDriver.cpp
dom/media/webrtc/MediaEngineWebRTC.h
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -657,29 +657,20 @@ AudioCallbackDriver::Init()
   }
 
   // Macbook and MacBook air don't have enough CPU to run very low latency
   // MediaStreamGraphs, cap the minimal latency to 512 frames int this case.
   if (IsMacbookOrMacbookAir()) {
     latency_frames = std::max((uint32_t) 512, latency_frames);
   }
 
+
   input = output;
-  input.channels = mInputChannels;
-  input.layout = CUBEB_LAYOUT_UNDEFINED;
-
-#ifdef MOZ_WEBRTC
-  if (mGraphImpl->mInputWanted) {
-    StaticMutexAutoLock lock(AudioInputCubeb::Mutex());
-    uint32_t maxInputChannels = 0;
-    if (AudioInputCubeb::GetDeviceMaxChannels(mGraphImpl->mInputDeviceID, maxInputChannels) == 0) {
-      input.channels = mInputChannels = maxInputChannels;
-    }
-  }
-#endif
+  input.channels = mInputChannels; // change to support optional stereo capture
+  input.layout = CUBEB_LAYOUT_MONO;
 
   cubeb_stream* stream = nullptr;
   CubebUtils::AudioDeviceID input_id = nullptr, output_id = nullptr;
   // We have to translate the deviceID values to cubeb devid's since those can be
   // freed whenever enumerate is called.
   {
 #ifdef MOZ_WEBRTC
     StaticMutexAutoLock lock(AudioInputCubeb::Mutex());
--- a/dom/media/webrtc/MediaEngineWebRTC.h
+++ b/dom/media/webrtc/MediaEngineWebRTC.h
@@ -207,17 +207,16 @@ public:
     // -1 = system default if any
     if (aIndex == -1) {
       if (mDefaultDevice == -1) {
         aIndex = 0;
       } else {
         aIndex = mDefaultDevice;
       }
     }
-    MOZ_ASSERT(mDeviceIndexes);
     if (aIndex < 0 || aIndex >= (int) mDeviceIndexes->Length()) {
       return -1;
     }
     // Note: if the device is gone, this will be -1
     return (*mDeviceIndexes)[aIndex]; // translate to mDevices index
   }
 
   static StaticMutex& Mutex()
@@ -263,30 +262,16 @@ public:
   int GetRecordingDeviceStatus(bool& aIsAvailable)
   {
     // With cubeb, we only expose devices of type CUBEB_DEVICE_TYPE_INPUT,
     // so unless it was removed, say it's available
     aIsAvailable = true;
     return 0;
   }
 
-  static int GetDeviceMaxChannels(int aDeviceIndex, uint32_t& aChannels)
-  {
-#ifdef MOZ_WIDGET_ANDROID
-    aChannels = 1;
-#else
-    int32_t devindex = DeviceIndex(aDeviceIndex);
-    if (!mDevices || devindex < 0) {
-      return 1;
-    }
-    aChannels = mDevices->device[devindex]->max_channels;
-#endif
-    return 0;
-  }
-
   void StartRecording(SourceMediaStream *aStream, AudioDataListener *aListener)
   {
 #ifdef MOZ_WIDGET_ANDROID
     // OpenSL ES does not support enumerating devices.
     MOZ_ASSERT(!mDevices);
 #else
     MOZ_ASSERT(mDevices);
 #endif