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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 const PacketTime& packet_time) { | 263 const PacketTime& packet_time) { |
264 // TODO(solenberg): Tests call this function on a network thread, libjingle | 264 // TODO(solenberg): Tests call this function on a network thread, libjingle |
265 // calls on the worker thread. We should move towards always using a network | 265 // calls on the worker thread. We should move towards always using a network |
266 // thread. Then this check can be enabled. | 266 // thread. Then this check can be enabled. |
267 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); | 267 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); |
268 RTPHeader header; | 268 RTPHeader header; |
269 if (!rtp_header_parser_->Parse(packet, length, &header)) { | 269 if (!rtp_header_parser_->Parse(packet, length, &header)) { |
270 return false; | 270 return false; |
271 } | 271 } |
272 | 272 |
273 // Only forward if the parsed header has one of the headers necessary for | |
274 // bandwidth estimation. RTP timestamps has different rates for audio and | |
275 // video and shouldn't be mixed. | |
276 if (config_.rtp.transport_cc && | |
277 header.extension.hasTransportSequenceNumber) { | |
278 int64_t arrival_time_ms = rtc::TimeMillis(); | |
279 if (packet_time.timestamp >= 0) | |
280 arrival_time_ms = (packet_time.timestamp + 500) / 1000; | |
281 size_t payload_size = length - header.headerLength; | |
282 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, | |
283 header); | |
284 } | |
285 | |
286 return channel_proxy_->ReceivedRTPPacket(packet, length, packet_time); | 273 return channel_proxy_->ReceivedRTPPacket(packet, length, packet_time); |
287 } | 274 } |
288 | 275 |
289 AudioMixer::Source::AudioFrameInfo AudioReceiveStream::GetAudioFrameWithInfo( | 276 AudioMixer::Source::AudioFrameInfo AudioReceiveStream::GetAudioFrameWithInfo( |
290 int sample_rate_hz, | 277 int sample_rate_hz, |
291 AudioFrame* audio_frame) { | 278 AudioFrame* audio_frame) { |
292 return channel_proxy_->GetAudioFrameWithInfo(sample_rate_hz, audio_frame); | 279 return channel_proxy_->GetAudioFrameWithInfo(sample_rate_hz, audio_frame); |
293 } | 280 } |
294 | 281 |
295 int AudioReceiveStream::PreferredSampleRate() const { | 282 int AudioReceiveStream::PreferredSampleRate() const { |
(...skipping 20 matching lines...) Expand all Loading... |
316 ScopedVoEInterface<VoEBase> base(voice_engine()); | 303 ScopedVoEInterface<VoEBase> base(voice_engine()); |
317 if (playout) { | 304 if (playout) { |
318 return base->StartPlayout(config_.voe_channel_id); | 305 return base->StartPlayout(config_.voe_channel_id); |
319 } else { | 306 } else { |
320 return base->StopPlayout(config_.voe_channel_id); | 307 return base->StopPlayout(config_.voe_channel_id); |
321 } | 308 } |
322 } | 309 } |
323 | 310 |
324 } // namespace internal | 311 } // namespace internal |
325 } // namespace webrtc | 312 } // namespace webrtc |
OLD | NEW |