Bug 1513973 - Remove mutable keyword from MediaEngineWebRTCMicrophoneSource runnables. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D15220

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2018-12-21 20:05:05 +00:00
Родитель 37c4490c3b
Коммит 567bfc91f0
1 изменённых файлов: 17 добавлений и 20 удалений

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

@ -203,9 +203,8 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(
media::NewRunnableFrom([that, graph = std::move(gripGraph), aEnable,
aUseAecMobile, aLevel]() mutable {
NS_DispatchToMainThread(media::NewRunnableFrom(
[that, graph = std::move(gripGraph), aEnable, aUseAecMobile, aLevel]() {
class Message : public ControlMessage {
public:
Message(AudioInputProcessing* aInputProcessing, bool aEnable,
@ -243,7 +242,7 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAGCSettings(
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(media::NewRunnableFrom(
[that, graph = std::move(gripGraph), aEnable, aMode]() mutable {
[that, graph = std::move(gripGraph), aEnable, aMode]() {
class Message : public ControlMessage {
public:
Message(AudioInputProcessing* aInputProcessing, bool aEnable,
@ -279,7 +278,7 @@ void MediaEngineWebRTCMicrophoneSource::UpdateNSSettings(
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(media::NewRunnableFrom(
[that, graph = std::move(gripGraph), aEnable, aLevel]() mutable {
[that, graph = std::move(gripGraph), aEnable, aLevel]() {
class Message : public ControlMessage {
public:
Message(AudioInputProcessing* aInputProcessing, bool aEnable,
@ -314,9 +313,8 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAPMExtraOptions(
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(
media::NewRunnableFrom([that, graph = std::move(gripGraph),
aExtendedFilter, aDelayAgnostic]() mutable {
NS_DispatchToMainThread(media::NewRunnableFrom(
[that, graph = std::move(gripGraph), aExtendedFilter, aDelayAgnostic]() {
class Message : public ControlMessage {
public:
Message(AudioInputProcessing* aInputProcessing, bool aExtendedFilter,
@ -370,7 +368,7 @@ void MediaEngineWebRTCMicrophoneSource::ApplySettings(
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
RefPtr<MediaStreamGraphImpl> graphImpl = mStream->GraphImpl();
NS_DispatchToMainThread(media::NewRunnableFrom(
[that, graph = std::move(graphImpl), prefs = aPrefs]() mutable {
[that, graph = std::move(graphImpl), prefs = aPrefs]() {
that->mSettings->mEchoCancellation.Value() = prefs.mAecOn;
that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn;
that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn;
@ -428,14 +426,13 @@ nsresult MediaEngineWebRTCMicrophoneSource::Allocate(
}
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
NS_DispatchToMainThread(
media::NewRunnableFrom([that, prefs = outputPrefs]() mutable {
that->mSettings->mEchoCancellation.Value() = prefs.mAecOn;
that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn;
that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn;
that->mSettings->mChannelCount.Value() = prefs.mChannels;
return NS_OK;
}));
NS_DispatchToMainThread(media::NewRunnableFrom([that, prefs = outputPrefs]() {
that->mSettings->mEchoCancellation.Value() = prefs.mAecOn;
that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn;
that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn;
that->mSettings->mChannelCount.Value() = prefs.mChannels;
return NS_OK;
}));
mCurrentPrefs = outputPrefs;
@ -473,7 +470,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Deallocate(
NS_DispatchToMainThread(media::NewRunnableFrom(
[stream = std::move(sourceStream),
audioInputProcessing = std::move(inputProcessing),
trackID = mTrackID]() mutable {
trackID = mTrackID]() {
if (stream->IsDestroyed()) {
// This stream has already been destroyed on main thread by its
// DOMMediaStream. No cleanup left to do.
@ -576,7 +573,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Start(
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(
media::NewRunnableFrom([that, graph = std::move(gripGraph), deviceID,
stream = mStream, track = mTrackID]() mutable {
stream = mStream, track = mTrackID]() {
if (graph) {
graph->AppendMessage(MakeUnique<StartStopMessage>(
that->mInputProcessing, StartStopMessage::Start));
@ -612,7 +609,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Stop(
RefPtr<MediaStreamGraphImpl> gripGraph = mStream->GraphImpl();
NS_DispatchToMainThread(
media::NewRunnableFrom([that, graph = std::move(gripGraph),
stream = mStream, track = mTrackID]() mutable {
stream = mStream, track = mTrackID]() {
if (graph) {
graph->AppendMessage(MakeUnique<StartStopMessage>(
that->mInputProcessing, StartStopMessage::Stop));