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

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2523773003: Keep all codec parameters in VideoReceiveStream::Decoder (Closed)
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3751 3751
3752 FakeVideoReceiveStream* recv_stream = AddRecvStream(); 3752 FakeVideoReceiveStream* recv_stream = AddRecvStream();
3753 const webrtc::VideoReceiveStream::Config& cfg = recv_stream->GetConfig(); 3753 const webrtc::VideoReceiveStream::Config& cfg = recv_stream->GetConfig();
3754 webrtc::RtpParameters rtp_parameters = 3754 webrtc::RtpParameters rtp_parameters =
3755 channel_->GetRtpReceiveParameters(last_ssrc_); 3755 channel_->GetRtpReceiveParameters(last_ssrc_);
3756 ASSERT_EQ(2u, rtp_parameters.codecs.size()); 3756 ASSERT_EQ(2u, rtp_parameters.codecs.size());
3757 EXPECT_EQ(kH264sprop1.ToCodecParameters(), rtp_parameters.codecs[0]); 3757 EXPECT_EQ(kH264sprop1.ToCodecParameters(), rtp_parameters.codecs[0]);
3758 ASSERT_EQ(2u, cfg.decoders.size()); 3758 ASSERT_EQ(2u, cfg.decoders.size());
3759 EXPECT_EQ(101, cfg.decoders[0].payload_type); 3759 EXPECT_EQ(101, cfg.decoders[0].payload_type);
3760 EXPECT_EQ("H264", cfg.decoders[0].payload_name); 3760 EXPECT_EQ("H264", cfg.decoders[0].payload_name);
3761 std::string sprop; 3761 const auto it0 = cfg.decoders[0].codec_params.find("sprop-parameter-sets");
3762 const webrtc::DecoderSpecificSettings* decoder_specific; 3762 EXPECT_TRUE(it0 != cfg.decoders[0].codec_params.end());
sprang_webrtc 2016/11/24 14:59:46 maybe even ASSERT_TRUE, since you're dereferencing
magjed_webrtc 2016/11/24 17:11:56 Done.
3763 decoder_specific = &cfg.decoders[0].decoder_specific; 3763 EXPECT_EQ("uvw", it0->second);
3764 ASSERT_TRUE(static_cast<bool>(decoder_specific->h264_extra_settings));
3765 sprop = decoder_specific->h264_extra_settings->sprop_parameter_sets;
3766 EXPECT_EQ("uvw", sprop);
3767 3764
3768 EXPECT_EQ(102, cfg.decoders[1].payload_type); 3765 EXPECT_EQ(102, cfg.decoders[1].payload_type);
3769 EXPECT_EQ("H264", cfg.decoders[1].payload_name); 3766 EXPECT_EQ("H264", cfg.decoders[1].payload_name);
3770 decoder_specific = &cfg.decoders[1].decoder_specific; 3767 const auto it1 = cfg.decoders[1].codec_params.find("sprop-parameter-sets");
3771 ASSERT_TRUE(static_cast<bool>(decoder_specific->h264_extra_settings)); 3768 EXPECT_TRUE(it1 != cfg.decoders[1].codec_params.end());
3772 sprop = decoder_specific->h264_extra_settings->sprop_parameter_sets; 3769 EXPECT_EQ("xyz", it1->second);
3773 EXPECT_EQ("xyz", sprop);
3774 } 3770 }
3775 3771
3776 // Test that RtpParameters for receive stream has one encoding and it has 3772 // Test that RtpParameters for receive stream has one encoding and it has
3777 // the correct SSRC. 3773 // the correct SSRC.
3778 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) { 3774 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) {
3779 AddRecvStream(); 3775 AddRecvStream();
3780 3776
3781 webrtc::RtpParameters rtp_parameters = 3777 webrtc::RtpParameters rtp_parameters =
3782 channel_->GetRtpReceiveParameters(last_ssrc_); 3778 channel_->GetRtpReceiveParameters(last_ssrc_);
3783 ASSERT_EQ(1u, rtp_parameters.encodings.size()); 3779 ASSERT_EQ(1u, rtp_parameters.encodings.size());
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3989 3985
3990 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { 3986 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) {
3991 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); 3987 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3);
3992 } 3988 }
3993 3989
3994 // Test that we normalize send codec format size in simulcast. 3990 // Test that we normalize send codec format size in simulcast.
3995 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3991 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3996 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); 3992 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2);
3997 } 3993 }
3998 } // namespace cricket 3994 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698