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 28 matching lines...) Expand all Loading... |
39 return kRtpExtensionVideoRotation; | 39 return kRtpExtensionVideoRotation; |
40 if (extension == RtpExtension::kTransportSequenceNumberUri) | 40 if (extension == RtpExtension::kTransportSequenceNumberUri) |
41 return kRtpExtensionTransportSequenceNumber; | 41 return kRtpExtensionTransportSequenceNumber; |
42 if (extension == RtpExtension::kPlayoutDelayUri) | 42 if (extension == RtpExtension::kPlayoutDelayUri) |
43 return kRtpExtensionPlayoutDelay; | 43 return kRtpExtensionPlayoutDelay; |
44 RTC_NOTREACHED() << "Looking up unsupported RTP extension."; | 44 RTC_NOTREACHED() << "Looking up unsupported RTP extension."; |
45 return kRtpExtensionNone; | 45 return kRtpExtensionNone; |
46 } | 46 } |
47 | 47 |
48 RtpRtcp::Configuration::Configuration() | 48 RtpRtcp::Configuration::Configuration() |
49 : audio(false), | 49 : receive_statistics(NullObjectReceiveStatistics()) {} |
50 receiver_only(false), | |
51 clock(nullptr), | |
52 receive_statistics(NullObjectReceiveStatistics()), | |
53 outgoing_transport(nullptr), | |
54 intra_frame_callback(nullptr), | |
55 bandwidth_callback(nullptr), | |
56 transport_feedback_callback(nullptr), | |
57 rtt_stats(nullptr), | |
58 rtcp_packet_type_counter_observer(nullptr), | |
59 remote_bitrate_estimator(nullptr), | |
60 paced_sender(nullptr), | |
61 transport_sequence_number_allocator(nullptr), | |
62 send_bitrate_observer(nullptr), | |
63 send_frame_count_observer(nullptr), | |
64 send_side_delay_observer(nullptr), | |
65 event_log(nullptr), | |
66 send_packet_observer(nullptr) {} | |
67 | 50 |
68 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { | 51 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { |
69 if (configuration.clock) { | 52 if (configuration.clock) { |
70 return new ModuleRtpRtcpImpl(configuration); | 53 return new ModuleRtpRtcpImpl(configuration); |
71 } else { | 54 } else { |
72 // No clock implementation provided, use default clock. | 55 // No clock implementation provided, use default clock. |
73 RtpRtcp::Configuration configuration_copy; | 56 RtpRtcp::Configuration configuration_copy; |
74 memcpy(&configuration_copy, &configuration, | 57 memcpy(&configuration_copy, &configuration, |
75 sizeof(RtpRtcp::Configuration)); | 58 sizeof(RtpRtcp::Configuration)); |
76 configuration_copy.clock = Clock::GetRealTimeClock(); | 59 configuration_copy.clock = Clock::GetRealTimeClock(); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 } | 392 } |
410 | 393 |
411 int32_t ModuleRtpRtcpImpl::SendOutgoingData( | 394 int32_t ModuleRtpRtcpImpl::SendOutgoingData( |
412 FrameType frame_type, | 395 FrameType frame_type, |
413 int8_t payload_type, | 396 int8_t payload_type, |
414 uint32_t time_stamp, | 397 uint32_t time_stamp, |
415 int64_t capture_time_ms, | 398 int64_t capture_time_ms, |
416 const uint8_t* payload_data, | 399 const uint8_t* payload_data, |
417 size_t payload_size, | 400 size_t payload_size, |
418 const RTPFragmentationHeader* fragmentation, | 401 const RTPFragmentationHeader* fragmentation, |
419 const RTPVideoHeader* rtp_video_hdr) { | 402 const RTPVideoHeader* rtp_video_header) { |
420 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); | 403 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); |
421 // Make sure an RTCP report isn't queued behind a key frame. | 404 // Make sure an RTCP report isn't queued behind a key frame. |
422 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { | 405 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { |
423 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); | 406 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); |
424 } | 407 } |
425 return rtp_sender_.SendOutgoingData( | 408 return rtp_sender_.SendOutgoingData( |
426 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, | 409 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, |
427 payload_size, fragmentation, rtp_video_hdr); | 410 payload_size, fragmentation, rtp_video_header); |
428 } | 411 } |
429 | 412 |
430 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, | 413 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, |
431 uint16_t sequence_number, | 414 uint16_t sequence_number, |
432 int64_t capture_time_ms, | 415 int64_t capture_time_ms, |
433 bool retransmission, | 416 bool retransmission, |
434 int probe_cluster_id) { | 417 int probe_cluster_id) { |
435 if (SendingMedia() && ssrc == rtp_sender_.SSRC()) { | 418 if (SendingMedia() && ssrc == rtp_sender_.SSRC()) { |
436 return rtp_sender_.TimeToSendPacket(sequence_number, capture_time_ms, | 419 return rtp_sender_.TimeToSendPacket(sequence_number, capture_time_ms, |
437 retransmission, probe_cluster_id); | 420 retransmission, probe_cluster_id); |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 979 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
997 StreamDataCountersCallback* callback) { | 980 StreamDataCountersCallback* callback) { |
998 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 981 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
999 } | 982 } |
1000 | 983 |
1001 StreamDataCountersCallback* | 984 StreamDataCountersCallback* |
1002 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 985 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
1003 return rtp_sender_.GetRtpStatisticsCallback(); | 986 return rtp_sender_.GetRtpStatisticsCallback(); |
1004 } | 987 } |
1005 } // namespace webrtc | 988 } // namespace webrtc |
OLD | NEW |