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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2378143004: Made AudioReceiveStream a mixer participant. (Closed)
Patch Set: Created 4 years, 3 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/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 582bde5f26216f645340ef2102d87e485ff2fafb..37de8ec6fe62538e1061fd43e03e2b4be7dd7a54 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -695,6 +695,25 @@ MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted(
: MixerParticipant::AudioFrameInfo::kNormal;
}
+MixerAudioSource::AudioFrameWithMuted Channel::GetAudioFrameWithMuted(
+ int32_t id,
+ int sample_rate_hz) {
+ mix_audio_frame_.sample_rate_hz_ = sample_rate_hz;
+ auto frame_info = GetAudioFrameWithMuted(id, &mix_audio_frame_);
+ MixerAudioSource::AudioFrameInfo new_audio_frame_info;
the sun 2016/10/03 11:41:26 Init to kError and omit the default section of the
aleloi 2016/10/03 12:57:28 Then the compiler warns about not handling every c
the sun 2016/10/04 20:41:12 Right, handle all cases in the switch but leave ou
aleloi 2016/10/05 13:56:51 Thanks, that seems a good tip for the future :)
+ switch (frame_info) {
+ case MixerParticipant::AudioFrameInfo::kNormal:
+ new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kNormal;
+ break;
+ case MixerParticipant::AudioFrameInfo::kMuted:
+ new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kMuted;
+ break;
+ default:
+ new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kError;
+ }
+ return {&mix_audio_frame_, new_audio_frame_info};
+}
+
int32_t Channel::NeededFrequency(int32_t id) const {
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::NeededFrequency(id=%d)", id);

Powered by Google App Engine
This is Rietveld 408576698