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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 configuration.intra_frame_callback, | 84 configuration.intra_frame_callback, |
85 configuration.transport_feedback_callback, | 85 configuration.transport_feedback_callback, |
86 this), | 86 this), |
87 clock_(configuration.clock), | 87 clock_(configuration.clock), |
88 audio_(configuration.audio), | 88 audio_(configuration.audio), |
89 collision_detected_(false), | 89 collision_detected_(false), |
90 last_process_time_(configuration.clock->TimeInMilliseconds()), | 90 last_process_time_(configuration.clock->TimeInMilliseconds()), |
91 last_bitrate_process_time_(configuration.clock->TimeInMilliseconds()), | 91 last_bitrate_process_time_(configuration.clock->TimeInMilliseconds()), |
92 last_rtt_process_time_(configuration.clock->TimeInMilliseconds()), | 92 last_rtt_process_time_(configuration.clock->TimeInMilliseconds()), |
93 packet_overhead_(28), // IPV4 UDP. | 93 packet_overhead_(28), // IPV4 UDP. |
94 padding_index_(static_cast<size_t>(-1)), // Start padding at first child. | |
95 nack_method_(kNackOff), | |
96 nack_last_time_sent_full_(0), | 94 nack_last_time_sent_full_(0), |
97 nack_last_time_sent_full_prev_(0), | 95 nack_last_time_sent_full_prev_(0), |
98 nack_last_seq_number_sent_(0), | 96 nack_last_seq_number_sent_(0), |
99 key_frame_req_method_(kKeyFrameReqPliRtcp), | 97 key_frame_req_method_(kKeyFrameReqPliRtcp), |
100 remote_bitrate_(configuration.remote_bitrate_estimator), | 98 remote_bitrate_(configuration.remote_bitrate_estimator), |
101 rtt_stats_(configuration.rtt_stats), | 99 rtt_stats_(configuration.rtt_stats), |
102 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), | 100 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), |
103 rtt_ms_(0) { | 101 rtt_ms_(0) { |
104 send_video_codec_.codecType = kVideoCodecUnknown; | |
105 | |
106 // Make sure that RTCP objects are aware of our SSRC. | 102 // Make sure that RTCP objects are aware of our SSRC. |
107 uint32_t SSRC = rtp_sender_.SSRC(); | 103 uint32_t SSRC = rtp_sender_.SSRC(); |
108 rtcp_sender_.SetSSRC(SSRC); | 104 rtcp_sender_.SetSSRC(SSRC); |
109 SetRtcpReceiverSsrcs(SSRC); | 105 SetRtcpReceiverSsrcs(SSRC); |
110 } | 106 } |
111 | 107 |
112 // Returns the number of milliseconds until the module want a worker thread | 108 // Returns the number of milliseconds until the module want a worker thread |
113 // to call Process. | 109 // to call Process. |
114 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { | 110 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { |
115 const int64_t now = clock_->TimeInMilliseconds(); | 111 const int64_t now = clock_->TimeInMilliseconds(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 const CodecInst& voice_codec) { | 242 const CodecInst& voice_codec) { |
247 return rtp_sender_.RegisterPayload( | 243 return rtp_sender_.RegisterPayload( |
248 voice_codec.plname, | 244 voice_codec.plname, |
249 voice_codec.pltype, | 245 voice_codec.pltype, |
250 voice_codec.plfreq, | 246 voice_codec.plfreq, |
251 voice_codec.channels, | 247 voice_codec.channels, |
252 (voice_codec.rate < 0) ? 0 : voice_codec.rate); | 248 (voice_codec.rate < 0) ? 0 : voice_codec.rate); |
253 } | 249 } |
254 | 250 |
255 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) { | 251 int32_t ModuleRtpRtcpImpl::RegisterSendPayload(const VideoCodec& video_codec) { |
256 send_video_codec_ = video_codec; | |
257 return rtp_sender_.RegisterPayload(video_codec.plName, video_codec.plType, | 252 return rtp_sender_.RegisterPayload(video_codec.plName, video_codec.plType, |
258 90000, 0, 0); | 253 90000, 0, 0); |
259 } | 254 } |
260 | 255 |
261 int32_t ModuleRtpRtcpImpl::DeRegisterSendPayload(const int8_t payload_type) { | 256 int32_t ModuleRtpRtcpImpl::DeRegisterSendPayload(const int8_t payload_type) { |
262 return rtp_sender_.DeRegisterSendPayload(payload_type); | 257 return rtp_sender_.DeRegisterSendPayload(payload_type); |
263 } | 258 } |
264 | 259 |
265 int8_t ModuleRtpRtcpImpl::SendPayloadType() const { | 260 int8_t ModuleRtpRtcpImpl::SendPayloadType() const { |
266 return rtp_sender_.SendPayloadType(); | 261 return rtp_sender_.SendPayloadType(); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 void ModuleRtpRtcpImpl::BitrateSent(uint32_t* total_rate, | 870 void ModuleRtpRtcpImpl::BitrateSent(uint32_t* total_rate, |
876 uint32_t* video_rate, | 871 uint32_t* video_rate, |
877 uint32_t* fec_rate, | 872 uint32_t* fec_rate, |
878 uint32_t* nack_rate) const { | 873 uint32_t* nack_rate) const { |
879 *total_rate = rtp_sender_.BitrateSent(); | 874 *total_rate = rtp_sender_.BitrateSent(); |
880 *video_rate = rtp_sender_.VideoBitrateSent(); | 875 *video_rate = rtp_sender_.VideoBitrateSent(); |
881 *fec_rate = rtp_sender_.FecOverheadRate(); | 876 *fec_rate = rtp_sender_.FecOverheadRate(); |
882 *nack_rate = rtp_sender_.NackOverheadRate(); | 877 *nack_rate = rtp_sender_.NackOverheadRate(); |
883 } | 878 } |
884 | 879 |
885 void ModuleRtpRtcpImpl::OnRequestIntraFrame() { | |
886 RequestKeyFrame(); | |
887 } | |
888 | |
889 void ModuleRtpRtcpImpl::OnRequestSendReport() { | 880 void ModuleRtpRtcpImpl::OnRequestSendReport() { |
890 SendRTCP(kRtcpSr); | 881 SendRTCP(kRtcpSr); |
891 } | 882 } |
892 | 883 |
893 int32_t ModuleRtpRtcpImpl::SendRTCPReferencePictureSelection( | 884 int32_t ModuleRtpRtcpImpl::SendRTCPReferencePictureSelection( |
894 const uint64_t picture_id) { | 885 const uint64_t picture_id) { |
895 return rtcp_sender_.SendRTCP( | 886 return rtcp_sender_.SendRTCP( |
896 GetFeedbackState(), kRtcpRpsi, 0, 0, false, picture_id); | 887 GetFeedbackState(), kRtcpRpsi, 0, 0, false, picture_id); |
897 } | 888 } |
898 | 889 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 969 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
979 StreamDataCountersCallback* callback) { | 970 StreamDataCountersCallback* callback) { |
980 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 971 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
981 } | 972 } |
982 | 973 |
983 StreamDataCountersCallback* | 974 StreamDataCountersCallback* |
984 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 975 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
985 return rtp_sender_.GetRtpStatisticsCallback(); | 976 return rtp_sender_.GetRtpStatisticsCallback(); |
986 } | 977 } |
987 } // namespace webrtc | 978 } // namespace webrtc |
OLD | NEW |