| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 RTCMediaStreamTrackStats* track_stats) { | 189 RTCMediaStreamTrackStats* track_stats) { |
| 190 track_stats->track_identifier = track.id(); | 190 track_stats->track_identifier = track.id(); |
| 191 track_stats->ended = (track.state() == MediaStreamTrackInterface::kEnded); | 191 track_stats->ended = (track.state() == MediaStreamTrackInterface::kEnded); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // Provides the media independent counters (both audio and video). | 194 // Provides the media independent counters (both audio and video). |
| 195 void SetInboundRTPStreamStatsFromMediaReceiverInfo( | 195 void SetInboundRTPStreamStatsFromMediaReceiverInfo( |
| 196 const cricket::MediaReceiverInfo& media_receiver_info, | 196 const cricket::MediaReceiverInfo& media_receiver_info, |
| 197 RTCInboundRTPStreamStats* inbound_stats) { | 197 RTCInboundRTPStreamStats* inbound_stats) { |
| 198 RTC_DCHECK(inbound_stats); | 198 RTC_DCHECK(inbound_stats); |
| 199 inbound_stats->ssrc = rtc::ToString<>(media_receiver_info.ssrc()); | 199 inbound_stats->ssrc = media_receiver_info.ssrc(); |
| 200 // TODO(hbos): Support the remote case. crbug.com/657855 | 200 // TODO(hbos): Support the remote case. crbug.com/657855 |
| 201 inbound_stats->is_remote = false; | 201 inbound_stats->is_remote = false; |
| 202 inbound_stats->packets_received = | 202 inbound_stats->packets_received = |
| 203 static_cast<uint32_t>(media_receiver_info.packets_rcvd); | 203 static_cast<uint32_t>(media_receiver_info.packets_rcvd); |
| 204 inbound_stats->bytes_received = | 204 inbound_stats->bytes_received = |
| 205 static_cast<uint64_t>(media_receiver_info.bytes_rcvd); | 205 static_cast<uint64_t>(media_receiver_info.bytes_rcvd); |
| 206 inbound_stats->packets_lost = | 206 inbound_stats->packets_lost = |
| 207 static_cast<uint32_t>(media_receiver_info.packets_lost); | 207 static_cast<uint32_t>(media_receiver_info.packets_lost); |
| 208 inbound_stats->fraction_lost = | 208 inbound_stats->fraction_lost = |
| 209 static_cast<double>(media_receiver_info.fraction_lost); | 209 static_cast<double>(media_receiver_info.fraction_lost); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 inbound_video->nack_count = | 245 inbound_video->nack_count = |
| 246 static_cast<uint32_t>(video_receiver_info.nacks_sent); | 246 static_cast<uint32_t>(video_receiver_info.nacks_sent); |
| 247 inbound_video->frames_decoded = video_receiver_info.frames_decoded; | 247 inbound_video->frames_decoded = video_receiver_info.frames_decoded; |
| 248 } | 248 } |
| 249 | 249 |
| 250 // Provides the media independent counters (both audio and video). | 250 // Provides the media independent counters (both audio and video). |
| 251 void SetOutboundRTPStreamStatsFromMediaSenderInfo( | 251 void SetOutboundRTPStreamStatsFromMediaSenderInfo( |
| 252 const cricket::MediaSenderInfo& media_sender_info, | 252 const cricket::MediaSenderInfo& media_sender_info, |
| 253 RTCOutboundRTPStreamStats* outbound_stats) { | 253 RTCOutboundRTPStreamStats* outbound_stats) { |
| 254 RTC_DCHECK(outbound_stats); | 254 RTC_DCHECK(outbound_stats); |
| 255 outbound_stats->ssrc = rtc::ToString<>(media_sender_info.ssrc()); | 255 outbound_stats->ssrc = media_sender_info.ssrc(); |
| 256 // TODO(hbos): Support the remote case. crbug.com/657856 | 256 // TODO(hbos): Support the remote case. crbug.com/657856 |
| 257 outbound_stats->is_remote = false; | 257 outbound_stats->is_remote = false; |
| 258 outbound_stats->packets_sent = | 258 outbound_stats->packets_sent = |
| 259 static_cast<uint32_t>(media_sender_info.packets_sent); | 259 static_cast<uint32_t>(media_sender_info.packets_sent); |
| 260 outbound_stats->bytes_sent = | 260 outbound_stats->bytes_sent = |
| 261 static_cast<uint64_t>(media_sender_info.bytes_sent); | 261 static_cast<uint64_t>(media_sender_info.bytes_sent); |
| 262 if (media_sender_info.rtt_ms >= 0) { | 262 if (media_sender_info.rtt_ms >= 0) { |
| 263 outbound_stats->round_trip_time = static_cast<double>( | 263 outbound_stats->round_trip_time = static_cast<double>( |
| 264 media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec; | 264 media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec; |
| 265 } | 265 } |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 const std::string& type) { | 1222 const std::string& type) { |
| 1223 return CandidateTypeToRTCIceCandidateType(type); | 1223 return CandidateTypeToRTCIceCandidateType(type); |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 const char* DataStateToRTCDataChannelStateForTesting( | 1226 const char* DataStateToRTCDataChannelStateForTesting( |
| 1227 DataChannelInterface::DataState state) { | 1227 DataChannelInterface::DataState state) { |
| 1228 return DataStateToRTCDataChannelState(state); | 1228 return DataStateToRTCDataChannelState(state); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 } // namespace webrtc | 1231 } // namespace webrtc |
| OLD | NEW |