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 316868 af97159979d24895030137be678cbfd5beea681c
parent 316867 53f96832a304865e2416b703bdd507f1d90efe24
child 316869 1442d37b64495edacde3e4e0aba8e6e627adb966
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1264195
milestone48.0a1
backs out53f96832a304865e2416b703bdd507f1d90efe24
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;
   }