mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 901633 - Part 11 - Add an API in webrtc.org's output mixer to get the output channel count. r=jesup
This commit is contained in:
parent
77cec3e297
commit
c392cc5108
@ -297,6 +297,11 @@ OutputMixer::GetOutputVolumePan(float& left, float& right)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int OutputMixer::GetOutputChannelCount()
|
||||
{
|
||||
return _audioFrame.num_channels_;
|
||||
}
|
||||
|
||||
int OutputMixer::StartRecordingPlayout(const char* fileName,
|
||||
const CodecInst* codecInst)
|
||||
{
|
||||
|
@ -117,6 +117,8 @@ public:
|
||||
// so ExternalPlayoutData() can insert far-end audio from the audio drivers
|
||||
void APMAnalyzeReverseStream(AudioFrame &audioFrame);
|
||||
|
||||
int GetOutputChannelCount();
|
||||
|
||||
private:
|
||||
OutputMixer(uint32_t instanceId);
|
||||
int InsertInbandDtmfTone();
|
||||
|
@ -383,16 +383,23 @@ int VoEExternalMediaImpl::ExternalPlayoutGetData(
|
||||
|
||||
AudioFrame audioFrame;
|
||||
|
||||
uint32_t channels = shared_->output_mixer()->GetOutputChannelCount();
|
||||
// If we have not received any data yet, consider it's mono since it's the
|
||||
// most common case.
|
||||
if (channels == 0) {
|
||||
channels = 1;
|
||||
}
|
||||
|
||||
// Retrieve mixed output at the specified rate
|
||||
shared_->output_mixer()->MixActiveChannels();
|
||||
shared_->output_mixer()->DoOperationsOnCombinedSignal(true);
|
||||
shared_->output_mixer()->GetMixedAudio(samplingFreqHz, 1, &audioFrame);
|
||||
shared_->output_mixer()->GetMixedAudio(samplingFreqHz, channels, &audioFrame);
|
||||
|
||||
// Deliver audio (PCM) samples to the external sink
|
||||
memcpy(speechData10ms,
|
||||
audioFrame.data_,
|
||||
sizeof(int16_t)*(audioFrame.samples_per_channel_));
|
||||
lengthSamples = audioFrame.samples_per_channel_;
|
||||
sizeof(int16_t)*audioFrame.samples_per_channel_*channels);
|
||||
lengthSamples = audioFrame.samples_per_channel_ * channels;
|
||||
|
||||
// Store current playout delay (to be used by ExternalRecordingInsertData).
|
||||
playout_delay_ms_ = current_delay_ms;
|
||||
|
Loading…
Reference in New Issue
Block a user