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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2378143004: Made AudioReceiveStream a mixer participant. (Closed)
Patch Set: Rebase after mixer interface changes. Created 4 years, 2 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 0965963fdd72ab87dd532b24ffca65cbcf8bad7e..44c8da4dde5b88ec7d4635d22bfabf561c63ed09 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -739,6 +739,28 @@ MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted(
: MixerParticipant::AudioFrameInfo::kNormal;
}
+AudioMixer::Source::AudioFrameWithInfo Channel::GetAudioFrameWithInfo(
+ int sample_rate_hz) {
+ mix_audio_frame_.sample_rate_hz_ = sample_rate_hz;
+
+ const auto frame_info = GetAudioFrameWithMuted(-1, &mix_audio_frame_);
+
+ using FrameInfo = AudioMixer::Source::AudioFrameInfo;
+ FrameInfo new_audio_frame_info = FrameInfo::kError;
+ switch (frame_info) {
+ case MixerParticipant::AudioFrameInfo::kNormal:
+ new_audio_frame_info = FrameInfo::kNormal;
+ break;
+ case MixerParticipant::AudioFrameInfo::kMuted:
+ new_audio_frame_info = FrameInfo::kMuted;
+ break;
+ case MixerParticipant::AudioFrameInfo::kError:
+ new_audio_frame_info = FrameInfo::kError;
+ break;
+ }
+ 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