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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 void SetMediaStreamTrackStatsFromMediaStreamTrackInterface( | 103 void SetMediaStreamTrackStatsFromMediaStreamTrackInterface( |
104 const MediaStreamTrackInterface& track, | 104 const MediaStreamTrackInterface& track, |
105 RTCMediaStreamTrackStats* track_stats) { | 105 RTCMediaStreamTrackStats* track_stats) { |
106 track_stats->track_identifier = track.id(); | 106 track_stats->track_identifier = track.id(); |
107 track_stats->ended = (track.state() == MediaStreamTrackInterface::kEnded); | 107 track_stats->ended = (track.state() == MediaStreamTrackInterface::kEnded); |
108 } | 108 } |
109 | 109 |
110 void SetInboundRTPStreamStatsFromMediaReceiverInfo( | 110 void SetInboundRTPStreamStatsFromMediaReceiverInfo( |
hta-webrtc
2016/11/22 09:51:29
Add a comment to this function to say that this pr
hbos
2016/11/22 11:02:45
Done.
| |
111 const cricket::MediaReceiverInfo& media_receiver_info, | 111 const cricket::MediaReceiverInfo& media_receiver_info, |
112 RTCInboundRTPStreamStats* inbound_stats) { | 112 RTCInboundRTPStreamStats* inbound_stats) { |
113 RTC_DCHECK(inbound_stats); | 113 RTC_DCHECK(inbound_stats); |
114 inbound_stats->ssrc = rtc::ToString<>(media_receiver_info.ssrc()); | 114 inbound_stats->ssrc = rtc::ToString<>(media_receiver_info.ssrc()); |
115 // TODO(hbos): Support the remote case. crbug.com/657855 | 115 // TODO(hbos): Support the remote case. crbug.com/657855 |
116 inbound_stats->is_remote = false; | 116 inbound_stats->is_remote = false; |
117 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant: | 117 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant: |
118 // |media_receiver_info.codec_name|. crbug.com/657854, 657855, 659117 | 118 // |media_receiver_info.codec_name|. crbug.com/657854, 657855, 659117 |
119 inbound_stats->packets_received = | 119 inbound_stats->packets_received = |
120 static_cast<uint32_t>(media_receiver_info.packets_rcvd); | 120 static_cast<uint32_t>(media_receiver_info.packets_rcvd); |
121 inbound_stats->bytes_received = | 121 inbound_stats->bytes_received = |
122 static_cast<uint64_t>(media_receiver_info.bytes_rcvd); | 122 static_cast<uint64_t>(media_receiver_info.bytes_rcvd); |
123 inbound_stats->fraction_lost = | 123 inbound_stats->fraction_lost = |
124 static_cast<double>(media_receiver_info.fraction_lost); | 124 static_cast<double>(media_receiver_info.fraction_lost); |
125 } | 125 } |
126 | 126 |
127 void SetInboundRTPStreamStatsFromVoiceReceiverInfo( | 127 void SetInboundRTPStreamStatsFromVoiceReceiverInfo( |
128 const cricket::VoiceReceiverInfo& voice_receiver_info, | 128 const cricket::VoiceReceiverInfo& voice_receiver_info, |
129 RTCInboundRTPStreamStats* inbound_stats) { | 129 RTCInboundRTPStreamStats* inbound_audio) { |
130 SetInboundRTPStreamStatsFromMediaReceiverInfo( | 130 SetInboundRTPStreamStatsFromMediaReceiverInfo( |
131 voice_receiver_info, inbound_stats); | 131 voice_receiver_info, inbound_audio); |
132 inbound_stats->media_type = "audio"; | 132 inbound_audio->media_type = "audio"; |
133 inbound_stats->jitter = | 133 inbound_audio->jitter = |
134 static_cast<double>(voice_receiver_info.jitter_ms) / | 134 static_cast<double>(voice_receiver_info.jitter_ms) / |
135 rtc::kNumMillisecsPerSec; | 135 rtc::kNumMillisecsPerSec; |
136 // |fir_count|, |pli_count| and |sli_count| are only valid for video and are | |
137 // purposefully left undefined for audio. | |
136 } | 138 } |
137 | 139 |
138 void SetInboundRTPStreamStatsFromVideoReceiverInfo( | 140 void SetInboundRTPStreamStatsFromVideoReceiverInfo( |
139 const cricket::VideoReceiverInfo& video_receiver_info, | 141 const cricket::VideoReceiverInfo& video_receiver_info, |
140 RTCInboundRTPStreamStats* inbound_stats) { | 142 RTCInboundRTPStreamStats* inbound_video) { |
141 SetInboundRTPStreamStatsFromMediaReceiverInfo( | 143 SetInboundRTPStreamStatsFromMediaReceiverInfo( |
142 video_receiver_info, inbound_stats); | 144 video_receiver_info, inbound_video); |
143 inbound_stats->media_type = "video"; | 145 inbound_video->media_type = "video"; |
146 inbound_video->fir_count = | |
147 static_cast<uint32_t>(video_receiver_info.firs_sent); | |
148 inbound_video->pli_count = | |
149 static_cast<uint32_t>(video_receiver_info.plis_sent); | |
150 inbound_video->nack_count = | |
151 static_cast<uint32_t>(video_receiver_info.nacks_sent); | |
hta-webrtc
2016/11/22 09:51:29
Are we sure these are actually counted (ie never -
hbos
2016/11/22 11:02:45
Looks like it, they start at 0 and there is code f
| |
144 } | 152 } |
145 | 153 |
146 void SetOutboundRTPStreamStatsFromMediaSenderInfo( | 154 void SetOutboundRTPStreamStatsFromMediaSenderInfo( |
147 const cricket::MediaSenderInfo& media_sender_info, | 155 const cricket::MediaSenderInfo& media_sender_info, |
148 RTCOutboundRTPStreamStats* outbound_stats) { | 156 RTCOutboundRTPStreamStats* outbound_stats) { |
149 RTC_DCHECK(outbound_stats); | 157 RTC_DCHECK(outbound_stats); |
150 outbound_stats->ssrc = rtc::ToString<>(media_sender_info.ssrc()); | 158 outbound_stats->ssrc = rtc::ToString<>(media_sender_info.ssrc()); |
151 // TODO(hbos): Support the remote case. crbug.com/657856 | 159 // TODO(hbos): Support the remote case. crbug.com/657856 |
152 outbound_stats->is_remote = false; | 160 outbound_stats->is_remote = false; |
153 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant: | 161 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant: |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
803 const std::string& type) { | 811 const std::string& type) { |
804 return CandidateTypeToRTCIceCandidateType(type); | 812 return CandidateTypeToRTCIceCandidateType(type); |
805 } | 813 } |
806 | 814 |
807 const char* DataStateToRTCDataChannelStateForTesting( | 815 const char* DataStateToRTCDataChannelStateForTesting( |
808 DataChannelInterface::DataState state) { | 816 DataChannelInterface::DataState state) { |
809 return DataStateToRTCDataChannelState(state); | 817 return DataStateToRTCDataChannelState(state); |
810 } | 818 } |
811 | 819 |
812 } // namespace webrtc | 820 } // namespace webrtc |
OLD | NEW |