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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 1505253004: Support for remote audio into tracks (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change when we fire callbacks for external media Created 5 years 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
« talk/session/media/channel.cc ('K') | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 37dc3b685b9243d7c31bdf35cb7b2ee9ce79ccc0..a36b13e566a3d1915c971ed5f456cbfdff48633b 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -560,6 +560,29 @@ int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame)
}
}
+ // External media.
+ // Pass the audio buffers to the external media callback, if set, before
+ // applying scaling/panning, as that applies to the mix operation.
the sun 2015/12/10 12:36:32 Does this break any of our tests? It might break 3
+ // External recipients of the audio (e.g. via AudioTrack), will do their own
+ // mixing.
+ if (_outputExternalMedia)
+ {
+ CriticalSectionScoped cs(&_callbackCritSect);
+ const bool isStereo = (audioFrame->num_channels_ == 2);
+ if (_outputExternalMediaCallbackPtr)
+ {
+ // TODO(tommi, hlundin): There's no timestamp information that
+ // accompanies the audio data. Fix pwetty pwease.
+ _outputExternalMediaCallbackPtr->Process(
+ _channelId,
+ kPlaybackPerChannel,
+ reinterpret_cast<int16_t*>(audioFrame->data_),
+ audioFrame->samples_per_channel_,
+ audioFrame->sample_rate_hz_,
+ isStereo);
+ }
+ }
+
float output_gain = 1.0f;
float left_pan = 1.0f;
float right_pan = 1.0f;
@@ -601,23 +624,6 @@ int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame)
MixAudioWithFile(*audioFrame, audioFrame->sample_rate_hz_);
}
- // External media
- if (_outputExternalMedia)
- {
- CriticalSectionScoped cs(&_callbackCritSect);
- const bool isStereo = (audioFrame->num_channels_ == 2);
- if (_outputExternalMediaCallbackPtr)
- {
- _outputExternalMediaCallbackPtr->Process(
- _channelId,
- kPlaybackPerChannel,
- (int16_t*)audioFrame->data_,
- audioFrame->samples_per_channel_,
- audioFrame->sample_rate_hz_,
- isStereo);
- }
- }
-
// Record playout if enabled
{
CriticalSectionScoped cs(&_fileCritSect);
« talk/session/media/channel.cc ('K') | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698