Bug 1275703: remove saved state about configuration of the VoiceEngine r=jib
authorRandell Jesup <rjesup@jesup.org>
Wed, 25 May 2016 17:35:06 -0400
changeset 338042 eff54d521d78abcacfbd8426ccb9cc71b0182ce5
parent 338041 42a7a846a11b395b5228d0c5ca1b331d1f62fdb2
child 338043 3b6fb13e56de5ad9a53cda7209e22eb1c51451bb
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1275703
milestone49.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 1275703: remove saved state about configuration of the VoiceEngine r=jib MozReview-Commit-ID: LLexZdEuqo
dom/media/webrtc/MediaEngineWebRTC.h
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTC.h
+++ b/dom/media/webrtc/MediaEngineWebRTC.h
@@ -427,20 +427,16 @@ public:
     , mAudioInput(aAudioInput)
     , mMonitor("WebRTCMic.Monitor")
     , mThread(aThread)
     , mCapIndex(aIndex)
     , mChannel(-1)
     , mNrAllocations(0)
     , mStarted(false)
     , mSampleFrequency(MediaEngine::DEFAULT_SAMPLE_RATE)
-    , mEchoOn(false), mAgcOn(false), mNoiseOn(false)
-    , mEchoCancel(webrtc::kEcDefault)
-    , mAGC(webrtc::kAgcDefault)
-    , mNoiseSuppress(webrtc::kNsDefault)
     , mPlayoutDelay(0)
     , mNullTransport(nullptr)
     , mInputBufferLen(0) {
     MOZ_ASSERT(aVoiceEnginePtr);
     MOZ_ASSERT(aAudioInput);
     mDeviceName.Assign(NS_ConvertUTF8toUTF16(name));
     mDeviceUUID.Assign(uuid);
     mListener = new mozilla::WebRTCAudioDataListener(this);
@@ -549,20 +545,16 @@ private:
   int mNrAllocations; // Per-channel - When this becomes 0, we shut down HW for the channel
   TrackID mTrackID;
   bool mStarted;
 
   nsString mDeviceName;
   nsCString mDeviceUUID;
 
   uint32_t mSampleFrequency;
-  bool mEchoOn, mAgcOn, mNoiseOn;
-  webrtc::EcModes  mEchoCancel;
-  webrtc::AgcModes mAGC;
-  webrtc::NsModes  mNoiseSuppress;
   int32_t mPlayoutDelay;
 
   NullTransport *mNullTransport;
 
   // For full_duplex packetizer output
   size_t mInputBufferLen;
   UniquePtr<int16_t[]> mInputBuffer;
 };
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -272,62 +272,34 @@ MediaEngineWebRTCMicrophoneSource::Resta
   bool noise_on = c.mMozNoiseSuppression.Get(aPrefs.mNoiseOn);
 
   LOG(("Audio config: aec: %d, agc: %d, noise: %d, delay: %d",
        aec_on ? aPrefs.mAec : -1,
        agc_on ? aPrefs.mAgc : -1,
        noise_on ? aPrefs.mNoise : -1,
        aPrefs.mPlayoutDelay));
 
-  bool update_echo = (mEchoOn != aec_on);
-  bool update_agc = (mAgcOn != agc_on);
-  bool update_noise = (mNoiseOn != noise_on);
-  mEchoOn = aec_on;
-  mAgcOn = agc_on;
-  mNoiseOn = noise_on;
-
   mPlayoutDelay = aPrefs.mPlayoutDelay;
-  if ((webrtc::EcModes) aPrefs.mAec != webrtc::kEcUnchanged) {
-    if (mEchoCancel != (webrtc::EcModes) aPrefs.mAec) {
-      update_echo = true;
-      mEchoCancel = (webrtc::EcModes) aPrefs.mAec;
-    }
-  }
-  if ((webrtc::AgcModes) aPrefs.mAgc != webrtc::kAgcUnchanged) {
-    if (mAGC != (webrtc::AgcModes) aPrefs.mAgc) {
-      update_agc = true;
-      mAGC = (webrtc::AgcModes) aPrefs.mAgc;
-    }
-  }
-  if ((webrtc::NsModes) aPrefs.mNoise != webrtc::kNsUnchanged) {
-    if (mNoiseSuppress != (webrtc::NsModes) aPrefs.mNoise) {
-      update_noise = true;
-      mNoiseSuppress = (webrtc::NsModes) aPrefs.mNoise;
-    }
-  }
 
   if (sChannelsOpen > 0) {
     int error;
 
-    if (update_echo &&
-      0 != (error = mVoEProcessing->SetEcStatus(mEchoOn, (webrtc::EcModes) aPrefs.mAec))) {
+    if (0 != (error = mVoEProcessing->SetEcStatus(aec_on, (webrtc::EcModes) aPrefs.mAec))) {
       LOG(("%s Error setting Echo Status: %d ",__FUNCTION__, error));
       // Overhead of capturing all the time is very low (<0.1% of an audio only call)
-      if (mEchoOn) {
+      if (aec_on) {
         if (0 != (error = mVoEProcessing->SetEcMetricsStatus(true))) {
           LOG(("%s Error setting Echo Metrics: %d ",__FUNCTION__, error));
         }
       }
     }
-    if (update_agc &&
-      0 != (error = mVoEProcessing->SetAgcStatus(mAgcOn, (webrtc::AgcModes) aPrefs.mAgc))) {
+    if (0 != (error = mVoEProcessing->SetAgcStatus(agc_on, (webrtc::AgcModes) aPrefs.mAgc))) {
       LOG(("%s Error setting AGC Status: %d ",__FUNCTION__, error));
     }
-    if (update_noise &&
-      0 != (error = mVoEProcessing->SetNsStatus(mNoiseOn, (webrtc::NsModes) aPrefs.mNoise))) {
+    if (0 != (error = mVoEProcessing->SetNsStatus(noise_on, (webrtc::NsModes) aPrefs.mNoise))) {
       LOG(("%s Error setting NoiseSuppression Status: %d ",__FUNCTION__, error));
     }
   }
   return NS_OK;
 }
 
 nsresult
 MediaEngineWebRTCMicrophoneSource::Deallocate()