OLD | NEW |
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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 header.payload_type_frequency = | 568 header.payload_type_frequency = |
569 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType); | 569 rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType); |
570 if (header.payload_type_frequency < 0) | 570 if (header.payload_type_frequency < 0) |
571 return false; | 571 return false; |
572 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); | 572 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); |
573 } | 573 } |
574 | 574 |
575 MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted( | 575 MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted( |
576 int32_t id, | 576 int32_t id, |
577 AudioFrame* audioFrame) { | 577 AudioFrame* audioFrame) { |
578 unsigned int ssrc; | 578 |
579 RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); | 579 event_log_proxy_->LogAudioPlayout(0); |
580 event_log_proxy_->LogAudioPlayout(ssrc); | |
581 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) | 580 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) |
582 bool muted; | 581 bool muted; |
583 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, | 582 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, |
584 &muted) == -1) { | 583 &muted) == -1) { |
585 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), | 584 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), |
586 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); | 585 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); |
587 // In all likelihood, the audio in this frame is garbage. We return an | 586 // In all likelihood, the audio in this frame is garbage. We return an |
588 // error so that the audio mixer module doesn't add it to the mix. As | 587 // error so that the audio mixer module doesn't add it to the mix. As |
589 // a result, it won't be played out and the actions skipped here are | 588 // a result, it won't be played out and the actions skipped here are |
590 // irrelevant. | 589 // irrelevant. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 input_mute_(false), | 888 input_mute_(false), |
890 previous_frame_muted_(false), | 889 previous_frame_muted_(false), |
891 _panLeft(1.0f), | 890 _panLeft(1.0f), |
892 _panRight(1.0f), | 891 _panRight(1.0f), |
893 _outputGain(1.0f), | 892 _outputGain(1.0f), |
894 _lastLocalTimeStamp(0), | 893 _lastLocalTimeStamp(0), |
895 _lastPayloadType(0), | 894 _lastPayloadType(0), |
896 _includeAudioLevelIndication(false), | 895 _includeAudioLevelIndication(false), |
897 transport_overhead_per_packet_(0), | 896 transport_overhead_per_packet_(0), |
898 rtp_overhead_per_packet_(0), | 897 rtp_overhead_per_packet_(0), |
| 898 random_(rtc::TimeNanos()), |
899 _outputSpeechType(AudioFrame::kNormalSpeech), | 899 _outputSpeechType(AudioFrame::kNormalSpeech), |
900 restored_packet_in_use_(false), | 900 restored_packet_in_use_(false), |
901 rtcp_observer_(new VoERtcpObserver(this)), | 901 rtcp_observer_(new VoERtcpObserver(this)), |
902 associate_send_channel_(ChannelOwner(nullptr)), | 902 associate_send_channel_(ChannelOwner(nullptr)), |
903 pacing_enabled_(config.enable_voice_pacing), | 903 pacing_enabled_(config.enable_voice_pacing), |
904 feedback_observer_proxy_(new TransportFeedbackProxy()), | 904 feedback_observer_proxy_(new TransportFeedbackProxy()), |
905 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()), | 905 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()), |
906 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()), | 906 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()), |
907 retransmission_rate_limiter_(new RateLimiter(Clock::GetRealTimeClock(), | 907 retransmission_rate_limiter_(new RateLimiter(Clock::GetRealTimeClock(), |
908 kMaxRetransmissionWindowMs)), | 908 kMaxRetransmissionWindowMs)), |
(...skipping 19 matching lines...) Expand all Loading... |
928 seq_num_allocator_proxy_.get(); | 928 seq_num_allocator_proxy_.get(); |
929 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 929 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
930 } | 930 } |
931 configuration.event_log = &(*event_log_proxy_); | 931 configuration.event_log = &(*event_log_proxy_); |
932 configuration.rtt_stats = &(*rtcp_rtt_stats_proxy_); | 932 configuration.rtt_stats = &(*rtcp_rtt_stats_proxy_); |
933 configuration.retransmission_rate_limiter = | 933 configuration.retransmission_rate_limiter = |
934 retransmission_rate_limiter_.get(); | 934 retransmission_rate_limiter_.get(); |
935 | 935 |
936 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 936 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
937 _rtpRtcpModule->SetSendingMediaStatus(false); | 937 _rtpRtcpModule->SetSendingMediaStatus(false); |
| 938 |
| 939 SetLocalSSRC(random_.Rand<uint32_t>()); |
938 } | 940 } |
939 | 941 |
940 Channel::~Channel() { | 942 Channel::~Channel() { |
941 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(NULL); | 943 rtp_receive_statistics_->RegisterRtcpStatisticsCallback(NULL); |
942 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId), | 944 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId), |
943 "Channel::~Channel() - dtor"); | 945 "Channel::~Channel() - dtor"); |
944 | 946 |
945 if (_outputExternalMedia) { | 947 if (_outputExternalMedia) { |
946 DeRegisterExternalMediaProcessing(kPlaybackPerChannel); | 948 DeRegisterExternalMediaProcessing(kPlaybackPerChannel); |
947 } | 949 } |
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3166 int64_t min_rtt = 0; | 3168 int64_t min_rtt = 0; |
3167 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3169 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3168 0) { | 3170 0) { |
3169 return 0; | 3171 return 0; |
3170 } | 3172 } |
3171 return rtt; | 3173 return rtt; |
3172 } | 3174 } |
3173 | 3175 |
3174 } // namespace voe | 3176 } // namespace voe |
3175 } // namespace webrtc | 3177 } // namespace webrtc |
OLD | NEW |