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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void ModuleRtpRtcpImpl::SetRtxSsrc(uint32_t ssrc) { | 228 void ModuleRtpRtcpImpl::SetRtxSsrc(uint32_t ssrc) { |
229 rtp_sender_->SetRtxSsrc(ssrc); | 229 rtp_sender_->SetRtxSsrc(ssrc); |
230 } | 230 } |
231 | 231 |
232 void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type, | 232 void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type, |
233 int associated_payload_type) { | 233 int associated_payload_type) { |
234 rtp_sender_->SetRtxPayloadType(payload_type, associated_payload_type); | 234 rtp_sender_->SetRtxPayloadType(payload_type, associated_payload_type); |
235 } | 235 } |
236 | 236 |
237 rtc::Optional<uint32_t> ModuleRtpRtcpImpl::FlexfecSsrc() const { | 237 rtc::Optional<uint32_t> ModuleRtpRtcpImpl::FlexfecSsrc() const { |
238 return rtp_sender_->FlexfecSsrc(); | 238 if (rtp_sender_) |
| 239 return rtp_sender_->FlexfecSsrc(); |
| 240 return rtc::Optional<uint32_t>(); |
239 } | 241 } |
240 | 242 |
241 int32_t ModuleRtpRtcpImpl::IncomingRtcpPacket( | 243 int32_t ModuleRtpRtcpImpl::IncomingRtcpPacket( |
242 const uint8_t* rtcp_packet, | 244 const uint8_t* rtcp_packet, |
243 const size_t length) { | 245 const size_t length) { |
244 return rtcp_receiver_.IncomingPacket(rtcp_packet, length) ? 0 : -1; | 246 return rtcp_receiver_.IncomingPacket(rtcp_packet, length) ? 0 : -1; |
245 } | 247 } |
246 | 248 |
247 int32_t ModuleRtpRtcpImpl::RegisterSendPayload( | 249 int32_t ModuleRtpRtcpImpl::RegisterSendPayload( |
248 const CodecInst& voice_codec) { | 250 const CodecInst& voice_codec) { |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 return RTCP_INTERVAL_AUDIO_MS; | 860 return RTCP_INTERVAL_AUDIO_MS; |
859 else | 861 else |
860 return RTCP_INTERVAL_VIDEO_MS; | 862 return RTCP_INTERVAL_VIDEO_MS; |
861 } | 863 } |
862 | 864 |
863 void ModuleRtpRtcpImpl::SetRtcpReceiverSsrcs(uint32_t main_ssrc) { | 865 void ModuleRtpRtcpImpl::SetRtcpReceiverSsrcs(uint32_t main_ssrc) { |
864 std::set<uint32_t> ssrcs; | 866 std::set<uint32_t> ssrcs; |
865 ssrcs.insert(main_ssrc); | 867 ssrcs.insert(main_ssrc); |
866 if (RtxSendStatus() != kRtxOff) | 868 if (RtxSendStatus() != kRtxOff) |
867 ssrcs.insert(rtp_sender_->RtxSsrc()); | 869 ssrcs.insert(rtp_sender_->RtxSsrc()); |
| 870 rtc::Optional<uint32_t> flexfec_ssrc = FlexfecSsrc(); |
| 871 if (flexfec_ssrc) |
| 872 ssrcs.insert(*flexfec_ssrc); |
868 rtcp_receiver_.SetSsrcs(main_ssrc, ssrcs); | 873 rtcp_receiver_.SetSsrcs(main_ssrc, ssrcs); |
869 } | 874 } |
870 | 875 |
871 void ModuleRtpRtcpImpl::set_rtt_ms(int64_t rtt_ms) { | 876 void ModuleRtpRtcpImpl::set_rtt_ms(int64_t rtt_ms) { |
872 rtc::CritScope cs(&critical_section_rtt_); | 877 rtc::CritScope cs(&critical_section_rtt_); |
873 rtt_ms_ = rtt_ms; | 878 rtt_ms_ = rtt_ms; |
874 } | 879 } |
875 | 880 |
876 int64_t ModuleRtpRtcpImpl::rtt_ms() const { | 881 int64_t ModuleRtpRtcpImpl::rtt_ms() const { |
877 rtc::CritScope cs(&critical_section_rtt_); | 882 rtc::CritScope cs(&critical_section_rtt_); |
878 return rtt_ms_; | 883 return rtt_ms_; |
879 } | 884 } |
880 | 885 |
881 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 886 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
882 StreamDataCountersCallback* callback) { | 887 StreamDataCountersCallback* callback) { |
883 rtp_sender_->RegisterRtpStatisticsCallback(callback); | 888 rtp_sender_->RegisterRtpStatisticsCallback(callback); |
884 } | 889 } |
885 | 890 |
886 StreamDataCountersCallback* | 891 StreamDataCountersCallback* |
887 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 892 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
888 return rtp_sender_->GetRtpStatisticsCallback(); | 893 return rtp_sender_->GetRtpStatisticsCallback(); |
889 } | 894 } |
890 | 895 |
891 void ModuleRtpRtcpImpl::SetVideoBitrateAllocation( | 896 void ModuleRtpRtcpImpl::SetVideoBitrateAllocation( |
892 const BitrateAllocation& bitrate) { | 897 const BitrateAllocation& bitrate) { |
893 rtcp_sender_.SetVideoBitrateAllocation(bitrate); | 898 rtcp_sender_.SetVideoBitrateAllocation(bitrate); |
894 } | 899 } |
895 } // namespace webrtc | 900 } // namespace webrtc |
OLD | NEW |