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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 306 |
307 // TODO(pbos): Handle media and RTX streams separately (separate RTCP | 307 // TODO(pbos): Handle media and RTX streams separately (separate RTCP |
308 // feedbacks). | 308 // feedbacks). |
309 RTCPSender::FeedbackState ModuleRtpRtcpImpl::GetFeedbackState() { | 309 RTCPSender::FeedbackState ModuleRtpRtcpImpl::GetFeedbackState() { |
310 StreamDataCounters rtp_stats; | 310 StreamDataCounters rtp_stats; |
311 StreamDataCounters rtx_stats; | 311 StreamDataCounters rtx_stats; |
312 rtp_sender_.GetDataCounters(&rtp_stats, &rtx_stats); | 312 rtp_sender_.GetDataCounters(&rtp_stats, &rtx_stats); |
313 | 313 |
314 RTCPSender::FeedbackState state; | 314 RTCPSender::FeedbackState state; |
315 state.send_payload_type = SendPayloadType(); | 315 state.send_payload_type = SendPayloadType(); |
316 state.frequency_hz = CurrentSendFrequencyHz(); | |
317 state.packets_sent = rtp_stats.transmitted.packets + | 316 state.packets_sent = rtp_stats.transmitted.packets + |
318 rtx_stats.transmitted.packets; | 317 rtx_stats.transmitted.packets; |
319 state.media_bytes_sent = rtp_stats.transmitted.payload_bytes + | 318 state.media_bytes_sent = rtp_stats.transmitted.payload_bytes + |
320 rtx_stats.transmitted.payload_bytes; | 319 rtx_stats.transmitted.payload_bytes; |
321 state.module = this; | 320 state.module = this; |
322 | 321 |
323 LastReceivedNTP(&state.last_rr_ntp_secs, | 322 LastReceivedNTP(&state.last_rr_ntp_secs, |
324 &state.last_rr_ntp_frac, | 323 &state.last_rr_ntp_frac, |
325 &state.remote_sr); | 324 &state.remote_sr); |
326 | 325 |
327 state.has_last_xr_rr = | 326 state.has_last_xr_rr = |
328 rtcp_receiver_.LastReceivedXrReferenceTimeInfo(&state.last_xr_rr); | 327 rtcp_receiver_.LastReceivedXrReferenceTimeInfo(&state.last_xr_rr); |
329 | 328 |
330 uint32_t tmp; | 329 uint32_t tmp; |
331 BitrateSent(&state.send_bitrate, &tmp, &tmp, &tmp); | 330 BitrateSent(&state.send_bitrate, &tmp, &tmp, &tmp); |
332 return state; | 331 return state; |
333 } | 332 } |
334 | 333 |
335 int ModuleRtpRtcpImpl::CurrentSendFrequencyHz() const { | |
336 return rtp_sender_.SendPayloadFrequency(); | |
337 } | |
338 | |
339 int32_t ModuleRtpRtcpImpl::SetSendingStatus(const bool sending) { | 334 int32_t ModuleRtpRtcpImpl::SetSendingStatus(const bool sending) { |
340 if (rtcp_sender_.Sending() != sending) { | 335 if (rtcp_sender_.Sending() != sending) { |
341 // Sends RTCP BYE when going from true to false | 336 // Sends RTCP BYE when going from true to false |
342 if (rtcp_sender_.SetSendingStatus(GetFeedbackState(), sending) != 0) { | 337 if (rtcp_sender_.SetSendingStatus(GetFeedbackState(), sending) != 0) { |
343 LOG(LS_WARNING) << "Failed to send RTCP BYE"; | 338 LOG(LS_WARNING) << "Failed to send RTCP BYE"; |
344 } | 339 } |
345 | 340 |
346 collision_detected_ = false; | 341 collision_detected_ = false; |
347 | 342 |
348 // Generate a new SSRC for the next "call" if false | 343 // Generate a new SSRC for the next "call" if false |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 933 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
939 StreamDataCountersCallback* callback) { | 934 StreamDataCountersCallback* callback) { |
940 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 935 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
941 } | 936 } |
942 | 937 |
943 StreamDataCountersCallback* | 938 StreamDataCountersCallback* |
944 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 939 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
945 return rtp_sender_.GetRtpStatisticsCallback(); | 940 return rtp_sender_.GetRtpStatisticsCallback(); |
946 } | 941 } |
947 } // namespace webrtc | 942 } // namespace webrtc |
OLD | NEW |