Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: webrtc/api/rtcstatscollector.cc

Issue 2562703007: RTCOutboundRTPStreamStats.roundTripTime: Only report non-negative values. (Closed)
Patch Set: Unittest testing that it defaults to undefined Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 RTC_DCHECK(outbound_stats); 190 RTC_DCHECK(outbound_stats);
191 outbound_stats->ssrc = rtc::ToString<>(media_sender_info.ssrc()); 191 outbound_stats->ssrc = rtc::ToString<>(media_sender_info.ssrc());
192 // TODO(hbos): Support the remote case. crbug.com/657856 192 // TODO(hbos): Support the remote case. crbug.com/657856
193 outbound_stats->is_remote = false; 193 outbound_stats->is_remote = false;
194 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant: 194 // TODO(hbos): Set |codec_id| when we have |RTCCodecStats|. Maybe relevant:
195 // |media_sender_info.codec_name|. crbug.com/657854, 657856, 659117 195 // |media_sender_info.codec_name|. crbug.com/657854, 657856, 659117
196 outbound_stats->packets_sent = 196 outbound_stats->packets_sent =
197 static_cast<uint32_t>(media_sender_info.packets_sent); 197 static_cast<uint32_t>(media_sender_info.packets_sent);
198 outbound_stats->bytes_sent = 198 outbound_stats->bytes_sent =
199 static_cast<uint64_t>(media_sender_info.bytes_sent); 199 static_cast<uint64_t>(media_sender_info.bytes_sent);
200 outbound_stats->round_trip_time = 200 if (media_sender_info.rtt_ms >= 0) {
201 static_cast<double>(media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec; 201 outbound_stats->round_trip_time = static_cast<double>(
202 media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec;
203 }
202 } 204 }
203 205
204 void SetOutboundRTPStreamStatsFromVoiceSenderInfo( 206 void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
205 const cricket::VoiceSenderInfo& voice_sender_info, 207 const cricket::VoiceSenderInfo& voice_sender_info,
206 RTCOutboundRTPStreamStats* outbound_audio) { 208 RTCOutboundRTPStreamStats* outbound_audio) {
207 SetOutboundRTPStreamStatsFromMediaSenderInfo( 209 SetOutboundRTPStreamStatsFromMediaSenderInfo(
208 voice_sender_info, outbound_audio); 210 voice_sender_info, outbound_audio);
209 outbound_audio->media_type = "audio"; 211 outbound_audio->media_type = "audio";
210 // |fir_count|, |pli_count| and |sli_count| are only valid for video and are 212 // |fir_count|, |pli_count| and |sli_count| are only valid for video and are
211 // purposefully left undefined for audio. 213 // purposefully left undefined for audio.
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 const std::string& type) { 928 const std::string& type) {
927 return CandidateTypeToRTCIceCandidateType(type); 929 return CandidateTypeToRTCIceCandidateType(type);
928 } 930 }
929 931
930 const char* DataStateToRTCDataChannelStateForTesting( 932 const char* DataStateToRTCDataChannelStateForTesting(
931 DataChannelInterface::DataState state) { 933 DataChannelInterface::DataState state) {
932 return DataStateToRTCDataChannelState(state); 934 return DataStateToRTCDataChannelState(state);
933 } 935 }
934 936
935 } // namespace webrtc 937 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698