зеркало из https://github.com/mozilla/gecko-dev.git
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 --HG-- extra : rebase_source : df4ad965c171eab5a72a8d09e0305b1e79325a03 extra : source : e92ff1339db1ca5affa56ccdbec1c8b3836bcd95
This commit is contained in:
Родитель
2c9ab89b7c
Коммит
1d9f5026c1
|
@ -247,11 +247,6 @@ OutputMixer::GetOutputVolumePan(float& left, float& right)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int OutputMixer::GetOutputChannelCount()
|
||||
{
|
||||
return _audioFrame.num_channels_;
|
||||
}
|
||||
|
||||
int OutputMixer::StartRecordingPlayout(const char* fileName,
|
||||
const CodecInst* codecInst)
|
||||
{
|
||||
|
@ -477,7 +472,11 @@ OutputMixer::DoOperationsOnCombinedSignal(bool feed_data_to_apm)
|
|||
|
||||
// --- 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
|
||||
|
@ -504,28 +503,5 @@ OutputMixer::DoOperationsOnCombinedSignal(bool feed_data_to_apm)
|
|||
|
||||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче