Backed out changeset 4b22bd7b7a73 (bug 1221587)

--HG--
extra : commitid : K0g4NPkKZW6
This commit is contained in:
Wes Kocher 2016-01-21 17:28:18 -08:00
parent b8d7a67ec2
commit e8203da294
6 changed files with 15 additions and 35 deletions

View File

@ -845,7 +845,6 @@ public:
bool mEchoOn; bool mEchoOn;
bool mAgcOn; bool mAgcOn;
bool mNoiseOn; bool mNoiseOn;
bool mFullDuplex;
uint32_t mEcho; uint32_t mEcho;
uint32_t mAgc; uint32_t mAgc;
uint32_t mNoise; uint32_t mNoise;
@ -1520,7 +1519,6 @@ MediaManager::MediaManager()
mPrefs.mHeight = 0; // adaptive default mPrefs.mHeight = 0; // adaptive default
mPrefs.mFPS = MediaEngine::DEFAULT_VIDEO_FPS; mPrefs.mFPS = MediaEngine::DEFAULT_VIDEO_FPS;
mPrefs.mMinFPS = MediaEngine::DEFAULT_VIDEO_MIN_FPS; mPrefs.mMinFPS = MediaEngine::DEFAULT_VIDEO_MIN_FPS;
mPrefs.mFullDuplex = false;
nsresult rv; nsresult rv;
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv); nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -1529,9 +1527,8 @@ MediaManager::MediaManager()
GetPrefs(branch, nullptr); GetPrefs(branch, nullptr);
} }
} }
LOG(("%s: default prefs: %dx%d @%dfps (min %d), %dHz test tones, %sfull-duplex", __FUNCTION__, LOG(("%s: default prefs: %dx%d @%dfps (min %d), %dHz test tones", __FUNCTION__,
mPrefs.mWidth, mPrefs.mHeight, mPrefs.mFPS, mPrefs.mMinFPS, mPrefs.mFreq, mPrefs.mWidth, mPrefs.mHeight, mPrefs.mFPS, mPrefs.mMinFPS, mPrefs.mFreq));
mPrefs.mFullDuplex ? "" : "not "));
} }
NS_IMPL_ISUPPORTS(MediaManager, nsIMediaManagerService, nsIObserver) NS_IMPL_ISUPPORTS(MediaManager, nsIMediaManagerService, nsIObserver)
@ -1593,8 +1590,6 @@ MediaManager::Get() {
prefs->AddObserver("media.navigator.video.default_height", sSingleton, false); prefs->AddObserver("media.navigator.video.default_height", sSingleton, false);
prefs->AddObserver("media.navigator.video.default_fps", sSingleton, false); prefs->AddObserver("media.navigator.video.default_fps", sSingleton, false);
prefs->AddObserver("media.navigator.video.default_minfps", sSingleton, false); prefs->AddObserver("media.navigator.video.default_minfps", sSingleton, false);
prefs->AddObserver("media.navigator.audio.fake_frequency", sSingleton, false);
prefs->AddObserver("media.navigator.audio.full_duplex", sSingleton, false);
} }
// Prepare async shutdown // Prepare async shutdown
@ -2628,7 +2623,6 @@ MediaManager::GetPrefs(nsIPrefBranch *aBranch, const char *aData)
GetPref(aBranch, "media.navigator.video.default_fps", aData, &mPrefs.mFPS); GetPref(aBranch, "media.navigator.video.default_fps", aData, &mPrefs.mFPS);
GetPref(aBranch, "media.navigator.video.default_minfps", aData, &mPrefs.mMinFPS); GetPref(aBranch, "media.navigator.video.default_minfps", aData, &mPrefs.mMinFPS);
GetPref(aBranch, "media.navigator.audio.fake_frequency", aData, &mPrefs.mFreq); GetPref(aBranch, "media.navigator.audio.fake_frequency", aData, &mPrefs.mFreq);
GetPrefBool(aBranch, "media.navigator.audio.full_duplex", aData, &mPrefs.mFullDuplex);
} }
void void
@ -2655,7 +2649,6 @@ MediaManager::Shutdown()
prefs->RemoveObserver("media.navigator.video.default_fps", this); prefs->RemoveObserver("media.navigator.video.default_fps", this);
prefs->RemoveObserver("media.navigator.video.default_minfps", this); prefs->RemoveObserver("media.navigator.video.default_minfps", this);
prefs->RemoveObserver("media.navigator.audio.fake_frequency", this); prefs->RemoveObserver("media.navigator.audio.fake_frequency", this);
prefs->RemoveObserver("media.navigator.audio.full_duplex", this);
} }
// Close off any remaining active windows. // Close off any remaining active windows.
@ -3129,10 +3122,10 @@ MediaManager::IsActivelyCapturingOrHasAPermission(uint64_t aWindowId)
void void
GetUserMediaCallbackMediaStreamListener::AudioConfig(bool aEchoOn, GetUserMediaCallbackMediaStreamListener::AudioConfig(bool aEchoOn,
uint32_t aEcho, uint32_t aEcho,
bool aAgcOn, uint32_t aAGC, bool aAgcOn, uint32_t aAGC,
bool aNoiseOn, uint32_t aNoise, bool aNoiseOn, uint32_t aNoise,
int32_t aPlayoutDelay) int32_t aPlayoutDelay)
{ {
if (mAudioDevice) { if (mAudioDevice) {
#ifdef MOZ_WEBRTC #ifdef MOZ_WEBRTC

View File

@ -216,7 +216,6 @@ public:
, mFPS(0) , mFPS(0)
, mMinFPS(0) , mMinFPS(0)
, mFreq(0) , mFreq(0)
, mFullDuplex(false)
{} {}
int32_t mWidth; int32_t mWidth;
@ -224,7 +223,6 @@ public:
int32_t mFPS; int32_t mFPS;
int32_t mMinFPS; int32_t mMinFPS;
int32_t mFreq; // for test tones (fake:true) int32_t mFreq; // for test tones (fake:true)
bool mFullDuplex;
// mWidth and/or mHeight may be zero (=adaptive default), so use functions. // mWidth and/or mHeight may be zero (=adaptive default), so use functions.

View File

@ -51,8 +51,7 @@ MediaEngineWebRTC::MediaEngineWebRTC(MediaEnginePrefs &aPrefs)
: mMutex("mozilla::MediaEngineWebRTC"), : mMutex("mozilla::MediaEngineWebRTC"),
mVoiceEngine(nullptr), mVoiceEngine(nullptr),
mAudioInput(nullptr), mAudioInput(nullptr),
mAudioEngineInit(false), mAudioEngineInit(false)
mFullDuplex(aPrefs.mFullDuplex)
{ {
#ifndef MOZ_B2G_CAMERA #ifndef MOZ_B2G_CAMERA
nsCOMPtr<nsIComponentRegistrar> compMgr; nsCOMPtr<nsIComponentRegistrar> compMgr;
@ -288,8 +287,7 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
} }
if (!mAudioInput) { if (!mAudioInput) {
if (mFullDuplex) { if (true /*platform_supports_full_duplex*/) {
// The platform_supports_full_duplex.
mAudioInput = new mozilla::AudioInputCubeb(mVoiceEngine); mAudioInput = new mozilla::AudioInputCubeb(mVoiceEngine);
} else { } else {
mAudioInput = new mozilla::AudioInputWebRTC(mVoiceEngine); mAudioInput = new mozilla::AudioInputWebRTC(mVoiceEngine);
@ -332,10 +330,8 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
aASources->AppendElement(aSource.get()); aASources->AppendElement(aSource.get());
} else { } else {
AudioInput* audioinput = mAudioInput; AudioInput* audioinput = mAudioInput;
if (mFullDuplex) { if (true /*platform_supports_full_duplex*/) {
// The platform_supports_full_duplex. // For cubeb, it has state (the selected ID
// For cubeb, it has state (the selected ID)
// XXX just use the uniqueID for cubeb and support it everywhere, and get rid of this // XXX just use the uniqueID for cubeb and support it everywhere, and get rid of this
// XXX Small window where the device list/index could change! // XXX Small window where the device list/index could change!
audioinput = new mozilla::AudioInputCubeb(mVoiceEngine); audioinput = new mozilla::AudioInputCubeb(mVoiceEngine);

View File

@ -526,7 +526,7 @@ private:
webrtc::VoiceEngine* mVoiceEngine; webrtc::VoiceEngine* mVoiceEngine;
RefPtr<mozilla::AudioInput> mAudioInput; RefPtr<mozilla::AudioInput> mAudioInput;
bool mAudioEngineInit; bool mAudioEngineInit;
bool mFullDuplex;
bool mHasTabVideoSource; bool mHasTabVideoSource;
// Store devices we've already seen in a hashtable for quick return. // Store devices we've already seen in a hashtable for quick return.

View File

@ -202,11 +202,10 @@ MediaEngineWebRTCMicrophoneSource::Config(bool aEchoOn, uint32_t aEcho,
bool aNoiseOn, uint32_t aNoise, bool aNoiseOn, uint32_t aNoise,
int32_t aPlayoutDelay) int32_t aPlayoutDelay)
{ {
LOG(("Audio config: aec: %d, agc: %d, noise: %d, delay: %d", LOG(("Audio config: aec: %d, agc: %d, noise: %d",
aEchoOn ? aEcho : -1, aEchoOn ? aEcho : -1,
aAgcOn ? aAGC : -1, aAgcOn ? aAGC : -1,
aNoiseOn ? aNoise : -1, aNoiseOn ? aNoise : -1));
aPlayoutDelay));
bool update_echo = (mEchoOn != aEchoOn); bool update_echo = (mEchoOn != aEchoOn);
bool update_agc = (mAgcOn != aAgcOn); bool update_agc = (mAgcOn != aAgcOn);

View File

@ -438,33 +438,27 @@ pref("media.getusermedia.aec_delay_agnostic", true);
pref("media.getusermedia.noise", 1); pref("media.getusermedia.noise", 1);
pref("media.getusermedia.agc_enabled", false); pref("media.getusermedia.agc_enabled", false);
pref("media.getusermedia.agc", 1); pref("media.getusermedia.agc", 1);
// capture_delay: Adjustments for OS-specific input delay (lower bound) // Adjustments for OS-specific input delay (lower bound)
// playout_delay: Adjustments for OS-specific AudioStream+cubeb+output delay (lower bound) // Adjustments for OS-specific AudioStream+cubeb+output delay (lower bound)
// full_duplex: enable cubeb full-duplex capture/playback
#if defined(XP_MACOSX) #if defined(XP_MACOSX)
pref("media.peerconnection.capture_delay", 50); pref("media.peerconnection.capture_delay", 50);
pref("media.getusermedia.playout_delay", 10); pref("media.getusermedia.playout_delay", 10);
pref("media.navigator.audio.full_duplex", false);
#elif defined(XP_WIN) #elif defined(XP_WIN)
pref("media.peerconnection.capture_delay", 50); pref("media.peerconnection.capture_delay", 50);
pref("media.getusermedia.playout_delay", 40); pref("media.getusermedia.playout_delay", 40);
pref("media.navigator.audio.full_duplex", false);
#elif defined(ANDROID) #elif defined(ANDROID)
pref("media.peerconnection.capture_delay", 100); pref("media.peerconnection.capture_delay", 100);
pref("media.getusermedia.playout_delay", 100); pref("media.getusermedia.playout_delay", 100);
pref("media.navigator.audio.full_duplex", false);
// Whether to enable Webrtc Hardware acceleration support // Whether to enable Webrtc Hardware acceleration support
pref("media.navigator.hardware.vp8_encode.acceleration_enabled", false); pref("media.navigator.hardware.vp8_encode.acceleration_enabled", false);
pref("media.navigator.hardware.vp8_decode.acceleration_enabled", false); pref("media.navigator.hardware.vp8_decode.acceleration_enabled", false);
#elif defined(XP_LINUX) #elif defined(XP_LINUX)
pref("media.peerconnection.capture_delay", 70); pref("media.peerconnection.capture_delay", 70);
pref("media.getusermedia.playout_delay", 50); pref("media.getusermedia.playout_delay", 50);
pref("media.navigator.audio.full_duplex", false);
#else #else
// *BSD, others - merely a guess for now // *BSD, others - merely a guess for now
pref("media.peerconnection.capture_delay", 50); pref("media.peerconnection.capture_delay", 50);
pref("media.getusermedia.playout_delay", 50); pref("media.getusermedia.playout_delay", 50);
pref("media.navigator.audio.full_duplex", false);
#endif #endif
#endif #endif