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

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

Issue 2378143004: Made AudioReceiveStream a mixer participant. (Closed)
Patch Set: Rebase. 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 capture_start_ntp_time_ms_ = 704 capture_start_ntp_time_ms_ =
705 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_; 705 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_;
706 } 706 }
707 } 707 }
708 } 708 }
709 709
710 return muted ? MixerParticipant::AudioFrameInfo::kMuted 710 return muted ? MixerParticipant::AudioFrameInfo::kMuted
711 : MixerParticipant::AudioFrameInfo::kNormal; 711 : MixerParticipant::AudioFrameInfo::kNormal;
712 } 712 }
713 713
714 AudioMixer::Source::AudioFrameWithInfo Channel::GetAudioFrameWithInfo(
715 int sample_rate_hz) {
716 mix_audio_frame_.sample_rate_hz_ = sample_rate_hz;
717
718 const auto frame_info = GetAudioFrameWithMuted(-1, &mix_audio_frame_);
719
720 using FrameInfo = AudioMixer::Source::AudioFrameInfo;
721 FrameInfo new_audio_frame_info = FrameInfo::kError;
722 switch (frame_info) {
723 case MixerParticipant::AudioFrameInfo::kNormal:
724 new_audio_frame_info = FrameInfo::kNormal;
725 break;
726 case MixerParticipant::AudioFrameInfo::kMuted:
727 new_audio_frame_info = FrameInfo::kMuted;
728 break;
729 case MixerParticipant::AudioFrameInfo::kError:
730 new_audio_frame_info = FrameInfo::kError;
731 break;
732 }
733 return {&mix_audio_frame_, new_audio_frame_info};
734 }
735
714 int32_t Channel::NeededFrequency(int32_t id) const { 736 int32_t Channel::NeededFrequency(int32_t id) const {
715 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 737 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
716 "Channel::NeededFrequency(id=%d)", id); 738 "Channel::NeededFrequency(id=%d)", id);
717 739
718 int highestNeeded = 0; 740 int highestNeeded = 0;
719 741
720 // Determine highest needed receive frequency 742 // Determine highest needed receive frequency
721 int32_t receiveFrequency = audio_coding_->ReceiveFrequency(); 743 int32_t receiveFrequency = audio_coding_->ReceiveFrequency();
722 744
723 // Return the bigger of playout and receive frequency in the ACM. 745 // Return the bigger of playout and receive frequency in the ACM.
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 int64_t min_rtt = 0; 3265 int64_t min_rtt = 0;
3244 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3266 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3245 0) { 3267 0) {
3246 return 0; 3268 return 0;
3247 } 3269 }
3248 return rtt; 3270 return rtt;
3249 } 3271 }
3250 3272
3251 } // namespace voe 3273 } // namespace voe
3252 } // namespace webrtc 3274 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698