Backed out 3 changesets (bug 1626081) for causing build bustages. CLOSED TREE

Backed out changeset 82cae35b52eb (bug 1626081)
Backed out changeset 42135f164217 (bug 1626081)
Backed out changeset 2676f31077bc (bug 1626081)
This commit is contained in:
Cosmin Sabou 2020-05-11 21:38:54 +03:00
Родитель b51ad59f7d
Коммит 72e80153f2
11 изменённых файлов: 25 добавлений и 87 удалений

Просмотреть файл

@ -52,7 +52,6 @@
#define PREF_CUBEB_LOGGING_LEVEL "media.cubeb.logging_level"
// Hidden pref used by tests to force failure to obtain cubeb context
#define PREF_CUBEB_FORCE_NULL_CONTEXT "media.cubeb.force_null_context"
#define PREF_CUBEB_OUTPUT_VOICE_ROUTING "media.cubeb.output_voice_routing"
// Hidden pref to disable BMO 1427011 experiment; can be removed once proven.
#define PREF_CUBEB_DISABLE_DEVICE_SWITCHING \
"media.cubeb.disable_device_switching"
@ -101,7 +100,6 @@ bool sCubebMTGLatencyPrefSet = false;
bool sAudioStreamInitEverSucceeded = false;
bool sCubebForceNullContext = false;
bool sCubebDisableDeviceSwitching = true;
bool sRouteOutputAsVoice = false;
#ifdef MOZ_CUBEB_REMOTING
bool sCubebSandbox = false;
size_t sAudioIPCPoolSize;
@ -269,13 +267,6 @@ void PrefChanged(const char* aPref, void* aClosure) {
AUDIOIPC_STACK_SIZE_DEFAULT);
}
#endif
else if (strcmp(aPref, PREF_CUBEB_OUTPUT_VOICE_ROUTING) == 0) {
StaticMutexAutoLock lock(sMutex);
sRouteOutputAsVoice = Preferences::GetBool(aPref);
MOZ_LOG(gCubebLog, LogLevel::Verbose,
("%s: %s", PREF_CUBEB_OUTPUT_VOICE_ROUTING,
sRouteOutputAsVoice ? "true" : "false"));
}
}
bool GetFirstStream() {
@ -685,8 +676,6 @@ cubeb_stream_prefs GetDefaultStreamPrefs() {
return CUBEB_STREAM_PREF_NONE;
}
bool RouteOutputAsVoice() { return sRouteOutputAsVoice; }
#ifdef MOZ_WIDGET_ANDROID
uint32_t AndroidGetAudioOutputSampleRate() {
int32_t sample_rate = java::GeckoAppShell::GetAudioOutputSampleRate();

Просмотреть файл

@ -51,10 +51,6 @@ char* GetForcedOutputDevice();
// to switch to "communication mode", which might change audio routing,
// bluetooth communication type, etc.
void SetInCommunication(bool aInCommunication);
// Returns true if the output streams should be routed like a stream containing
// voice data, and not generic audio. This can influence audio processing and
// device selection.
bool RouteOutputAsVoice();
# ifdef MOZ_WIDGET_ANDROID
uint32_t AndroidGetAudioOutputSampleRate();

Просмотреть файл

@ -642,8 +642,7 @@ void AudioCallbackDriver::Init() {
output.layout = static_cast<uint32_t>(channelMap);
output.prefs = CubebUtils::GetDefaultStreamPrefs();
#if !defined(XP_WIN)
if (mInputDevicePreference == CUBEB_DEVICE_PREF_VOICE &&
CubebUtils::RouteOutputAsVoice()) {
if (mInputDevicePreference == CUBEB_DEVICE_PREF_VOICE) {
output.prefs |= static_cast<cubeb_stream_prefs>(CUBEB_STREAM_PREF_VOICE);
}
#endif
@ -672,10 +671,6 @@ void AudioCallbackDriver::Init() {
input = output;
input.channels = mInputChannelCount;
input.layout = CUBEB_LAYOUT_UNDEFINED;
input.prefs = CubebUtils::GetDefaultStreamPrefs();
if (mInputDevicePreference == CUBEB_DEVICE_PREF_VOICE) {
input.prefs |= static_cast<cubeb_stream_prefs>(CUBEB_STREAM_PREF_VOICE);
}
cubeb_stream* stream = nullptr;
bool inputWanted = mInputChannelCount > 0;

Просмотреть файл

@ -1909,12 +1909,10 @@ MediaManager::MediaManager(UniquePtr<base::Thread> aMediaThread)
webrtc::EchoCancellation::SuppressionLevel::kModerateSuppression;
mPrefs.mAgc = webrtc::GainControl::Mode::kAdaptiveDigital;
mPrefs.mNoise = webrtc::NoiseSuppression::Level::kModerate;
mPrefs.mRoutingMode = webrtc::EchoControlMobile::RoutingMode::kSpeakerphone;
#else
mPrefs.mAec = 0;
mPrefs.mAgc = 0;
mPrefs.mNoise = 0;
mPrefs.mRoutingMode = 0;
#endif
mPrefs.mFullDuplex = false;
mPrefs.mChannels = 0; // max channels default
@ -1929,14 +1927,14 @@ MediaManager::MediaManager(UniquePtr<base::Thread> aMediaThread)
}
LOG("%s: default prefs: %dx%d @%dfps, %dHz test tones, aec: %s,"
"agc: %s, hpf: %s, noise: %s, aec level: %d, agc level: %d, noise level: "
"%d, aec mobile routing mode: %d,"
"%d,"
"%sfull_duplex, extended aec %s, delay_agnostic %s "
"channels %d",
__FUNCTION__, mPrefs.mWidth, mPrefs.mHeight, mPrefs.mFPS, mPrefs.mFreq,
mPrefs.mAecOn ? "on" : "off", mPrefs.mAgcOn ? "on" : "off",
mPrefs.mHPFOn ? "on" : "off", mPrefs.mNoiseOn ? "on" : "off", mPrefs.mAec,
mPrefs.mAgc, mPrefs.mNoise, mPrefs.mRoutingMode,
mPrefs.mFullDuplex ? "" : "not ", mPrefs.mExtendedFilter ? "on" : "off",
mPrefs.mAgc, mPrefs.mNoise, mPrefs.mFullDuplex ? "" : "not ",
mPrefs.mExtendedFilter ? "on" : "off",
mPrefs.mDelayAgnostic ? "on" : "off", mPrefs.mChannels);
}
@ -3489,8 +3487,6 @@ void MediaManager::GetPrefs(nsIPrefBranch* aBranch, const char* aData) {
GetPref(aBranch, "media.getusermedia.aec", aData, &mPrefs.mAec);
GetPref(aBranch, "media.getusermedia.agc", aData, &mPrefs.mAgc);
GetPref(aBranch, "media.getusermedia.noise", aData, &mPrefs.mNoise);
GetPref(aBranch, "media.getusermedia.aecm_output_routing", aData,
&mPrefs.mRoutingMode);
GetPrefBool(aBranch, "media.getusermedia.aec_extended_filter", aData,
&mPrefs.mExtendedFilter);
GetPrefBool(aBranch, "media.getusermedia.aec_aec_delay_agnostic", aData,

Просмотреть файл

@ -3659,25 +3659,6 @@ double MediaTrackGraphImpl::AudioOutputLatency() {
return mAudioOutputLatency;
}
double MediaTrackGraphImpl::AudioInputLatency() {
MOZ_ASSERT(NS_IsMainThread());
if (mAudioInputLatency != 0.0) {
return mAudioInputLatency;
}
MonitorAutoLock lock(mMonitor);
if (CurrentDriver()->AsAudioCallbackDriver()) {
mAudioInputLatency = CurrentDriver()
->AsAudioCallbackDriver()
->AudioInputLatency()
.ToSeconds();
} else {
// Failure mode: return 0.0 if running on a normal thread.
mAudioInputLatency = 0.0;
}
return mAudioInputLatency;
}
bool MediaTrackGraph::IsNonRealtime() const {
return !static_cast<const MediaTrackGraphImpl*>(this)->mRealtime;
}

Просмотреть файл

@ -32,7 +32,6 @@ class MediaEnginePrefs {
mNoiseOn(false),
mAec(0),
mAgc(0),
mRoutingMode(0),
mNoise(0),
mFullDuplex(false),
mExtendedFilter(false),
@ -51,7 +50,6 @@ class MediaEnginePrefs {
bool mNoiseOn;
int32_t mAec;
int32_t mAgc;
int32_t mRoutingMode;
int32_t mNoise;
bool mFullDuplex;
bool mExtendedFilter;

Просмотреть файл

@ -164,29 +164,25 @@ nsresult MediaEngineWebRTCMicrophoneSource::Reconfigure(
}
void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(
bool aEnable, bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
EchoControlMobile::RoutingMode aRoutingMode) {
bool aEnable, bool aUseAecMobile,
EchoCancellation::SuppressionLevel aLevel) {
AssertIsOnOwningThread();
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
NS_DispatchToMainThread(NS_NewRunnableFunction(
__func__,
[that, track = mTrack, aEnable, aUseAecMobile, aLevel, aRoutingMode] {
__func__, [that, track = mTrack, aEnable, aUseAecMobile, aLevel] {
class Message : public ControlMessage {
public:
Message(AudioInputProcessing* aInputProcessing, bool aEnable,
bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
EchoControlMobile::RoutingMode aRoutingMode)
bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel)
: ControlMessage(nullptr),
mInputProcessing(aInputProcessing),
mEnable(aEnable),
mUseAecMobile(aUseAecMobile),
mLevel(aLevel),
mRoutingMode(aRoutingMode) {}
mLevel(aLevel) {}
void Run() override {
mInputProcessing->UpdateAECSettings(mEnable, mUseAecMobile, mLevel,
mRoutingMode);
mInputProcessing->UpdateAECSettings(mEnable, mUseAecMobile, mLevel);
}
protected:
@ -194,16 +190,14 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(
bool mEnable;
bool mUseAecMobile;
EchoCancellation::SuppressionLevel mLevel;
EchoControlMobile::RoutingMode mRoutingMode;
};
if (track->IsDestroyed()) {
return;
}
track->GraphImpl()->AppendMessage(
MakeUnique<Message>(that->mInputProcessing, aEnable, aUseAecMobile,
aLevel, aRoutingMode));
track->GraphImpl()->AppendMessage(MakeUnique<Message>(
that->mInputProcessing, aEnable, aUseAecMobile, aLevel));
}));
}
@ -358,9 +352,7 @@ void MediaEngineWebRTCMicrophoneSource::ApplySettings(
static_cast<webrtc::NoiseSuppression::Level>(aPrefs.mNoise));
UpdateAECSettings(
aPrefs.mAecOn, aPrefs.mUseAecMobile,
static_cast<webrtc::EchoCancellation::SuppressionLevel>(aPrefs.mAec),
static_cast<webrtc::EchoControlMobile::RoutingMode>(
aPrefs.mRoutingMode));
static_cast<webrtc::EchoCancellation::SuppressionLevel>(aPrefs.mAec));
UpdateHPFSettings(aPrefs.mHPFOn);
UpdateAPMExtraOptions(mExtendedFilter, mDelayAgnostic);
@ -685,12 +677,10 @@ void AudioInputProcessing::SetRequestedInputChannelCount(
} while (0);
void AudioInputProcessing::UpdateAECSettings(
bool aEnable, bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
EchoControlMobile::RoutingMode aRoutingMode) {
bool aEnable, bool aUseAecMobile,
EchoCancellation::SuppressionLevel aLevel) {
if (aUseAecMobile) {
HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->Enable(aEnable));
HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->set_routing_mode(
aRoutingMode));
HANDLE_APM_ERROR(mAudioProcessing->echo_cancellation()->Enable(false));
} else {
if (aLevel != EchoCancellation::SuppressionLevel::kLowSuppression &&

Просмотреть файл

@ -93,8 +93,7 @@ class MediaEngineWebRTCMicrophoneSource : public MediaEngineSource {
* Sent the AudioProcessingModule parameter for a given processing algorithm.
*/
void UpdateAECSettings(bool aEnable, bool aUseAecMobile,
webrtc::EchoCancellation::SuppressionLevel aLevel,
webrtc::EchoControlMobile::RoutingMode aRoutingMode);
webrtc::EchoCancellation::SuppressionLevel aLevel);
void UpdateAGCSettings(bool aEnable, webrtc::GainControl::Mode aMode);
void UpdateHPFSettings(bool aEnable);
void UpdateNSSettings(bool aEnable, webrtc::NoiseSuppression::Level aLevel);
@ -191,8 +190,7 @@ class AudioInputProcessing : public AudioDataListener {
// This allow changing the APM options, enabling or disabling processing
// steps.
void UpdateAECSettings(bool aEnable, bool aUseAecMobile,
webrtc::EchoCancellation::SuppressionLevel aLevel,
webrtc::EchoControlMobile::RoutingMode aRoutingMode);
webrtc::EchoCancellation::SuppressionLevel aLevel);
void UpdateAGCSettings(bool aEnable, webrtc::GainControl::Mode aMode);
void UpdateHPFSettings(bool aEnable);
void UpdateNSSettings(bool aEnable, webrtc::NoiseSuppression::Level aLevel);

Просмотреть файл

@ -19,5 +19,5 @@ origin:
license: "ISC"
# update.sh will update this value
release: "80c3d838d2929c2783065ef1eb686dda98e05df4 (2020-05-07 17:49:36 +0200)"
release: "2f313a6977c293fdc0af9897b251d2b77b539654-dirty (2020-04-30 15:54:04 +0200)"

Просмотреть файл

@ -168,8 +168,7 @@ struct cubeb_stream {
int64_t lastPosition;
int64_t lastPositionTimeStamp;
int64_t lastCompensativePosition;
int voice_input;
int voice_output;
int voice;
};
/* Forward declaration. */
@ -960,8 +959,8 @@ opensl_configure_capture(cubeb_stream * stm, cubeb_stream_params * params)
// Voice recognition is the lowest latency, according to the docs. Camcorder
// uses a microphone that is in the same direction as the camera.
SLint32 streamType = stm->voice_input ? SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION
: SL_ANDROID_RECORDING_PRESET_CAMCORDER;
SLint32 streamType = stm->voice ? SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION
: SL_ANDROID_RECORDING_PRESET_CAMCORDER;
res = (*recorderConfig)
->SetConfiguration(recorderConfig, SL_ANDROID_KEY_RECORDING_PRESET,
@ -1186,7 +1185,7 @@ opensl_configure_playback(cubeb_stream * stm, cubeb_stream_params * params) {
}
SLint32 streamType = SL_ANDROID_STREAM_MEDIA;
if (stm->voice_output) {
if (stm->voice) {
streamType = SL_ANDROID_STREAM_VOICE;
}
res = (*playerConfig)->SetConfiguration(playerConfig,
@ -1386,11 +1385,10 @@ opensl_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name
stm->input_enabled = (input_stream_params) ? 1 : 0;
stm->output_enabled = (output_stream_params) ? 1 : 0;
stm->shutdown = 1;
stm->voice_input = has_pref_set(input_stream_params, NULL, CUBEB_STREAM_PREF_VOICE);
stm->voice_output = has_pref_set(NULL, output_stream_params, CUBEB_STREAM_PREF_VOICE);
stm->voice = has_pref_set(input_stream_params, output_stream_params, CUBEB_STREAM_PREF_VOICE);
LOG("cubeb stream prefs: voice: %s", stm->voice ? "true" : "false");
LOG("cubeb stream prefs: voice_input: %s voice_output: %s", stm->voice_input ? "true" : "false",
stm->voice_output ? "true" : "false");
#ifdef DEBUG
pthread_mutexattr_t attr;

Просмотреть файл

@ -533,7 +533,6 @@ pref("media.videocontrols.picture-in-picture.video-toggle.min-video-secs", 45);
pref("media.getusermedia.agc_enabled", true);
pref("media.getusermedia.agc", 1); // kAdaptiveDigital
pref("media.getusermedia.hpf_enabled", true);
pref("media.getusermedia.aecm_output_routing", 3); // kSpeakerphone
// full_duplex: enable cubeb full-duplex capture/playback
pref("media.navigator.audio.full_duplex", true);
#endif // MOZ_WEBRTC
@ -583,8 +582,6 @@ pref("media.cubeb.logging_level", "");
pref("media.cubeb.backend", "audiounit-rust");
#endif
pref("media.cubeb.output_voice_routing", true);
// GraphRunner (fixed MediaTrackGraph thread) control
pref("media.audiograph.single_thread.enabled", true);