Index: webrtc/voice_engine/transmit_mixer.cc |
diff --git a/webrtc/voice_engine/transmit_mixer.cc b/webrtc/voice_engine/transmit_mixer.cc |
index c7a09df5bc64ea0d1c8b60c705188872e1ffaeaf..0ead148e17a964fc2e63a4531758aed2ef37337a 100644 |
--- a/webrtc/voice_engine/transmit_mixer.cc |
+++ b/webrtc/voice_engine/transmit_mixer.cc |
@@ -382,69 +382,32 @@ TransmitMixer::PrepareDemux(const void* audioSamples, |
return 0; |
} |
-int32_t |
-TransmitMixer::DemuxAndMix() |
-{ |
- WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1), |
- "TransmitMixer::DemuxAndMix()"); |
- |
- for (ChannelManager::Iterator it(_channelManagerPtr); it.IsValid(); |
- it.Increment()) |
- { |
- Channel* channelPtr = it.GetChannel(); |
- if (channelPtr->Sending()) |
- { |
- // Demultiplex makes a copy of its input. |
- channelPtr->Demultiplex(_audioFrame); |
- channelPtr->PrepareEncodeAndSend(_audioFrame.sample_rate_hz_); |
- } |
+void TransmitMixer::ProcessAudio() { |
+ RTC_DCHECK_GT(_audioFrame.samples_per_channel_, 0); |
+ for (ChannelManager::Iterator it(_channelManagerPtr); it.IsValid(); |
+ it.Increment()) { |
+ Channel* const channel = it.GetChannel(); |
+ if (channel->Sending()) { |
+ channel->ProcessAndEncodeAudio(_audioFrame); |
} |
- return 0; |
+ } |
} |
-void TransmitMixer::DemuxAndMix(const int voe_channels[], |
- size_t number_of_voe_channels) { |
+// TODO(henrika): investigate the possibility of removing this method. |
+void TransmitMixer::ProcessAudio(const int voe_channels[], |
+ size_t number_of_voe_channels) { |
+ RTC_DCHECK_GT(_audioFrame.samples_per_channel_, 0); |
for (size_t i = 0; i < number_of_voe_channels; ++i) { |
voe::ChannelOwner ch = _channelManagerPtr->GetChannel(voe_channels[i]); |
- voe::Channel* channel_ptr = ch.channel(); |
- if (channel_ptr) { |
- if (channel_ptr->Sending()) { |
- // Demultiplex makes a copy of its input. |
- channel_ptr->Demultiplex(_audioFrame); |
- channel_ptr->PrepareEncodeAndSend(_audioFrame.sample_rate_hz_); |
+ voe::Channel* channel = ch.channel(); |
+ if (channel) { |
+ if (channel->Sending()) { |
+ channel->ProcessAndEncodeAudio(_audioFrame); |
} |
} |
} |
} |
-int32_t |
-TransmitMixer::EncodeAndSend() |
-{ |
- WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, -1), |
- "TransmitMixer::EncodeAndSend()"); |
- |
- for (ChannelManager::Iterator it(_channelManagerPtr); it.IsValid(); |
- it.Increment()) |
- { |
- Channel* channelPtr = it.GetChannel(); |
- if (channelPtr->Sending()) |
- { |
- channelPtr->EncodeAndSend(); |
- } |
- } |
- return 0; |
-} |
- |
-void TransmitMixer::EncodeAndSend(const int voe_channels[], |
- size_t number_of_voe_channels) { |
- for (size_t i = 0; i < number_of_voe_channels; ++i) { |
- voe::ChannelOwner ch = _channelManagerPtr->GetChannel(voe_channels[i]); |
- voe::Channel* channel_ptr = ch.channel(); |
- if (channel_ptr && channel_ptr->Sending()) |
- channel_ptr->EncodeAndSend(); |
- } |
-} |
- |
uint32_t TransmitMixer::CaptureLevel() const |
{ |
return _captureLevel; |