Skip to content

Commit

Permalink
Backout 40f09f7bc670 & fc262e3c635f (bug 818670) for frequent fedora6…
Browse files Browse the repository at this point in the history
…4 mochitest-3 leaks on a CLOSED TREE
  • Loading branch information
Ed Morley committed Jan 30, 2013
1 parent 8195c3a commit 58ea6b3
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 395 deletions.
5 changes: 0 additions & 5 deletions content/media/webrtc/MediaEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ class MediaEngineSource : public nsISupports
/* Stop the device and release the corresponding MediaStream */
virtual nsresult Stop(SourceMediaStream *aSource, TrackID aID) = 0;

/* Change device configuration. */
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) = 0;

/* Return false if device is currently allocated or started */
bool IsAvailable() {
if (mState == kAllocated || mState == kStarted) {
Expand Down
6 changes: 0 additions & 6 deletions content/media/webrtc/MediaEngineDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class MediaEngineDefaultVideoSource : public nsITimerCallback,
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
Expand Down Expand Up @@ -89,9 +86,6 @@ class MediaEngineDefaultAudioSource : public nsITimerCallback,
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
Expand Down
18 changes: 0 additions & 18 deletions content/media/webrtc/MediaEngineWebRTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "voice_engine/include/voe_audio_processing.h"
#include "voice_engine/include/voe_volume_control.h"
#include "voice_engine/include/voe_external_media.h"
#include "voice_engine/include/voe_audio_processing.h"

// Video Engine
#include "video_engine/include/vie_base.h"
Expand Down Expand Up @@ -91,9 +90,6 @@ class MediaEngineWebRTCVideoSource : public MediaEngineVideoSource,
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
TrackID aId,
Expand Down Expand Up @@ -181,10 +177,6 @@ class MediaEngineWebRTCAudioSource : public MediaEngineAudioSource,
, mCapIndex(aIndex)
, mChannel(-1)
, mInitDone(false)
, mEchoOn(false), mAgcOn(false), mNoiseOn(false)
, mEchoCancel(webrtc::kEcDefault)
, mAGC(webrtc::kAgcDefault)
, mNoiseSuppress(webrtc::kNsDefault)
, mNullTransport(nullptr) {
MOZ_ASSERT(aVoiceEnginePtr);
mState = kReleased;
Expand All @@ -202,10 +194,6 @@ class MediaEngineWebRTCAudioSource : public MediaEngineAudioSource,
virtual nsresult Start(SourceMediaStream*, TrackID);
virtual nsresult Stop(SourceMediaStream*, TrackID);
virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise);

virtual void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream *aSource,
TrackID aId,
Expand All @@ -230,7 +218,6 @@ class MediaEngineWebRTCAudioSource : public MediaEngineAudioSource,
webrtc::VoEBase* mVoEBase;
webrtc::VoEExternalMedia* mVoERender;
webrtc::VoENetwork* mVoENetwork;
webrtc::VoEAudioProcessing *mVoEProcessing;

// mMonitor protects mSources[] access/changes, and transitions of mState
// from kStarted to kStopped (which are combined with EndTrack()).
Expand All @@ -246,11 +233,6 @@ class MediaEngineWebRTCAudioSource : public MediaEngineAudioSource,
nsString mDeviceName;
nsString mDeviceUUID;

bool mEchoOn, mAgcOn, mNoiseOn;
webrtc::EcModes mEchoCancel;
webrtc::AgcModes mAGC;
webrtc::NsModes mNoiseSuppress;

NullTransport *mNullTransport;
};

Expand Down
64 changes: 0 additions & 64 deletions content/media/webrtc/MediaEngineWebRTCAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,60 +46,6 @@ MediaEngineWebRTCAudioSource::GetUUID(nsAString& aUUID)
return;
}

nsresult
MediaEngineWebRTCAudioSource::Config(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise)
{
LOG(("Audio config: aec: %d, agc: %d, noise: %d",
aEchoOn ? aEcho : -1,
aAgcOn ? aAGC : -1,
aNoiseOn ? aNoise : -1));

bool update_agc = (mAgcOn == aAgcOn);
bool update_noise = (mNoiseOn == aNoiseOn);
mAgcOn = aAgcOn;
mNoiseOn = aNoiseOn;

if ((webrtc::AgcModes) aAGC != webrtc::kAgcUnchanged) {
if (mAGC != (webrtc::AgcModes) aAGC) {
update_agc = true;
mAGC = (webrtc::AgcModes) aAGC;
}
}
if ((webrtc::NsModes) aNoise != webrtc::kNsUnchanged) {
if (mNoiseSuppress != (webrtc::NsModes) aNoise) {
update_noise = true;
mNoiseSuppress = (webrtc::NsModes) aNoise;
}
}

if (mInitDone) {
int error;
#if 0
// Until we can support feeding our full output audio from the browser
// through the MediaStream, this won't work. Or we need to move AEC to
// below audio input and output, perhaps invoked from here.
mEchoOn = aEchoOn;
if ((webrtc::EcModes) aEcho != webrtc::kEcUnchanged)
mEchoCancel = (webrtc::EcModes) aEcho;
mVoEProcessing->SetEcStatus(mEchoOn, aEcho);
#else
(void) aEcho; (void) aEchoOn; // suppress warnings
#endif

if (update_agc &&
0 != (error = mVoEProcessing->SetAgcStatus(mAgcOn, (webrtc::AgcModes) aAGC))) {
LOG(("%s Error setting AGC Status: %d ",__FUNCTION__, error));
}
if (update_noise &&
0 != (error = mVoEProcessing->SetNsStatus(mNoiseOn, (webrtc::NsModes) aNoise))) {
LOG(("%s Error setting NoiseSuppression Status: %d ",__FUNCTION__, error));
}
}
return NS_OK;
}

nsresult
MediaEngineWebRTCAudioSource::Allocate()
{
Expand Down Expand Up @@ -160,11 +106,6 @@ MediaEngineWebRTCAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
}
mState = kStarted;

// Configure audio processing in webrtc code
Config(mEchoOn, webrtc::kEcUnchanged,
mAgcOn, webrtc::kAgcUnchanged,
mNoiseOn, webrtc::kNsUnchanged);

if (mVoEBase->StartReceive(mChannel)) {
return NS_ERROR_FAILURE;
}
Expand Down Expand Up @@ -251,11 +192,6 @@ MediaEngineWebRTCAudioSource::Init()
return;
}

mVoEProcessing = webrtc::VoEAudioProcessing::GetInterface(mVoiceEngine);
if (!mVoEProcessing) {
return;
}

mChannel = mVoEBase->CreateChannel();
if (mChannel < 0) {
return;
Expand Down
29 changes: 0 additions & 29 deletions dom/media/MediaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "nsIScriptGlobalObject.h"
#include "nsIPopupWindowManager.h"
#include "nsISupportsArray.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"

// For PR_snprintf
#include "prprf.h"
Expand Down Expand Up @@ -384,33 +382,6 @@ class GetUserMediaStreamRunnable : public nsRunnable
mAudioSource, mVideoSource, false));
mediaThread->Dispatch(runnable, NS_DISPATCH_NORMAL);

#ifdef MOZ_WEBRTC
// Right now these configs are only of use if webrtc is available
nsresult rv;
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);

if (branch) {
int32_t aec = (int32_t) webrtc::kEcUnchanged;
int32_t agc = (int32_t) webrtc::kAgcUnchanged;
int32_t noise = (int32_t) webrtc::kNsUnchanged;
bool aec_on = false, agc_on = false, noise_on = false;

branch->GetBoolPref("media.peerconnection.aec_enabled", &aec_on);
branch->GetIntPref("media.peerconnection.aec", &aec);
branch->GetBoolPref("media.peerconnection.agc_enabled", &agc_on);
branch->GetIntPref("media.peerconnection.agc", &agc);
branch->GetBoolPref("media.peerconnection.noise_enabled", &noise_on);
branch->GetIntPref("media.peerconnection.noise", &noise);

mListener->AudioConfig(aec_on, (uint32_t) aec,
agc_on, (uint32_t) agc,
noise_on, (uint32_t) noise);
}
}
#endif

// We're in the main thread, so no worries here either.
nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> success(mSuccess);
nsCOMPtr<nsIDOMGetUserMediaErrorCallback> error(mError);
Expand Down
21 changes: 0 additions & 21 deletions dom/media/MediaManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include "mozilla/StaticPtr.h"
#include "prlog.h"

#ifdef MOZ_WEBRTC
#include "mtransport/runnable_utils.h"
#endif

namespace mozilla {

#ifdef PR_LOGGING
Expand Down Expand Up @@ -132,23 +128,6 @@ class GetUserMediaCallbackMediaStreamListener : public MediaStreamListener
// Can be invoked from EITHER MainThread or MSG thread
void Invalidate();

void
AudioConfig(bool aEchoOn, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise)
{
if (mAudioSource) {
#ifdef MOZ_WEBRTC
// Right now these configs are only of use if webrtc is available
RUN_ON_THREAD(mMediaThread,
WrapRunnable(nsRefPtr<MediaEngineSource>(mAudioSource), // threadsafe
&MediaEngineSource::Config,
aEchoOn, aEcho, aAgcOn, aAGC, aNoiseOn, aNoise),
NS_DISPATCH_NORMAL);
#endif
}
}

void
Remove()
{
Expand Down
1 change: 0 additions & 1 deletion media/mtransport/build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ EXPORTS_mtransport = \
../transportlayerprsock.h \
../m_cpp_utils.h \
../runnable_utils.h \
../runnable_utils_generated.h \
../sigslot.h \
$(NULL)

Expand Down
Loading

0 comments on commit 58ea6b3

Please sign in to comment.