| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 for (const auto& f : floats) | 170 for (const auto& f : floats) |
| 171 report->AddFloat(f.name, f.value); | 171 report->AddFloat(f.name, f.value); |
| 172 | 172 |
| 173 for (const auto& i : ints) | 173 for (const auto& i : ints) |
| 174 report->AddInt(i.name, i.value); | 174 report->AddInt(i.name, i.value); |
| 175 | 175 |
| 176 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, | 176 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, |
| 177 info.bytes_rcvd); | 177 info.bytes_rcvd); |
| 178 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, | 178 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, |
| 179 info.capture_start_ntp_time_ms); | 179 info.capture_start_ntp_time_ms); |
| 180 report->AddString(StatsReport::kStatsValueNameMediaType, "audio"); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) { | 183 void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) { |
| 183 ExtractCommonSendProperties(info, report); | 184 ExtractCommonSendProperties(info, report); |
| 184 | 185 |
| 185 SetAudioProcessingStats( | 186 SetAudioProcessingStats( |
| 186 report, info.typing_noise_detected, info.echo_return_loss, | 187 report, info.typing_noise_detected, info.echo_return_loss, |
| 187 info.echo_return_loss_enhancement, info.echo_delay_median_ms, | 188 info.echo_return_loss_enhancement, info.echo_delay_median_ms, |
| 188 info.aec_quality_min, info.echo_delay_std_ms); | 189 info.aec_quality_min, info.echo_delay_std_ms); |
| 189 | 190 |
| 190 RTC_DCHECK_GE(info.audio_level, 0); | 191 RTC_DCHECK_GE(info.audio_level, 0); |
| 191 const IntForAdd ints[] = { | 192 const IntForAdd ints[] = { |
| 192 { StatsReport::kStatsValueNameAudioInputLevel, info.audio_level}, | 193 { StatsReport::kStatsValueNameAudioInputLevel, info.audio_level}, |
| 193 { StatsReport::kStatsValueNameJitterReceived, info.jitter_ms }, | 194 { StatsReport::kStatsValueNameJitterReceived, info.jitter_ms }, |
| 194 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 195 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 195 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, | 196 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, |
| 196 }; | 197 }; |
| 197 | 198 |
| 198 for (const auto& i : ints) | 199 for (const auto& i : ints) |
| 199 report->AddInt(i.name, i.value); | 200 report->AddInt(i.name, i.value); |
| 201 report->AddString(StatsReport::kStatsValueNameMediaType, "audio"); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { | 204 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { |
| 203 ExtractCommonReceiveProperties(info, report); | 205 ExtractCommonReceiveProperties(info, report); |
| 204 report->AddString(StatsReport::kStatsValueNameCodecImplementationName, | 206 report->AddString(StatsReport::kStatsValueNameCodecImplementationName, |
| 205 info.decoder_implementation_name); | 207 info.decoder_implementation_name); |
| 206 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, | 208 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, |
| 207 info.bytes_rcvd); | 209 info.bytes_rcvd); |
| 208 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, | 210 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, |
| 209 info.capture_start_ntp_time_ms); | 211 info.capture_start_ntp_time_ms); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 223 { StatsReport::kStatsValueNameNacksSent, info.nacks_sent }, | 225 { StatsReport::kStatsValueNameNacksSent, info.nacks_sent }, |
| 224 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 226 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 225 { StatsReport::kStatsValueNamePacketsReceived, info.packets_rcvd }, | 227 { StatsReport::kStatsValueNamePacketsReceived, info.packets_rcvd }, |
| 226 { StatsReport::kStatsValueNamePlisSent, info.plis_sent }, | 228 { StatsReport::kStatsValueNamePlisSent, info.plis_sent }, |
| 227 { StatsReport::kStatsValueNameRenderDelayMs, info.render_delay_ms }, | 229 { StatsReport::kStatsValueNameRenderDelayMs, info.render_delay_ms }, |
| 228 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms }, | 230 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms }, |
| 229 }; | 231 }; |
| 230 | 232 |
| 231 for (const auto& i : ints) | 233 for (const auto& i : ints) |
| 232 report->AddInt(i.name, i.value); | 234 report->AddInt(i.name, i.value); |
| 235 report->AddString(StatsReport::kStatsValueNameMediaType, "video"); |
| 233 } | 236 } |
| 234 | 237 |
| 235 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { | 238 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { |
| 236 ExtractCommonSendProperties(info, report); | 239 ExtractCommonSendProperties(info, report); |
| 237 | 240 |
| 238 report->AddString(StatsReport::kStatsValueNameCodecImplementationName, | 241 report->AddString(StatsReport::kStatsValueNameCodecImplementationName, |
| 239 info.encoder_implementation_name); | 242 info.encoder_implementation_name); |
| 240 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution, | 243 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution, |
| 241 (info.adapt_reason & 0x2) > 0); | 244 (info.adapt_reason & 0x2) > 0); |
| 242 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution, | 245 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 257 { StatsReport::kStatsValueNameFrameWidthInput, info.input_frame_width }, | 260 { StatsReport::kStatsValueNameFrameWidthInput, info.input_frame_width }, |
| 258 { StatsReport::kStatsValueNameFrameWidthSent, info.send_frame_width }, | 261 { StatsReport::kStatsValueNameFrameWidthSent, info.send_frame_width }, |
| 259 { StatsReport::kStatsValueNameNacksReceived, info.nacks_rcvd }, | 262 { StatsReport::kStatsValueNameNacksReceived, info.nacks_rcvd }, |
| 260 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 263 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 261 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, | 264 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, |
| 262 { StatsReport::kStatsValueNamePlisReceived, info.plis_rcvd }, | 265 { StatsReport::kStatsValueNamePlisReceived, info.plis_rcvd }, |
| 263 }; | 266 }; |
| 264 | 267 |
| 265 for (const auto& i : ints) | 268 for (const auto& i : ints) |
| 266 report->AddInt(i.name, i.value); | 269 report->AddInt(i.name, i.value); |
| 270 report->AddString(StatsReport::kStatsValueNameMediaType, "video"); |
| 267 } | 271 } |
| 268 | 272 |
| 269 void ExtractStats(const cricket::BandwidthEstimationInfo& info, | 273 void ExtractStats(const cricket::BandwidthEstimationInfo& info, |
| 270 double stats_gathering_started, | 274 double stats_gathering_started, |
| 271 PeerConnectionInterface::StatsOutputLevel level, | 275 PeerConnectionInterface::StatsOutputLevel level, |
| 272 StatsReport* report) { | 276 StatsReport* report) { |
| 273 RTC_DCHECK(report->type() == StatsReport::kStatsReportTypeBwe); | 277 RTC_DCHECK(report->type() == StatsReport::kStatsReportTypeBwe); |
| 274 | 278 |
| 275 report->set_timestamp(stats_gathering_started); | 279 report->set_timestamp(stats_gathering_started); |
| 276 const IntForAdd ints[] = { | 280 const IntForAdd ints[] = { |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 StatsReport* report = entry.second; | 953 StatsReport* report = entry.second; |
| 950 report->set_timestamp(stats_gathering_started_); | 954 report->set_timestamp(stats_gathering_started_); |
| 951 } | 955 } |
| 952 } | 956 } |
| 953 | 957 |
| 954 void StatsCollector::ClearUpdateStatsCacheForTest() { | 958 void StatsCollector::ClearUpdateStatsCacheForTest() { |
| 955 stats_gathering_started_ = 0; | 959 stats_gathering_started_ = 0; |
| 956 } | 960 } |
| 957 | 961 |
| 958 } // namespace webrtc | 962 } // namespace webrtc |
| OLD | NEW |