Backed out changeset 53f96832a304 (bug 1264195) for building halting with error "GraphDriver.h:536:8: error: private field 'mMicrophoneActive' is not used". r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Apr 2016 20:44:52 +0200
changeset 330965 af97159979d24895030137be678cbfd5beea681c
parent 330964 53f96832a304865e2416b703bdd507f1d90efe24
child 330966 1442d37b64495edacde3e4e0aba8e6e627adb966
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1264195
milestone48.0a1
backs out53f96832a304865e2416b703bdd507f1d90efe24
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 53f96832a304 (bug 1264195) for building halting with error "GraphDriver.h:536:8: error: private field 'mMicrophoneActive' is not used". r=backout on a CLOSED TREE
dom/media/GraphDriver.cpp
dom/media/MediaStreamGraph.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -655,23 +655,16 @@ AudioCallbackDriver::Init()
       MonitorAutoLock lock(GraphImpl()->GetMonitor());
       SetNextDriver(new SystemClockDriver(GraphImpl()));
       NextDriver()->SetGraphTime(this, mIterationStart, mIterationEnd);
       mGraphImpl->SetCurrentDriver(NextDriver());
       NextDriver()->Start();
       return;
     }
   }
-#ifdef XP_MACOSX
-  // Currently, only mac cares about this
-  bool aec;
-  Unused << mGraphImpl->AudioTrackPresent(aec);
-  SetMicrophoneActive(aec);
-#endif
-
   cubeb_stream_register_device_changed_callback(mAudioStream,
                                                 AudioCallbackDriver::DeviceChangedCallback_s);
 
   StartStream();
 
   STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver started."));
 }
 
@@ -1065,26 +1058,25 @@ void AudioCallbackDriver::PanOutputIfNee
       cubeb_stream_device_destroy(mAudioStream, out);
     }
   }
 #endif
 }
 
 void
 AudioCallbackDriver::DeviceChangedCallback() {
-#ifdef XP_MACOSX
   MonitorAutoLock mon(mGraphImpl->GetMonitor());
   PanOutputIfNeeded(mMicrophoneActive);
   // On OSX, changing the output device causes the audio thread to no call the
   // audio callback, so we're unable to process real-time input data, and this
   // results in latency building up.
   // We switch to a system driver until audio callbacks are called again, so we
   // still pull from the input stream, so that everything works apart from the
   // audio output.
-
+#ifdef XP_MACOSX
   // Don't bother doing the device switching dance if the graph is not RUNNING
   // (starting up, shutting down), because we haven't started pulling from the
   // SourceMediaStream.
   if (!GraphImpl()->Running()) {
     return;
   }
 
   if (mSelfReference) {
@@ -1099,23 +1091,21 @@ AudioCallbackDriver::DeviceChangedCallba
   mGraphImpl->SetCurrentDriver(mNextDriver);
   mNextDriver->Start();
 #endif
 }
 
 void
 AudioCallbackDriver::SetMicrophoneActive(bool aActive)
 {
-#ifdef XP_MACOSX
   MonitorAutoLock mon(mGraphImpl->GetMonitor());
 
   mMicrophoneActive = aActive;
 
   PanOutputIfNeeded(mMicrophoneActive);
-#endif
 }
 
 uint32_t
 AudioCallbackDriver::IterationDuration()
 {
   // The real fix would be to have an API in cubeb to give us the number. Short
   // of that, we approximate it here. bug 1019507
   return mIterationDurationMS;
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -415,18 +415,16 @@ namespace {
   const uint32_t NOT_VISITED = UINT32_MAX;
   // Value of mCycleMarker for ordered streams in muted cycles.
   const uint32_t IN_MUTED_CYCLE = 1;
 } // namespace
 
 bool
 MediaStreamGraphImpl::AudioTrackPresent(bool& aNeedsAEC)
 {
-  AssertOnGraphThreadOrNotRunning();
-
   bool audioTrackPresent = false;
   for (uint32_t i = 0; i < mStreams.Length() && audioTrackPresent == false; ++i) {
     MediaStream* stream = mStreams[i];
     SourceMediaStream* source = stream->AsSourceStream();
 #ifdef MOZ_WEBRTC
     if (source && source->NeedsMixing()) {
       aNeedsAEC = true;
     }
@@ -498,31 +496,23 @@ MediaStreamGraphImpl::UpdateStreamOrder(
     MonitorAutoLock mon(mMonitor);
     if (mLifecycleState == LIFECYCLE_RUNNING) {
       AudioCallbackDriver* driver = new AudioCallbackDriver(this);
       CurrentDriver()->SwitchAtNextIteration(driver);
     }
   }
 
 #ifdef MOZ_WEBRTC
-  // Whenever we change AEC state, notify the current driver, which also
-  // will sample the state when the driver inits
   if (shouldAEC && !mFarendObserverRef && gFarendObserver) {
     mFarendObserverRef = gFarendObserver;
     mMixer.AddCallback(mFarendObserverRef);
-    if (CurrentDriver()->AsAudioCallbackDriver()) {
-      CurrentDriver()->AsAudioCallbackDriver()->SetMicrophoneActive(true);
-    }
   } else if (!shouldAEC && mFarendObserverRef){
     if (mMixer.FindCallback(mFarendObserverRef)) {
       mMixer.RemoveCallback(mFarendObserverRef);
       mFarendObserverRef = nullptr;
-      if (CurrentDriver()->AsAudioCallbackDriver()) {
-        CurrentDriver()->AsAudioCallbackDriver()->SetMicrophoneActive(false);
-      }
     }
   }
 #endif
 
   if (!mStreamOrderDirty) {
     return;
   }