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 | 10 |
(...skipping 69 matching lines...) Loading... |
80 void AudioReceiveStream::Stop() { | 80 void AudioReceiveStream::Stop() { |
81 } | 81 } |
82 | 82 |
83 void AudioReceiveStream::SignalNetworkState(NetworkState state) { | 83 void AudioReceiveStream::SignalNetworkState(NetworkState state) { |
84 } | 84 } |
85 | 85 |
86 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 86 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, size_t length) { | 90 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, |
| 91 size_t length, |
| 92 const PacketTime& packet_time) { |
91 RTPHeader header; | 93 RTPHeader header; |
92 | 94 |
93 if (!rtp_header_parser_->Parse(packet, length, &header)) { | 95 if (!rtp_header_parser_->Parse(packet, length, &header)) { |
94 return false; | 96 return false; |
95 } | 97 } |
96 | 98 |
97 // Only forward if the parsed header has absolute sender time. RTP timestamps | 99 // Only forward if the parsed header has absolute sender time. RTP timestamps |
98 // may have different rates for audio and video and shouldn't be mixed. | 100 // may have different rates for audio and video and shouldn't be mixed. |
99 if (config_.combined_audio_video_bwe && | 101 if (config_.combined_audio_video_bwe && |
100 header.extension.hasAbsoluteSendTime) { | 102 header.extension.hasAbsoluteSendTime) { |
101 int64_t arrival_time_ms = TickTime::MillisecondTimestamp(); | 103 int64_t arrival_time_ms = TickTime::MillisecondTimestamp(); |
| 104 if (packet_time.timestamp >= 0) |
| 105 arrival_time_ms = packet_time.timestamp; |
102 size_t payload_size = length - header.headerLength; | 106 size_t payload_size = length - header.headerLength; |
103 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, | 107 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, |
104 header, false); | 108 header, false); |
105 } | 109 } |
106 return true; | 110 return true; |
107 } | 111 } |
108 } // namespace internal | 112 } // namespace internal |
109 } // namespace webrtc | 113 } // namespace webrtc |
OLD | NEW |