Chromium Code Reviews| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 for (const auto& f : floats) | 168 for (const auto& f : floats) |
| 169 report->AddFloat(f.name, f.value); | 169 report->AddFloat(f.name, f.value); |
| 170 | 170 |
| 171 for (const auto& i : ints) | 171 for (const auto& i : ints) |
| 172 report->AddInt(i.name, i.value); | 172 report->AddInt(i.name, i.value); |
| 173 | 173 |
| 174 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, | 174 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, |
| 175 info.bytes_rcvd); | 175 info.bytes_rcvd); |
| 176 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, | 176 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, |
| 177 info.capture_start_ntp_time_ms); | 177 info.capture_start_ntp_time_ms); |
| 178 report->AddString(StatsReport::kStatsValueNameMediaType, "audio"); | |
|
tommi
2016/01/11 12:22:50
Can you move this to the top of the function?
If
| |
| 178 } | 179 } |
| 179 | 180 |
| 180 void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) { | 181 void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) { |
| 181 ExtractCommonSendProperties(info, report); | 182 ExtractCommonSendProperties(info, report); |
| 182 | 183 |
| 183 SetAudioProcessingStats(report, info.audio_level, info.typing_noise_detected, | 184 SetAudioProcessingStats(report, info.audio_level, info.typing_noise_detected, |
| 184 info.echo_return_loss, info.echo_return_loss_enhancement, | 185 info.echo_return_loss, info.echo_return_loss_enhancement, |
| 185 info.echo_delay_median_ms, info.aec_quality_min, info.echo_delay_std_ms); | 186 info.echo_delay_median_ms, info.aec_quality_min, info.echo_delay_std_ms); |
| 186 | 187 |
| 187 const IntForAdd ints[] = { | 188 const IntForAdd ints[] = { |
| 188 { StatsReport::kStatsValueNameJitterReceived, info.jitter_ms }, | 189 { StatsReport::kStatsValueNameJitterReceived, info.jitter_ms }, |
| 189 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 190 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 190 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, | 191 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 for (const auto& i : ints) | 194 for (const auto& i : ints) |
| 194 report->AddInt(i.name, i.value); | 195 report->AddInt(i.name, i.value); |
| 196 report->AddString(StatsReport::kStatsValueNameMediaType, "audio"); | |
| 195 } | 197 } |
| 196 | 198 |
| 197 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { | 199 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { |
| 198 ExtractCommonReceiveProperties(info, report); | 200 ExtractCommonReceiveProperties(info, report); |
| 199 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, | 201 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, |
| 200 info.bytes_rcvd); | 202 info.bytes_rcvd); |
| 201 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, | 203 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, |
| 202 info.capture_start_ntp_time_ms); | 204 info.capture_start_ntp_time_ms); |
| 203 const IntForAdd ints[] = { | 205 const IntForAdd ints[] = { |
| 204 { StatsReport::kStatsValueNameCurrentDelayMs, info.current_delay_ms }, | 206 { StatsReport::kStatsValueNameCurrentDelayMs, info.current_delay_ms }, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 216 { StatsReport::kStatsValueNameNacksSent, info.nacks_sent }, | 218 { StatsReport::kStatsValueNameNacksSent, info.nacks_sent }, |
| 217 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 219 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 218 { StatsReport::kStatsValueNamePacketsReceived, info.packets_rcvd }, | 220 { StatsReport::kStatsValueNamePacketsReceived, info.packets_rcvd }, |
| 219 { StatsReport::kStatsValueNamePlisSent, info.plis_sent }, | 221 { StatsReport::kStatsValueNamePlisSent, info.plis_sent }, |
| 220 { StatsReport::kStatsValueNameRenderDelayMs, info.render_delay_ms }, | 222 { StatsReport::kStatsValueNameRenderDelayMs, info.render_delay_ms }, |
| 221 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms }, | 223 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms }, |
| 222 }; | 224 }; |
| 223 | 225 |
| 224 for (const auto& i : ints) | 226 for (const auto& i : ints) |
| 225 report->AddInt(i.name, i.value); | 227 report->AddInt(i.name, i.value); |
| 228 report->AddString(StatsReport::kStatsValueNameMediaType, "video"); | |
| 226 } | 229 } |
| 227 | 230 |
| 228 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { | 231 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { |
| 229 ExtractCommonSendProperties(info, report); | 232 ExtractCommonSendProperties(info, report); |
| 230 | 233 |
| 231 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution, | 234 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution, |
| 232 (info.adapt_reason & 0x2) > 0); | 235 (info.adapt_reason & 0x2) > 0); |
| 233 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution, | 236 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution, |
| 234 (info.adapt_reason & 0x1) > 0); | 237 (info.adapt_reason & 0x1) > 0); |
| 235 report->AddBoolean(StatsReport::kStatsValueNameViewLimitedResolution, | 238 report->AddBoolean(StatsReport::kStatsValueNameViewLimitedResolution, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 248 { StatsReport::kStatsValueNameFrameWidthInput, info.input_frame_width }, | 251 { StatsReport::kStatsValueNameFrameWidthInput, info.input_frame_width }, |
| 249 { StatsReport::kStatsValueNameFrameWidthSent, info.send_frame_width }, | 252 { StatsReport::kStatsValueNameFrameWidthSent, info.send_frame_width }, |
| 250 { StatsReport::kStatsValueNameNacksReceived, info.nacks_rcvd }, | 253 { StatsReport::kStatsValueNameNacksReceived, info.nacks_rcvd }, |
| 251 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, | 254 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| 252 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, | 255 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, |
| 253 { StatsReport::kStatsValueNamePlisReceived, info.plis_rcvd }, | 256 { StatsReport::kStatsValueNamePlisReceived, info.plis_rcvd }, |
| 254 }; | 257 }; |
| 255 | 258 |
| 256 for (const auto& i : ints) | 259 for (const auto& i : ints) |
| 257 report->AddInt(i.name, i.value); | 260 report->AddInt(i.name, i.value); |
| 261 report->AddString(StatsReport::kStatsValueNameMediaType, "video"); | |
| 258 } | 262 } |
| 259 | 263 |
| 260 void ExtractStats(const cricket::BandwidthEstimationInfo& info, | 264 void ExtractStats(const cricket::BandwidthEstimationInfo& info, |
| 261 double stats_gathering_started, | 265 double stats_gathering_started, |
| 262 PeerConnectionInterface::StatsOutputLevel level, | 266 PeerConnectionInterface::StatsOutputLevel level, |
| 263 StatsReport* report) { | 267 StatsReport* report) { |
| 264 DCHECK(report->type() == StatsReport::kStatsReportTypeBwe); | 268 DCHECK(report->type() == StatsReport::kStatsReportTypeBwe); |
| 265 | 269 |
| 266 report->set_timestamp(stats_gathering_started); | 270 report->set_timestamp(stats_gathering_started); |
| 267 const IntForAdd ints[] = { | 271 const IntForAdd ints[] = { |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 940 report->set_timestamp(stats_gathering_started_); | 944 report->set_timestamp(stats_gathering_started_); |
| 941 } | 945 } |
| 942 | 946 |
| 943 } | 947 } |
| 944 | 948 |
| 945 void StatsCollector::ClearUpdateStatsCacheForTest() { | 949 void StatsCollector::ClearUpdateStatsCacheForTest() { |
| 946 stats_gathering_started_ = 0; | 950 stats_gathering_started_ = 0; |
| 947 } | 951 } |
| 948 | 952 |
| 949 } // namespace webrtc | 953 } // namespace webrtc |
| OLD | NEW |