Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 2665693002: Moves channel-dependent audio input processing to separate encoder task queue (Closed)
Patch Set: Fixed dependency Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/voice_engine/transmit_mixer.cc
diff --git a/webrtc/voice_engine/transmit_mixer.cc b/webrtc/voice_engine/transmit_mixer.cc
index 07b47ec48e71a8a74e1080fe82888ee5c314a8f6..f2cef2c308c64ca7d7970a9e067e315d7e6be98f 100644
--- a/webrtc/voice_engine/transmit_mixer.cc
+++ b/webrtc/voice_engine/transmit_mixer.cc
@@ -311,66 +311,14 @@ 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_);
- }
- }
- return 0;
-}
-
-void TransmitMixer::DemuxAndMix(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) {
- if (channel_ptr->Sending()) {
- // Demultiplex makes a copy of its input.
- channel_ptr->Demultiplex(_audioFrame);
- channel_ptr->PrepareEncodeAndSend(_audioFrame.sample_rate_hz_);
- }
- }
- }
-}
-
-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();
- }
+void TransmitMixer::ProcessAudio() {
the sun 2017/03/28 12:57:50 Name it ProcessAndEncodeAudio() since that's the n
henrika_webrtc 2017/03/29 10:35:12 Done.
+ 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::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();
}
}

Powered by Google App Engine
This is Rietveld 408576698