OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const PacketOptions& options) override { | 154 const PacketOptions& options) override { |
155 RtpUtility::RtpHeaderParser parser(packet, length); | 155 RtpUtility::RtpHeaderParser parser(packet, length); |
156 RTPHeader header; | 156 RTPHeader header; |
157 parser.Parse(&header); | 157 parser.Parse(&header); |
158 | 158 |
159 int64_t current_time = | 159 int64_t current_time = |
160 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 160 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
161 bool result = transport_->SendRtp(packet, length, options); | 161 bool result = transport_->SendRtp(packet, length, options); |
162 { | 162 { |
163 rtc::CritScope lock(&crit_); | 163 rtc::CritScope lock(&crit_); |
164 int64_t timestamp = wrap_handler_.Unwrap(header.timestamp); | |
165 | 164 |
166 if (rtp_timestamp_delta_ == 0) { | 165 if (rtp_timestamp_delta_ == 0) { |
167 rtp_timestamp_delta_ = timestamp - first_send_frame_.timestamp(); | 166 rtp_timestamp_delta_ = header.timestamp - first_send_frame_.timestamp(); |
168 first_send_frame_.Reset(); | 167 first_send_frame_.Reset(); |
169 } | 168 } |
170 timestamp -= rtp_timestamp_delta_; | 169 int64_t timestamp = |
| 170 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); |
171 send_times_[timestamp] = current_time; | 171 send_times_[timestamp] = current_time; |
172 if (!transport_->DiscardedLastPacket() && | 172 if (!transport_->DiscardedLastPacket() && |
173 header.ssrc == ssrc_to_analyze_) { | 173 header.ssrc == ssrc_to_analyze_) { |
174 encoded_frame_sizes_[timestamp] += | 174 encoded_frame_sizes_[timestamp] += |
175 length - (header.headerLength + header.paddingLength); | 175 length - (header.headerLength + header.paddingLength); |
176 } | 176 } |
177 } | 177 } |
178 return result; | 178 return result; |
179 } | 179 } |
180 | 180 |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 video_send_stream_->Stop(); | 1095 video_send_stream_->Stop(); |
1096 receive_stream->Stop(); | 1096 receive_stream->Stop(); |
1097 | 1097 |
1098 call->DestroyVideoReceiveStream(receive_stream); | 1098 call->DestroyVideoReceiveStream(receive_stream); |
1099 call->DestroyVideoSendStream(video_send_stream_); | 1099 call->DestroyVideoSendStream(video_send_stream_); |
1100 | 1100 |
1101 transport.StopSending(); | 1101 transport.StopSending(); |
1102 } | 1102 } |
1103 | 1103 |
1104 } // namespace webrtc | 1104 } // namespace webrtc |
OLD | NEW |