Bug 1397793 - Revert Mozilla changes to OutputMixer r=jesup
The MSG provides the reverse stream, and feed it directly to the APM.
MozReview-Commit-ID: A6DO407CJkp
--- a/media/webrtc/trunk/webrtc/voice_engine/output_mixer.cc
+++ b/media/webrtc/trunk/webrtc/voice_engine/output_mixer.cc
@@ -242,21 +242,16 @@ OutputMixer::GetOutputVolumePan(float& l
left = _panLeft;
right = _panRight;
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
"GetOutputVolumePan() => left=%2.1f, right=%2.1f",
left, right);
return 0;
}
-int OutputMixer::GetOutputChannelCount()
-{
- return _audioFrame.num_channels_;
-}
-
int OutputMixer::StartRecordingPlayout(const char* fileName,
const CodecInst* codecInst)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,-1),
"OutputMixer::StartRecordingPlayout(fileName=%s)", fileName);
if (_outputFileRecording)
{
@@ -472,17 +467,21 @@ OutputMixer::DoOperationsOnCombinedSigna
}
assert(_audioFrame.num_channels_ == 2);
AudioFrameOperations::Scale(_panLeft, _panRight, _audioFrame);
}
// --- Far-end Voice Quality Enhancement (AudioProcessing Module)
if (feed_data_to_apm) {
- APMAnalyzeReverseStream(_audioFrame);
+ if (_audioProcessingModulePtr->ProcessReverseStream(&_audioFrame) != 0) {
+ WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
+ "AudioProcessingModule::ProcessReverseStream() => error");
+ RTC_NOTREACHED();
+ }
}
// --- External media processing
{
rtc::CritScope cs(&_callbackCritSect);
if (_externalMedia)
{
const bool is_stereo = (_audioFrame.num_channels_ == 2);
@@ -499,33 +498,10 @@ OutputMixer::DoOperationsOnCombinedSigna
}
}
// --- Measure audio level (0-9) for the combined signal
_audioLevel.ComputeLevel(_audioFrame);
return 0;
}
-
-// Brought back by Mozilla so we can insert the reverse stream
-void OutputMixer::APMAnalyzeReverseStream(AudioFrame &audioFrame) {
- // Convert 44100Hz to 32000Hz since Processing doesn't support 44100
- // directly.
- // XXX Bug 1367510 -- convert to 48000? Or modify Processing to
- // support 44100 directly? (that's probably the best)
- AudioFrame *frame = &audioFrame;
- AudioFrame tempframe;
- if (frame->sample_rate_hz_ == AudioProcessing::NativeRate::kSampleRate44_1kHz) {
- tempframe.num_channels_ = 1;
- tempframe.sample_rate_hz_ = AudioProcessing::NativeRate::kSampleRate32kHz;
- RemixAndResample(audioFrame, &audioproc_resampler_, &tempframe);
- frame = &tempframe;
- }
-
- if (_audioProcessingModulePtr->ProcessReverseStream(frame) != 0) {
- WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId,-1),
- "AudioProcessingModule::ProcessReverseStream() => error");
- RTC_DCHECK(false);
- }
-}
-
} // namespace voe
} // namespace webrtc