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

Side by Side Diff: talk/app/webrtc/statscollector.cc

Issue 1406903002: Expose codec implementation names in stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix rebase Created 5 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 | « talk/app/webrtc/java/jni/androidmediaencoder_jni.cc ('k') | talk/app/webrtc/statstypes.h » ('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 * 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, 194 { StatsReport::kStatsValueNamePacketsLost, info.packets_lost },
195 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent }, 195 { StatsReport::kStatsValueNamePacketsSent, info.packets_sent },
196 }; 196 };
197 197
198 for (const auto& i : ints) 198 for (const auto& i : ints)
199 report->AddInt(i.name, i.value); 199 report->AddInt(i.name, i.value);
200 } 200 }
201 201
202 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) { 202 void ExtractStats(const cricket::VideoReceiverInfo& info, StatsReport* report) {
203 ExtractCommonReceiveProperties(info, report); 203 ExtractCommonReceiveProperties(info, report);
204 report->AddString(StatsReport::kStatsValueNameCodecImplementationName,
205 info.decoder_implementation_name);
204 report->AddInt64(StatsReport::kStatsValueNameBytesReceived, 206 report->AddInt64(StatsReport::kStatsValueNameBytesReceived,
205 info.bytes_rcvd); 207 info.bytes_rcvd);
206 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs, 208 report->AddInt64(StatsReport::kStatsValueNameCaptureStartNtpTimeMs,
207 info.capture_start_ntp_time_ms); 209 info.capture_start_ntp_time_ms);
208 const IntForAdd ints[] = { 210 const IntForAdd ints[] = {
209 { StatsReport::kStatsValueNameCurrentDelayMs, info.current_delay_ms }, 211 { StatsReport::kStatsValueNameCurrentDelayMs, info.current_delay_ms },
210 { StatsReport::kStatsValueNameDecodeMs, info.decode_ms }, 212 { StatsReport::kStatsValueNameDecodeMs, info.decode_ms },
211 { StatsReport::kStatsValueNameFirsSent, info.firs_sent }, 213 { StatsReport::kStatsValueNameFirsSent, info.firs_sent },
212 { StatsReport::kStatsValueNameFrameHeightReceived, info.frame_height }, 214 { StatsReport::kStatsValueNameFrameHeightReceived, info.frame_height },
213 { StatsReport::kStatsValueNameFrameRateDecoded, info.framerate_decoded }, 215 { StatsReport::kStatsValueNameFrameRateDecoded, info.framerate_decoded },
(...skipping 12 matching lines...) Expand all
226 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms }, 228 { StatsReport::kStatsValueNameTargetDelayMs, info.target_delay_ms },
227 }; 229 };
228 230
229 for (const auto& i : ints) 231 for (const auto& i : ints)
230 report->AddInt(i.name, i.value); 232 report->AddInt(i.name, i.value);
231 } 233 }
232 234
233 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { 235 void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) {
234 ExtractCommonSendProperties(info, report); 236 ExtractCommonSendProperties(info, report);
235 237
238 report->AddString(StatsReport::kStatsValueNameCodecImplementationName,
239 info.encoder_implementation_name);
236 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution, 240 report->AddBoolean(StatsReport::kStatsValueNameBandwidthLimitedResolution,
237 (info.adapt_reason & 0x2) > 0); 241 (info.adapt_reason & 0x2) > 0);
238 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution, 242 report->AddBoolean(StatsReport::kStatsValueNameCpuLimitedResolution,
239 (info.adapt_reason & 0x1) > 0); 243 (info.adapt_reason & 0x1) > 0);
240 report->AddBoolean(StatsReport::kStatsValueNameViewLimitedResolution, 244 report->AddBoolean(StatsReport::kStatsValueNameViewLimitedResolution,
241 (info.adapt_reason & 0x4) > 0); 245 (info.adapt_reason & 0x4) > 0);
242 246
243 const IntForAdd ints[] = { 247 const IntForAdd ints[] = {
244 { StatsReport::kStatsValueNameAdaptationChanges, info.adapt_changes }, 248 { StatsReport::kStatsValueNameAdaptationChanges, info.adapt_changes },
245 { StatsReport::kStatsValueNameAvgEncodeMs, info.avg_encode_ms }, 249 { StatsReport::kStatsValueNameAvgEncodeMs, info.avg_encode_ms },
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 StatsReport* report = entry.second; 949 StatsReport* report = entry.second;
946 report->set_timestamp(stats_gathering_started_); 950 report->set_timestamp(stats_gathering_started_);
947 } 951 }
948 } 952 }
949 953
950 void StatsCollector::ClearUpdateStatsCacheForTest() { 954 void StatsCollector::ClearUpdateStatsCacheForTest() {
951 stats_gathering_started_ = 0; 955 stats_gathering_started_ = 0;
952 } 956 }
953 957
954 } // namespace webrtc 958 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/jni/androidmediaencoder_jni.cc ('k') | talk/app/webrtc/statstypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698