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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
12 | 12 |
13 #include <stdlib.h> // srand | 13 #include <stdlib.h> // srand |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <utility> | 15 #include <utility> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/base/trace_event.h" | 19 #include "webrtc/base/trace_event.h" |
| 20 #include "webrtc/base/timeutils.h" |
20 #include "webrtc/call.h" | 21 #include "webrtc/call.h" |
21 #include "webrtc/call/rtc_event_log.h" | 22 #include "webrtc/call/rtc_event_log.h" |
22 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" | 23 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
23 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 24 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
24 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_audio.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_sender_video.h" |
26 #include "webrtc/modules/rtp_rtcp/source/time_util.h" | 27 #include "webrtc/modules/rtp_rtcp/source/time_util.h" |
27 #include "webrtc/system_wrappers/include/tick_util.h" | |
28 | 28 |
29 namespace webrtc { | 29 namespace webrtc { |
30 | 30 |
31 // Max in the RFC 3550 is 255 bytes, we limit it to be modulus 32 for SRTP. | 31 // Max in the RFC 3550 is 255 bytes, we limit it to be modulus 32 for SRTP. |
32 static const size_t kMaxPaddingLength = 224; | 32 static const size_t kMaxPaddingLength = 224; |
33 static const int kSendSideDelayWindowMs = 1000; | 33 static const int kSendSideDelayWindowMs = 1000; |
34 static const uint32_t kAbsSendTimeFraction = 18; | 34 static const uint32_t kAbsSendTimeFraction = 18; |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 Transport* transport, | 109 Transport* transport, |
110 RtpPacketSender* paced_sender, | 110 RtpPacketSender* paced_sender, |
111 TransportSequenceNumberAllocator* sequence_number_allocator, | 111 TransportSequenceNumberAllocator* sequence_number_allocator, |
112 TransportFeedbackObserver* transport_feedback_observer, | 112 TransportFeedbackObserver* transport_feedback_observer, |
113 BitrateStatisticsObserver* bitrate_callback, | 113 BitrateStatisticsObserver* bitrate_callback, |
114 FrameCountObserver* frame_count_observer, | 114 FrameCountObserver* frame_count_observer, |
115 SendSideDelayObserver* send_side_delay_observer, | 115 SendSideDelayObserver* send_side_delay_observer, |
116 RtcEventLog* event_log, | 116 RtcEventLog* event_log, |
117 SendPacketObserver* send_packet_observer) | 117 SendPacketObserver* send_packet_observer) |
118 : clock_(clock), | 118 : clock_(clock), |
119 // TODO(holmer): Remove this conversion when we remove the use of | 119 // TODO(holmer): Remove this conversion? |
120 // TickTime. | 120 clock_delta_ms_(clock_->TimeInMilliseconds() - rtc::TimeMillis()), |
121 clock_delta_ms_(clock_->TimeInMilliseconds() - | |
122 TickTime::MillisecondTimestamp()), | |
123 random_(clock_->TimeInMicroseconds()), | 121 random_(clock_->TimeInMicroseconds()), |
124 bitrates_(bitrate_callback), | 122 bitrates_(bitrate_callback), |
125 total_bitrate_sent_(clock, bitrates_.total_bitrate_observer()), | 123 total_bitrate_sent_(clock, bitrates_.total_bitrate_observer()), |
126 audio_configured_(audio), | 124 audio_configured_(audio), |
127 audio_(audio ? new RTPSenderAudio(clock, this) : nullptr), | 125 audio_(audio ? new RTPSenderAudio(clock, this) : nullptr), |
128 video_(audio ? nullptr : new RTPSenderVideo(clock, this)), | 126 video_(audio ? nullptr : new RTPSenderVideo(clock, this)), |
129 paced_sender_(paced_sender), | 127 paced_sender_(paced_sender), |
130 transport_sequence_number_allocator_(sequence_number_allocator), | 128 transport_sequence_number_allocator_(sequence_number_allocator), |
131 transport_feedback_observer_(transport_feedback_observer), | 129 transport_feedback_observer_(transport_feedback_observer), |
132 last_capture_time_ms_sent_(0), | 130 last_capture_time_ms_sent_(0), |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 rtc::CritScope lock(&send_critsect_); | 1911 rtc::CritScope lock(&send_critsect_); |
1914 | 1912 |
1915 RtpState state; | 1913 RtpState state; |
1916 state.sequence_number = sequence_number_rtx_; | 1914 state.sequence_number = sequence_number_rtx_; |
1917 state.start_timestamp = start_timestamp_; | 1915 state.start_timestamp = start_timestamp_; |
1918 | 1916 |
1919 return state; | 1917 return state; |
1920 } | 1918 } |
1921 | 1919 |
1922 } // namespace webrtc | 1920 } // namespace webrtc |
OLD | NEW |