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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } | 111 virtual void SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } |
112 | 112 |
113 DeliveryStatus DeliverPacket(MediaType media_type, | 113 DeliveryStatus DeliverPacket(MediaType media_type, |
114 const uint8_t* packet, | 114 const uint8_t* packet, |
115 size_t length, | 115 size_t length, |
116 const PacketTime& packet_time) override { | 116 const PacketTime& packet_time) override { |
117 RtpUtility::RtpHeaderParser parser(packet, length); | 117 RtpUtility::RtpHeaderParser parser(packet, length); |
118 RTPHeader header; | 118 RTPHeader header; |
119 parser.Parse(header); | 119 parser.Parse(&header); |
120 { | 120 { |
121 rtc::CritScope lock(&crit_); | 121 rtc::CritScope lock(&crit_); |
122 recv_times_[header.timestamp - rtp_timestamp_delta_] = | 122 recv_times_[header.timestamp - rtp_timestamp_delta_] = |
123 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 123 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
124 } | 124 } |
125 | 125 |
126 return receiver_->DeliverPacket(media_type, packet, length, packet_time); | 126 return receiver_->DeliverPacket(media_type, packet, length, packet_time); |
127 } | 127 } |
128 | 128 |
129 // EncodingTimeObserver. | 129 // EncodingTimeObserver. |
(...skipping 15 matching lines...) Expand all Loading... |
145 } | 145 } |
146 | 146 |
147 input_->IncomingCapturedFrame(video_frame); | 147 input_->IncomingCapturedFrame(video_frame); |
148 } | 148 } |
149 | 149 |
150 bool SendRtp(const uint8_t* packet, | 150 bool SendRtp(const uint8_t* packet, |
151 size_t length, | 151 size_t length, |
152 const PacketOptions& options) override { | 152 const PacketOptions& options) override { |
153 RtpUtility::RtpHeaderParser parser(packet, length); | 153 RtpUtility::RtpHeaderParser parser(packet, length); |
154 RTPHeader header; | 154 RTPHeader header; |
155 parser.Parse(header); | 155 parser.Parse(&header); |
156 | 156 |
157 int64_t current_time = | 157 int64_t current_time = |
158 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); | 158 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); |
159 bool result = transport_->SendRtp(packet, length, options); | 159 bool result = transport_->SendRtp(packet, length, options); |
160 { | 160 { |
161 rtc::CritScope lock(&crit_); | 161 rtc::CritScope lock(&crit_); |
162 if (rtp_timestamp_delta_ == 0) { | 162 if (rtp_timestamp_delta_ == 0) { |
163 rtp_timestamp_delta_ = header.timestamp - first_send_frame_.timestamp(); | 163 rtp_timestamp_delta_ = header.timestamp - first_send_frame_.timestamp(); |
164 first_send_frame_.Reset(); | 164 first_send_frame_.Reset(); |
165 } | 165 } |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 video_send_stream_->Stop(); | 1064 video_send_stream_->Stop(); |
1065 receive_stream->Stop(); | 1065 receive_stream->Stop(); |
1066 | 1066 |
1067 call->DestroyVideoReceiveStream(receive_stream); | 1067 call->DestroyVideoReceiveStream(receive_stream); |
1068 call->DestroyVideoSendStream(video_send_stream_); | 1068 call->DestroyVideoSendStream(video_send_stream_); |
1069 | 1069 |
1070 transport.StopSending(); | 1070 transport.StopSending(); |
1071 } | 1071 } |
1072 | 1072 |
1073 } // namespace webrtc | 1073 } // namespace webrtc |
OLD | NEW |