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

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

Issue 1340283002: Added support for logging the SSRC corresponding to AudioPlayout events. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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 unified diff | Download patch
« webrtc/video/rtc_event_log.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (header.payload_type_frequency < 0) 443 if (header.payload_type_frequency < 0)
444 return false; 444 return false;
445 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); 445 return ReceivePacket(rtp_packet, rtp_packet_length, header, false);
446 } 446 }
447 447
448 int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) 448 int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame)
449 { 449 {
450 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId), 450 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId),
451 "Channel::GetAudioFrame(id=%d)", id); 451 "Channel::GetAudioFrame(id=%d)", id);
452 452
453 if (event_log_) {
454 unsigned int ssrc;
455 GetLocalSSRC(ssrc);
hlundin-webrtc 2015/09/15 12:30:52 Since GetLocalSSRC has a return value, I'd argue t
ivoc 2015/09/15 14:55:16 Done.
456 event_log_->LogAudioPlayout(ssrc);
457 }
453 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) 458 // Get 10ms raw PCM data from the ACM (mixer limits output frequency)
454 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, 459 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_,
455 audioFrame) == -1) 460 audioFrame) == -1)
456 { 461 {
457 WEBRTC_TRACE(kTraceError, kTraceVoice, 462 WEBRTC_TRACE(kTraceError, kTraceVoice,
458 VoEId(_instanceId,_channelId), 463 VoEId(_instanceId,_channelId),
459 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); 464 "Channel::GetAudioFrame() PlayoutData10Ms() failed!");
460 // In all likelihood, the audio in this frame is garbage. We return an 465 // In all likelihood, the audio in this frame is garbage. We return an
461 // error so that the audio mixer module doesn't add it to the mix. As 466 // error so that the audio mixer module doesn't add it to the mix. As
462 // a result, it won't be played out and the actions skipped here are 467 // a result, it won't be played out and the actions skipped here are
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 717
713 Channel::Channel(int32_t channelId, 718 Channel::Channel(int32_t channelId,
714 uint32_t instanceId, 719 uint32_t instanceId,
715 RtcEventLog* const event_log, 720 RtcEventLog* const event_log,
716 const Config& config) 721 const Config& config)
717 : _fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()), 722 : _fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
718 _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()), 723 _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()),
719 volume_settings_critsect_(*CriticalSectionWrapper::CreateCriticalSection()), 724 volume_settings_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
720 _instanceId(instanceId), 725 _instanceId(instanceId),
721 _channelId(channelId), 726 _channelId(channelId),
727 event_log_(event_log),
722 rtp_header_parser_(RtpHeaderParser::Create()), 728 rtp_header_parser_(RtpHeaderParser::Create()),
723 rtp_payload_registry_( 729 rtp_payload_registry_(
724 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), 730 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))),
725 rtp_receive_statistics_( 731 rtp_receive_statistics_(
726 ReceiveStatistics::Create(Clock::GetRealTimeClock())), 732 ReceiveStatistics::Create(Clock::GetRealTimeClock())),
727 rtp_receiver_( 733 rtp_receiver_(
728 RtpReceiver::CreateAudioReceiver(VoEModuleId(instanceId, channelId), 734 RtpReceiver::CreateAudioReceiver(VoEModuleId(instanceId, channelId),
729 Clock::GetRealTimeClock(), 735 Clock::GetRealTimeClock(),
730 this, 736 this,
731 this, 737 this,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 AudioCodingModule::Config acm_config; 808 AudioCodingModule::Config acm_config;
803 acm_config.id = VoEModuleId(instanceId, channelId); 809 acm_config.id = VoEModuleId(instanceId, channelId);
804 if (config.Get<NetEqCapacityConfig>().enabled) { 810 if (config.Get<NetEqCapacityConfig>().enabled) {
805 // Clamping the buffer capacity at 20 packets. While going lower will 811 // Clamping the buffer capacity at 20 packets. While going lower will
806 // probably work, it makes little sense. 812 // probably work, it makes little sense.
807 acm_config.neteq_config.max_packets_in_buffer = 813 acm_config.neteq_config.max_packets_in_buffer =
808 std::max(20, config.Get<NetEqCapacityConfig>().capacity); 814 std::max(20, config.Get<NetEqCapacityConfig>().capacity);
809 } 815 }
810 acm_config.neteq_config.enable_fast_accelerate = 816 acm_config.neteq_config.enable_fast_accelerate =
811 config.Get<NetEqFastAccelerate>().enabled; 817 config.Get<NetEqFastAccelerate>().enabled;
812 acm_config.event_log = event_log;
813 audio_coding_.reset(AudioCodingModule::Create(acm_config)); 818 audio_coding_.reset(AudioCodingModule::Create(acm_config));
814 819
815 _inbandDtmfQueue.ResetDtmf(); 820 _inbandDtmfQueue.ResetDtmf();
816 _inbandDtmfGenerator.Init(); 821 _inbandDtmfGenerator.Init();
817 _outputAudioLevel.Clear(); 822 _outputAudioLevel.Clear();
818 823
819 RtpRtcp::Configuration configuration; 824 RtpRtcp::Configuration configuration;
820 configuration.id = VoEModuleId(instanceId, channelId); 825 configuration.id = VoEModuleId(instanceId, channelId);
821 configuration.audio = true; 826 configuration.audio = true;
822 configuration.outgoing_transport = this; 827 configuration.outgoing_transport = this;
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after
4152 int64_t min_rtt = 0; 4157 int64_t min_rtt = 0;
4153 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) 4158 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt)
4154 != 0) { 4159 != 0) {
4155 return 0; 4160 return 0;
4156 } 4161 }
4157 return rtt; 4162 return rtt;
4158 } 4163 }
4159 4164
4160 } // namespace voe 4165 } // namespace voe
4161 } // namespace webrtc 4166 } // namespace webrtc
OLDNEW
« webrtc/video/rtc_event_log.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698