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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 2378143004: Made AudioReceiveStream a mixer participant. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 capture_start_ntp_time_ms_ = 688 capture_start_ntp_time_ms_ =
689 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_; 689 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_;
690 } 690 }
691 } 691 }
692 } 692 }
693 693
694 return muted ? MixerParticipant::AudioFrameInfo::kMuted 694 return muted ? MixerParticipant::AudioFrameInfo::kMuted
695 : MixerParticipant::AudioFrameInfo::kNormal; 695 : MixerParticipant::AudioFrameInfo::kNormal;
696 } 696 }
697 697
698 MixerAudioSource::AudioFrameWithMuted Channel::GetAudioFrameWithMuted(
699 int32_t id,
700 int sample_rate_hz) {
701 mix_audio_frame_.sample_rate_hz_ = sample_rate_hz;
702 auto frame_info = GetAudioFrameWithMuted(id, &mix_audio_frame_);
703 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 :)
704 switch (frame_info) {
705 case MixerParticipant::AudioFrameInfo::kNormal:
706 new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kNormal;
707 break;
708 case MixerParticipant::AudioFrameInfo::kMuted:
709 new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kMuted;
710 break;
711 default:
712 new_audio_frame_info = MixerAudioSource::AudioFrameInfo::kError;
713 }
714 return {&mix_audio_frame_, new_audio_frame_info};
715 }
716
698 int32_t Channel::NeededFrequency(int32_t id) const { 717 int32_t Channel::NeededFrequency(int32_t id) const {
699 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 718 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
700 "Channel::NeededFrequency(id=%d)", id); 719 "Channel::NeededFrequency(id=%d)", id);
701 720
702 int highestNeeded = 0; 721 int highestNeeded = 0;
703 722
704 // Determine highest needed receive frequency 723 // Determine highest needed receive frequency
705 int32_t receiveFrequency = audio_coding_->ReceiveFrequency(); 724 int32_t receiveFrequency = audio_coding_->ReceiveFrequency();
706 725
707 // Return the bigger of playout and receive frequency in the ACM. 726 // Return the bigger of playout and receive frequency in the ACM.
(...skipping 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after
3205 int64_t min_rtt = 0; 3224 int64_t min_rtt = 0;
3206 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3225 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3207 0) { 3226 0) {
3208 return 0; 3227 return 0;
3209 } 3228 }
3210 return rtt; 3229 return rtt;
3211 } 3230 }
3212 3231
3213 } // namespace voe 3232 } // namespace voe
3214 } // namespace webrtc 3233 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698