Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2260 sinfo.residual_echo_likelihood_recent_max = | 2260 sinfo.residual_echo_likelihood_recent_max = |
| 2261 stats.residual_echo_likelihood_recent_max; | 2261 stats.residual_echo_likelihood_recent_max; |
| 2262 sinfo.typing_noise_detected = (send_ ? stats.typing_noise_detected : false); | 2262 sinfo.typing_noise_detected = (send_ ? stats.typing_noise_detected : false); |
| 2263 sinfo.ana_statistics = stats.ana_statistics; | 2263 sinfo.ana_statistics = stats.ana_statistics; |
| 2264 info->senders.push_back(sinfo); | 2264 info->senders.push_back(sinfo); |
| 2265 } | 2265 } |
| 2266 | 2266 |
| 2267 // Get SSRC and stats for each receiver. | 2267 // Get SSRC and stats for each receiver. |
| 2268 RTC_DCHECK_EQ(info->receivers.size(), 0U); | 2268 RTC_DCHECK_EQ(info->receivers.size(), 0U); |
| 2269 for (const auto& stream : recv_streams_) { | 2269 for (const auto& stream : recv_streams_) { |
| 2270 uint32_t ssrc = stream.first; | |
| 2271 // When SSRCs are unsignaled, there's only one audio MediaStreamTrack, but | |
| 2272 // multiple RTP streams can be received over time (if the SSRC changes for | |
| 2273 // whatever reason). We only want the RTCMediaStreamTrackStats to represent | |
| 2274 // the stats for the most recent stream (the one whose audio is actually | |
| 2275 // routed to the MediaStreamTrack), so here we ignore any unsignaled SSRCs | |
| 2276 // except for the most recent one (last in the vector). This is somewhat of | |
| 2277 // a hack, and means you don't get *any* stats for these inactive streams, | |
| 2278 // but it's slightly better than the previous behavior, which was "highest | |
| 2279 // SSRC wins". | |
| 2280 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8158 | |
| 2281 if (!unsignaled_recv_ssrcs_.empty() && | |
| 2282 std::find(unsignaled_recv_ssrcs_.begin(), | |
| 2283 --unsignaled_recv_ssrcs_.end(), | |
|
the sun
2017/09/18 18:59:35
nit: I would've done it
auto end_it = --unsignale
Taylor Brandstetter
2017/09/20 00:19:45
Can't quite do that since if the list is empty end
| |
| 2284 ssrc) != --unsignaled_recv_ssrcs_.end()) { | |
| 2285 continue; | |
| 2286 } | |
| 2270 webrtc::AudioReceiveStream::Stats stats = stream.second->GetStats(); | 2287 webrtc::AudioReceiveStream::Stats stats = stream.second->GetStats(); |
| 2271 VoiceReceiverInfo rinfo; | 2288 VoiceReceiverInfo rinfo; |
| 2272 rinfo.add_ssrc(stats.remote_ssrc); | 2289 rinfo.add_ssrc(stats.remote_ssrc); |
| 2273 rinfo.bytes_rcvd = stats.bytes_rcvd; | 2290 rinfo.bytes_rcvd = stats.bytes_rcvd; |
| 2274 rinfo.packets_rcvd = stats.packets_rcvd; | 2291 rinfo.packets_rcvd = stats.packets_rcvd; |
| 2275 rinfo.packets_lost = stats.packets_lost; | 2292 rinfo.packets_lost = stats.packets_lost; |
| 2276 rinfo.fraction_lost = stats.fraction_lost; | 2293 rinfo.fraction_lost = stats.fraction_lost; |
| 2277 rinfo.codec_name = stats.codec_name; | 2294 rinfo.codec_name = stats.codec_name; |
| 2278 rinfo.codec_payload_type = stats.codec_payload_type; | 2295 rinfo.codec_payload_type = stats.codec_payload_type; |
| 2279 rinfo.ext_seqnum = stats.ext_seqnum; | 2296 rinfo.ext_seqnum = stats.ext_seqnum; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2377 ssrc); | 2394 ssrc); |
| 2378 if (it != unsignaled_recv_ssrcs_.end()) { | 2395 if (it != unsignaled_recv_ssrcs_.end()) { |
| 2379 unsignaled_recv_ssrcs_.erase(it); | 2396 unsignaled_recv_ssrcs_.erase(it); |
| 2380 return true; | 2397 return true; |
| 2381 } | 2398 } |
| 2382 return false; | 2399 return false; |
| 2383 } | 2400 } |
| 2384 } // namespace cricket | 2401 } // namespace cricket |
| 2385 | 2402 |
| 2386 #endif // HAVE_WEBRTC_VOICE | 2403 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |