| 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 25 matching lines...) Expand all Loading... |
| 36 bandwidth_callback(nullptr), | 36 bandwidth_callback(nullptr), |
| 37 transport_feedback_callback(nullptr), | 37 transport_feedback_callback(nullptr), |
| 38 rtt_stats(nullptr), | 38 rtt_stats(nullptr), |
| 39 rtcp_packet_type_counter_observer(nullptr), | 39 rtcp_packet_type_counter_observer(nullptr), |
| 40 audio_messages(NullObjectRtpAudioFeedback()), | 40 audio_messages(NullObjectRtpAudioFeedback()), |
| 41 remote_bitrate_estimator(nullptr), | 41 remote_bitrate_estimator(nullptr), |
| 42 paced_sender(nullptr), | 42 paced_sender(nullptr), |
| 43 transport_sequence_number_allocator(nullptr), | 43 transport_sequence_number_allocator(nullptr), |
| 44 send_bitrate_observer(nullptr), | 44 send_bitrate_observer(nullptr), |
| 45 send_frame_count_observer(nullptr), | 45 send_frame_count_observer(nullptr), |
| 46 send_side_delay_observer(nullptr), | 46 send_side_delay_observer(nullptr) {} |
| 47 event_log(nullptr) {} | |
| 48 | 47 |
| 49 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { | 48 RtpRtcp* RtpRtcp::CreateRtpRtcp(const RtpRtcp::Configuration& configuration) { |
| 50 if (configuration.clock) { | 49 if (configuration.clock) { |
| 51 return new ModuleRtpRtcpImpl(configuration); | 50 return new ModuleRtpRtcpImpl(configuration); |
| 52 } else { | 51 } else { |
| 53 // No clock implementation provided, use default clock. | 52 // No clock implementation provided, use default clock. |
| 54 RtpRtcp::Configuration configuration_copy; | 53 RtpRtcp::Configuration configuration_copy; |
| 55 memcpy(&configuration_copy, &configuration, | 54 memcpy(&configuration_copy, &configuration, |
| 56 sizeof(RtpRtcp::Configuration)); | 55 sizeof(RtpRtcp::Configuration)); |
| 57 configuration_copy.clock = Clock::GetRealTimeClock(); | 56 configuration_copy.clock = Clock::GetRealTimeClock(); |
| 58 return new ModuleRtpRtcpImpl(configuration_copy); | 57 return new ModuleRtpRtcpImpl(configuration_copy); |
| 59 } | 58 } |
| 60 } | 59 } |
| 61 | 60 |
| 62 ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration) | 61 ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration) |
| 63 : rtp_sender_(configuration.audio, | 62 : rtp_sender_(configuration.audio, |
| 64 configuration.clock, | 63 configuration.clock, |
| 65 configuration.outgoing_transport, | 64 configuration.outgoing_transport, |
| 66 configuration.audio_messages, | 65 configuration.audio_messages, |
| 67 configuration.paced_sender, | 66 configuration.paced_sender, |
| 68 configuration.transport_sequence_number_allocator, | 67 configuration.transport_sequence_number_allocator, |
| 69 configuration.transport_feedback_callback, | 68 configuration.transport_feedback_callback, |
| 70 configuration.send_bitrate_observer, | 69 configuration.send_bitrate_observer, |
| 71 configuration.send_frame_count_observer, | 70 configuration.send_frame_count_observer, |
| 72 configuration.send_side_delay_observer, | 71 configuration.send_side_delay_observer), |
| 73 configuration.event_log), | |
| 74 rtcp_sender_(configuration.audio, | 72 rtcp_sender_(configuration.audio, |
| 75 configuration.clock, | 73 configuration.clock, |
| 76 configuration.receive_statistics, | 74 configuration.receive_statistics, |
| 77 configuration.rtcp_packet_type_counter_observer, | 75 configuration.rtcp_packet_type_counter_observer, |
| 78 configuration.event_log, | |
| 79 configuration.outgoing_transport), | 76 configuration.outgoing_transport), |
| 80 rtcp_receiver_(configuration.clock, | 77 rtcp_receiver_(configuration.clock, |
| 81 configuration.receiver_only, | 78 configuration.receiver_only, |
| 82 configuration.rtcp_packet_type_counter_observer, | 79 configuration.rtcp_packet_type_counter_observer, |
| 83 configuration.bandwidth_callback, | 80 configuration.bandwidth_callback, |
| 84 configuration.intra_frame_callback, | 81 configuration.intra_frame_callback, |
| 85 configuration.transport_feedback_callback, | 82 configuration.transport_feedback_callback, |
| 86 this), | 83 this), |
| 87 clock_(configuration.clock), | 84 clock_(configuration.clock), |
| 88 audio_(configuration.audio), | 85 audio_(configuration.audio), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 102 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), | 99 critical_section_rtt_(CriticalSectionWrapper::CreateCriticalSection()), |
| 103 rtt_ms_(0) { | 100 rtt_ms_(0) { |
| 104 send_video_codec_.codecType = kVideoCodecUnknown; | 101 send_video_codec_.codecType = kVideoCodecUnknown; |
| 105 | 102 |
| 106 // Make sure that RTCP objects are aware of our SSRC. | 103 // Make sure that RTCP objects are aware of our SSRC. |
| 107 uint32_t SSRC = rtp_sender_.SSRC(); | 104 uint32_t SSRC = rtp_sender_.SSRC(); |
| 108 rtcp_sender_.SetSSRC(SSRC); | 105 rtcp_sender_.SetSSRC(SSRC); |
| 109 SetRtcpReceiverSsrcs(SSRC); | 106 SetRtcpReceiverSsrcs(SSRC); |
| 110 } | 107 } |
| 111 | 108 |
| 109 void ModuleRtpRtcpImpl::SetRtcEventLog(webrtc::RtcEventLog* event_log) { |
| 110 rtp_sender_.SetRtcEventLog(event_log); |
| 111 rtcp_sender_.SetRtcEventLog(event_log); |
| 112 } |
| 113 |
| 112 // Returns the number of milliseconds until the module want a worker thread | 114 // Returns the number of milliseconds until the module want a worker thread |
| 113 // to call Process. | 115 // to call Process. |
| 114 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { | 116 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { |
| 115 const int64_t now = clock_->TimeInMilliseconds(); | 117 const int64_t now = clock_->TimeInMilliseconds(); |
| 116 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; | 118 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; |
| 117 return kRtpRtcpMaxIdleTimeProcessMs - (now - last_process_time_); | 119 return kRtpRtcpMaxIdleTimeProcessMs - (now - last_process_time_); |
| 118 } | 120 } |
| 119 | 121 |
| 120 // Process any pending tasks such as timeouts (non time critical events). | 122 // Process any pending tasks such as timeouts (non time critical events). |
| 121 void ModuleRtpRtcpImpl::Process() { | 123 void ModuleRtpRtcpImpl::Process() { |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 979 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
| 978 StreamDataCountersCallback* callback) { | 980 StreamDataCountersCallback* callback) { |
| 979 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 981 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
| 980 } | 982 } |
| 981 | 983 |
| 982 StreamDataCountersCallback* | 984 StreamDataCountersCallback* |
| 983 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 985 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
| 984 return rtp_sender_.GetRtpStatisticsCallback(); | 986 return rtp_sender_.GetRtpStatisticsCallback(); |
| 985 } | 987 } |
| 986 } // namespace webrtc | 988 } // namespace webrtc |
| OLD | NEW |