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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 | 143 |
144 void AudioReceiveStream::SignalNetworkState(NetworkState state) { | 144 void AudioReceiveStream::SignalNetworkState(NetworkState state) { |
145 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 145 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
146 } | 146 } |
147 | 147 |
148 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 148 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
149 // TODO(solenberg): Tests call this function on a network thread, libjingle | 149 // TODO(solenberg): Tests call this function on a network thread, libjingle |
150 // calls on the worker thread. We should move towards always using a network | 150 // calls on the worker thread. We should move towards always using a network |
151 // thread. Then this check can be enabled. | 151 // thread. Then this check can be enabled. |
152 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); | 152 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); |
153 return false; | 153 return channel_proxy_->ReceivedRTCPPacket(static_cast<const uint8_t*>(packet), |
the sun
2016/04/22 12:40:31
Looks like this cast is not needed anymore?
mflodman
2016/04/27 13:42:17
Doh!
| |
154 length) == 0; | |
154 } | 155 } |
155 | 156 |
156 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, | 157 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, |
157 size_t length, | 158 size_t length, |
158 const PacketTime& packet_time) { | 159 const PacketTime& packet_time) { |
159 // TODO(solenberg): Tests call this function on a network thread, libjingle | 160 // TODO(solenberg): Tests call this function on a network thread, libjingle |
160 // calls on the worker thread. We should move towards always using a network | 161 // calls on the worker thread. We should move towards always using a network |
161 // thread. Then this check can be enabled. | 162 // thread. Then this check can be enabled. |
162 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); | 163 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); |
163 RTPHeader header; | 164 RTPHeader header; |
164 if (!rtp_header_parser_->Parse(packet, length, &header)) { | 165 if (!rtp_header_parser_->Parse(packet, length, &header)) { |
165 return false; | 166 return false; |
166 } | 167 } |
167 | 168 |
168 // Only forward if the parsed header has one of the headers necessary for | 169 // Only forward if the parsed header has one of the headers necessary for |
169 // bandwidth estimation. RTP timestamps has different rates for audio and | 170 // bandwidth estimation. RTP timestamps has different rates for audio and |
170 // video and shouldn't be mixed. | 171 // video and shouldn't be mixed. |
171 if (remote_bitrate_estimator_ && | 172 if (remote_bitrate_estimator_ && |
172 header.extension.hasTransportSequenceNumber) { | 173 header.extension.hasTransportSequenceNumber) { |
173 int64_t arrival_time_ms = TickTime::MillisecondTimestamp(); | 174 int64_t arrival_time_ms = TickTime::MillisecondTimestamp(); |
174 if (packet_time.timestamp >= 0) | 175 if (packet_time.timestamp >= 0) |
175 arrival_time_ms = (packet_time.timestamp + 500) / 1000; | 176 arrival_time_ms = (packet_time.timestamp + 500) / 1000; |
176 size_t payload_size = length - header.headerLength; | 177 size_t payload_size = length - header.headerLength; |
177 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, | 178 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size, |
the sun
2016/04/22 12:40:31
stefan: is it still appropriate to fork packets of
mflodman
2016/04/27 13:42:17
For video this is done in ViEReciever, that we're
the sun
2016/04/28 09:15:56
ok, just wanted to make sure we won't magically se
stefan-webrtc
2016/04/28 09:27:48
Should be fine, and I also prefer it being done th
| |
178 header, false); | 179 header, false); |
179 } | 180 } |
180 return true; | 181 |
182 return channel_proxy_->ReceivedRTPPacket(packet, length, packet_time); | |
the sun
2016/04/22 12:40:31
VoE::ReceivedRTPPacket() will:
if ((length < 12)
mflodman
2016/04/27 13:42:17
Channel::ReceivedRTPPacket is calling rtp_header_p
the sun
2016/04/28 09:15:56
Yes, please add the check in Channel::ReceivedRTPP
| |
181 } | 183 } |
182 | 184 |
183 webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats() const { | 185 webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats() const { |
184 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 186 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
185 webrtc::AudioReceiveStream::Stats stats; | 187 webrtc::AudioReceiveStream::Stats stats; |
186 stats.remote_ssrc = config_.rtp.remote_ssrc; | 188 stats.remote_ssrc = config_.rtp.remote_ssrc; |
187 ScopedVoEInterface<VoECodec> codec(voice_engine()); | 189 ScopedVoEInterface<VoECodec> codec(voice_engine()); |
188 | 190 |
189 webrtc::CallStatistics call_stats = channel_proxy_->GetRTCPStatistics(); | 191 webrtc::CallStatistics call_stats = channel_proxy_->GetRTCPStatistics(); |
190 webrtc::CodecInst codec_inst = {0}; | 192 webrtc::CodecInst codec_inst = {0}; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 | 242 |
241 VoiceEngine* AudioReceiveStream::voice_engine() const { | 243 VoiceEngine* AudioReceiveStream::voice_engine() const { |
242 internal::AudioState* audio_state = | 244 internal::AudioState* audio_state = |
243 static_cast<internal::AudioState*>(audio_state_.get()); | 245 static_cast<internal::AudioState*>(audio_state_.get()); |
244 VoiceEngine* voice_engine = audio_state->voice_engine(); | 246 VoiceEngine* voice_engine = audio_state->voice_engine(); |
245 RTC_DCHECK(voice_engine); | 247 RTC_DCHECK(voice_engine); |
246 return voice_engine; | 248 return voice_engine; |
247 } | 249 } |
248 } // namespace internal | 250 } // namespace internal |
249 } // namespace webrtc | 251 } // namespace webrtc |
OLD | NEW |