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

Side by Side 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 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 capture_start_ntp_time_ms_ = 732 capture_start_ntp_time_ms_ =
733 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_; 733 audioFrame->ntp_time_ms_ - audioFrame->elapsed_time_ms_;
734 } 734 }
735 } 735 }
736 } 736 }
737 737
738 return muted ? MixerParticipant::AudioFrameInfo::kMuted 738 return muted ? MixerParticipant::AudioFrameInfo::kMuted
739 : MixerParticipant::AudioFrameInfo::kNormal; 739 : MixerParticipant::AudioFrameInfo::kNormal;
740 } 740 }
741 741
742 AudioMixer::Source::AudioFrameWithInfo Channel::GetAudioFrameWithInfo(
743 int sample_rate_hz) {
744 mix_audio_frame_.sample_rate_hz_ = sample_rate_hz;
745
746 const auto frame_info = GetAudioFrameWithMuted(-1, &mix_audio_frame_);
747
748 using FrameInfo = AudioMixer::Source::AudioFrameInfo;
749 FrameInfo new_audio_frame_info = FrameInfo::kError;
750 switch (frame_info) {
751 case MixerParticipant::AudioFrameInfo::kNormal:
752 new_audio_frame_info = FrameInfo::kNormal;
753 break;
754 case MixerParticipant::AudioFrameInfo::kMuted:
755 new_audio_frame_info = FrameInfo::kMuted;
756 break;
757 case MixerParticipant::AudioFrameInfo::kError:
758 new_audio_frame_info = FrameInfo::kError;
759 break;
760 }
761 return {&mix_audio_frame_, new_audio_frame_info};
762 }
763
742 int32_t Channel::NeededFrequency(int32_t id) const { 764 int32_t Channel::NeededFrequency(int32_t id) const {
743 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 765 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
744 "Channel::NeededFrequency(id=%d)", id); 766 "Channel::NeededFrequency(id=%d)", id);
745 767
746 int highestNeeded = 0; 768 int highestNeeded = 0;
747 769
748 // Determine highest needed receive frequency 770 // Determine highest needed receive frequency
749 int32_t receiveFrequency = audio_coding_->ReceiveFrequency(); 771 int32_t receiveFrequency = audio_coding_->ReceiveFrequency();
750 772
751 // Return the bigger of playout and receive frequency in the ACM. 773 // Return the bigger of playout and receive frequency in the ACM.
(...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after
3287 int64_t min_rtt = 0; 3309 int64_t min_rtt = 0;
3288 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3310 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3289 0) { 3311 0) {
3290 return 0; 3312 return 0;
3291 } 3313 }
3292 return rtt; 3314 return rtt;
3293 } 3315 }
3294 3316
3295 } // namespace voe 3317 } // namespace voe
3296 } // namespace webrtc 3318 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698