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

Unified Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1315413002: Wire up currently-received video codec to stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: talk/media/webrtc/webrtcvideoengine2_unittest.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2_unittest.cc b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
index fd87703eabdd9a09d73b0e01c1435c477dd4693c..545520f891364d29948b2999763be9632f008e5e 100644
--- a/talk/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -2670,6 +2670,29 @@ TEST_F(WebRtcVideoChannel2Test, ReportsSsrcGroupsInStats) {
EXPECT_EQ(receiver_sp.ssrc_groups, info.receivers[0].ssrc_groups);
}
+TEST_F(WebRtcVideoChannel2Test, MapsReceivedPayloadTypeToCodecName) {
+ FakeVideoReceiveStream* stream = AddRecvStream();
+ webrtc::VideoReceiveStream::Stats stats;
+ cricket::VideoMediaInfo info;
+
+ // Report no codec name before receiving.
+ stream->SetStats(stats);
+ ASSERT_TRUE(channel_->GetStats(&info));
+ EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
+
+ // Report VP8 if we're receiving it.
+ stats.current_payload_type = kDefaultVp8PlType;
+ stream->SetStats(stats);
+ ASSERT_TRUE(channel_->GetStats(&info));
+ EXPECT_STREQ(kVp8CodecName, info.receivers[0].codec_name.c_str());
+
+ // Report no codec name for unknown playload types.
+ stats.current_payload_type = 3;
+ stream->SetStats(stats);
+ ASSERT_TRUE(channel_->GetStats(&info));
+ EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
+}
+
void WebRtcVideoChannel2Test::TestReceiveUnsignalledSsrcPacket(
uint8_t payload_type,
bool expect_created_receive_stream) {
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/modules/video_coding/main/interface/video_coding_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698