Chromium Code Reviews| Index: webrtc/api/statscollector.cc |
| diff --git a/webrtc/api/statscollector.cc b/webrtc/api/statscollector.cc |
| index d77953b3bed1d49bb75a3be6a35c5d10f91c382b..1711c469996f35c2c1996fce8e950ea086dea263 100644 |
| --- a/webrtc/api/statscollector.cc |
| +++ b/webrtc/api/statscollector.cc |
| @@ -236,11 +236,9 @@ void ExtractStats(const cricket::VideoSenderInfo& info, StatsReport* report) { |
| { StatsReport::kStatsValueNameEncodeUsagePercent, |
| info.encode_usage_percent }, |
| { StatsReport::kStatsValueNameFirsReceived, info.firs_rcvd }, |
| - { StatsReport::kStatsValueNameFrameHeightInput, info.input_frame_height }, |
| { StatsReport::kStatsValueNameFrameHeightSent, info.send_frame_height }, |
| { StatsReport::kStatsValueNameFrameRateInput, info.framerate_input }, |
| { StatsReport::kStatsValueNameFrameRateSent, info.framerate_sent }, |
| - { StatsReport::kStatsValueNameFrameWidthInput, info.input_frame_width }, |
| { StatsReport::kStatsValueNameFrameWidthSent, info.send_frame_width }, |
| { StatsReport::kStatsValueNameNacksReceived, info.nacks_rcvd }, |
| { StatsReport::kStatsValueNamePacketsLost, info.packets_lost }, |
| @@ -474,6 +472,7 @@ StatsCollector::UpdateStats(PeerConnectionInterface::StatsOutputLevel level) { |
| ExtractSessionInfo(); |
| ExtractVoiceInfo(); |
| ExtractVideoInfo(level); |
| + ExtractCapturerInfo(); |
| ExtractDataInfo(); |
| UpdateTrackReports(); |
| } |
| @@ -828,6 +827,26 @@ void StatsCollector::ExtractVideoInfo( |
| } |
| } |
| +void StatsCollector::ExtractCapturerInfo() { |
| + RTC_DCHECK(pc_->session()->signaling_thread()->IsCurrent()); |
| + |
| + rtc::scoped_refptr<StreamCollectionInterface> streams = pc_->local_streams(); |
| + for (size_t i = 0; i < streams->count(); i++) { |
| + for (auto track : streams->at(i)->GetVideoTracks()) { |
| + VideoTrackSourceInterface* source = track->GetSource(); |
| + VideoTrackSourceInterface::VideoSourceInfo info; |
| + if (source->GetInfo(&info)) { |
| + // TODO(nisse): What id to use??? |
|
pthatcher1
2016/03/24 18:10:25
Based on the code here:
https://code.google.com/p
nisse-webrtc
2016/03/29 08:36:32
Nice idea. I implemented that. A few questions:
|
| + StatsReport* report = reports_.FindOrAddNew(StatsReport::Id()); |
| + report->AddInt(StatsReport::kStatsValueNameFrameWidthInput, |
| + info.input_width); |
| + report->AddInt(StatsReport::kStatsValueNameFrameHeightInput, |
| + info.input_height); |
| + } |
| + } |
| + } |
| +} |
| + |
| void StatsCollector::ExtractDataInfo() { |
| RTC_DCHECK(pc_->session()->signaling_thread()->IsCurrent()); |