Report send codec name in GetStats().

BUG=4461
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51439004

Cr-Commit-Position: refs/heads/master@{#8869}
This commit is contained in:
Peter Boström 2015-03-26 16:28:31 +01:00
parent d6f4c25eed
commit 74d9ed7d85
2 changed files with 15 additions and 0 deletions

View File

@ -1816,6 +1816,9 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::GetVideoSenderInfo() {
for (uint32_t ssrc : parameters_.config.rtp.ssrcs)
info.add_ssrc(ssrc);
VideoCodecSettings codec_settings;
if (parameters_.codec_settings.Get(&codec_settings))
info.codec_name = codec_settings.codec.name;
for (size_t i = 0; i < parameters_.encoder_config.streams.size(); ++i) {
if (i == parameters_.encoder_config.streams.size() - 1) {
info.preferred_bitrate +=

View File

@ -2101,6 +2101,18 @@ TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) {
EXPECT_EQ(webrtc::Call::kNetworkUp, fake_call_->GetNetworkState());
}
TEST_F(WebRtcVideoChannel2Test, GetStatsReportsSentCodecName) {
std::vector<cricket::VideoCodec> codecs;
codecs.push_back(kVp8Codec);
EXPECT_TRUE(channel_->SetSendCodecs(codecs));
AddSendStream();
cricket::VideoMediaInfo info;
ASSERT_TRUE(channel_->GetStats(&info));
EXPECT_EQ(kVp8Codec.name, info.senders[0].codec_name);
}
TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuOveruseMetrics) {
FakeVideoSendStream* stream = AddSendStream();
webrtc::VideoSendStream::Stats stats;