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

Side by Side 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, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 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 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 ASSERT_TRUE(channel_->GetStats(&info)); 2663 ASSERT_TRUE(channel_->GetStats(&info));
2664 2664
2665 ASSERT_EQ(1u, info.senders.size()); 2665 ASSERT_EQ(1u, info.senders.size());
2666 ASSERT_EQ(1u, info.receivers.size()); 2666 ASSERT_EQ(1u, info.receivers.size());
2667 2667
2668 EXPECT_NE(sender_sp.ssrc_groups, receiver_sp.ssrc_groups); 2668 EXPECT_NE(sender_sp.ssrc_groups, receiver_sp.ssrc_groups);
2669 EXPECT_EQ(sender_sp.ssrc_groups, info.senders[0].ssrc_groups); 2669 EXPECT_EQ(sender_sp.ssrc_groups, info.senders[0].ssrc_groups);
2670 EXPECT_EQ(receiver_sp.ssrc_groups, info.receivers[0].ssrc_groups); 2670 EXPECT_EQ(receiver_sp.ssrc_groups, info.receivers[0].ssrc_groups);
2671 } 2671 }
2672 2672
2673 TEST_F(WebRtcVideoChannel2Test, MapsReceivedPayloadTypeToCodecName) {
2674 FakeVideoReceiveStream* stream = AddRecvStream();
2675 webrtc::VideoReceiveStream::Stats stats;
2676 cricket::VideoMediaInfo info;
2677
2678 // Report no codec name before receiving.
2679 stream->SetStats(stats);
2680 ASSERT_TRUE(channel_->GetStats(&info));
2681 EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
2682
2683 // Report VP8 if we're receiving it.
2684 stats.current_payload_type = kDefaultVp8PlType;
2685 stream->SetStats(stats);
2686 ASSERT_TRUE(channel_->GetStats(&info));
2687 EXPECT_STREQ(kVp8CodecName, info.receivers[0].codec_name.c_str());
2688
2689 // Report no codec name for unknown playload types.
2690 stats.current_payload_type = 3;
2691 stream->SetStats(stats);
2692 ASSERT_TRUE(channel_->GetStats(&info));
2693 EXPECT_STREQ("", info.receivers[0].codec_name.c_str());
2694 }
2695
2673 void WebRtcVideoChannel2Test::TestReceiveUnsignalledSsrcPacket( 2696 void WebRtcVideoChannel2Test::TestReceiveUnsignalledSsrcPacket(
2674 uint8_t payload_type, 2697 uint8_t payload_type,
2675 bool expect_created_receive_stream) { 2698 bool expect_created_receive_stream) {
2676 std::vector<VideoCodec> codecs(engine_.codecs()); 2699 std::vector<VideoCodec> codecs(engine_.codecs());
2677 // Add a RED RTX codec. 2700 // Add a RED RTX codec.
2678 VideoCodec red_rtx_codec = 2701 VideoCodec red_rtx_codec =
2679 VideoCodec::CreateRtxCodec(kRedRtxPayloadType, kDefaultRedPlType); 2702 VideoCodec::CreateRtxCodec(kRedRtxPayloadType, kDefaultRedPlType);
2680 codecs.push_back(red_rtx_codec); 2703 codecs.push_back(red_rtx_codec);
2681 EXPECT_TRUE(channel_->SetRecvCodecs(codecs)); 2704 EXPECT_TRUE(channel_->SetRecvCodecs(codecs));
2682 2705
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3165 // Ensures that the correct settings are applied to the codec when two temporal 3188 // Ensures that the correct settings are applied to the codec when two temporal
3166 // layer screencasting is enabled, and that the correct simulcast settings are 3189 // layer screencasting is enabled, and that the correct simulcast settings are
3167 // reapplied when disabling screencasting. 3190 // reapplied when disabling screencasting.
3168 TEST_F(WebRtcVideoChannel2SimulcastTest, 3191 TEST_F(WebRtcVideoChannel2SimulcastTest,
3169 DISABLED_TwoTemporalLayerScreencastSettings) { 3192 DISABLED_TwoTemporalLayerScreencastSettings) {
3170 // TODO(pbos): Implement. 3193 // TODO(pbos): Implement.
3171 FAIL() << "Not implemented."; 3194 FAIL() << "Not implemented.";
3172 } 3195 }
3173 3196
3174 } // namespace cricket 3197 } // namespace cricket
OLDNEW
« 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