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

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

Issue 2185953002: Add decoder-specific settings with proper lifetime. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add h264_extra_settings to VideoReceiveStream::Decoder::ToString() Created 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after
3588 parameters.codecs.push_back(kVp9Codec); 3588 parameters.codecs.push_back(kVp9Codec);
3589 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 3589 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
3590 3590
3591 webrtc::RtpParameters rtp_parameters = 3591 webrtc::RtpParameters rtp_parameters =
3592 channel_->GetRtpReceiveParameters(last_ssrc_); 3592 channel_->GetRtpReceiveParameters(last_ssrc_);
3593 ASSERT_EQ(2u, rtp_parameters.codecs.size()); 3593 ASSERT_EQ(2u, rtp_parameters.codecs.size());
3594 EXPECT_EQ(kVp8Codec.ToCodecParameters(), rtp_parameters.codecs[0]); 3594 EXPECT_EQ(kVp8Codec.ToCodecParameters(), rtp_parameters.codecs[0]);
3595 EXPECT_EQ(kVp9Codec.ToCodecParameters(), rtp_parameters.codecs[1]); 3595 EXPECT_EQ(kVp9Codec.ToCodecParameters(), rtp_parameters.codecs[1]);
3596 } 3596 }
3597 3597
3598 TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveFmtpSprop) {
3599 cricket::VideoRecvParameters parameters;
3600 cricket::VideoCodec kH264sprop1(101, "H264", 640, 400, 15);
3601 kH264sprop1.SetParam("sprop-parameter-sets", "uvw");
3602 parameters.codecs.push_back(kH264sprop1);
3603 cricket::VideoCodec kH264sprop2(102, "H264", 640, 400, 15);
3604 kH264sprop2.SetParam("sprop-parameter-sets", "xyz");
3605 parameters.codecs.push_back(kH264sprop2);
3606 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
3607
3608 FakeVideoReceiveStream* recv_stream = AddRecvStream();
3609 const webrtc::VideoReceiveStream::Config& cfg = recv_stream->GetConfig();
3610 webrtc::RtpParameters rtp_parameters =
3611 channel_->GetRtpReceiveParameters(last_ssrc_);
3612 ASSERT_EQ(2u, rtp_parameters.codecs.size());
3613 EXPECT_EQ(kH264sprop1.ToCodecParameters(), rtp_parameters.codecs[0]);
3614 ASSERT_EQ(2u, cfg.decoders.size());
3615 EXPECT_EQ(101, cfg.decoders[0].payload_type);
3616 EXPECT_EQ("H264", cfg.decoders[0].payload_name);
3617 std::string sprop;
3618 const webrtc::DecoderSpecificSettings* decoder_specific;
3619 decoder_specific = &cfg.decoders[0].decoder_specific;
3620 ASSERT_TRUE(static_cast<bool>(decoder_specific->h264_extra_settings));
3621 sprop = decoder_specific->h264_extra_settings->sprop_parameter_sets;
3622 EXPECT_EQ("uvw", sprop);
3623
3624 EXPECT_EQ(102, cfg.decoders[1].payload_type);
3625 EXPECT_EQ("H264", cfg.decoders[1].payload_name);
3626 decoder_specific = &cfg.decoders[1].decoder_specific;
3627 ASSERT_TRUE(static_cast<bool>(decoder_specific->h264_extra_settings));
3628 sprop = decoder_specific->h264_extra_settings->sprop_parameter_sets;
3629 EXPECT_EQ("xyz", sprop);
3630 }
3631
3598 // Test that RtpParameters for receive stream has one encoding and it has 3632 // Test that RtpParameters for receive stream has one encoding and it has
3599 // the correct SSRC. 3633 // the correct SSRC.
3600 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) { 3634 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) {
3601 AddRecvStream(); 3635 AddRecvStream();
3602 3636
3603 webrtc::RtpParameters rtp_parameters = 3637 webrtc::RtpParameters rtp_parameters =
3604 channel_->GetRtpReceiveParameters(last_ssrc_); 3638 channel_->GetRtpReceiveParameters(last_ssrc_);
3605 ASSERT_EQ(1u, rtp_parameters.encodings.size()); 3639 ASSERT_EQ(1u, rtp_parameters.encodings.size());
3606 EXPECT_EQ(rtc::Optional<uint32_t>(last_ssrc_), 3640 EXPECT_EQ(rtc::Optional<uint32_t>(last_ssrc_),
3607 rtp_parameters.encodings[0].ssrc); 3641 rtp_parameters.encodings[0].ssrc);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
3814 } 3848 }
3815 3849
3816 // Test that we normalize send codec format size in simulcast. 3850 // Test that we normalize send codec format size in simulcast.
3817 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3851 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3818 cricket::VideoCodec codec(kVp8Codec270p); 3852 cricket::VideoCodec codec(kVp8Codec270p);
3819 codec.width += 1; 3853 codec.width += 1;
3820 codec.height += 1; 3854 codec.height += 1;
3821 VerifySimulcastSettings(codec, 2, 2); 3855 VerifySimulcastSettings(codec, 2, 2);
3822 } 3856 }
3823 } // namespace cricket 3857 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698