OLD | NEW |
---|---|
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 Loading... | |
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 ASSERT_NE(nullptr, cfg.decoders[0].decoder_specific); // h264_specifics); | |
3618 std::string sprop; | |
3619 // const rtc::scoped_refptr<webrtc::DecoderSpecificSettings> | |
3620 // decoder_specifics = cfg.decoders[0].decoder_specific; | |
3621 // sprop = decoder_specifics->h264_extra_settings->spropParameterSets; | |
sprang_webrtc
2016/07/27 08:37:25
Missing cleanup? :)
| |
3622 sprop = | |
3623 cfg.decoders[0].decoder_specific->h264_extra_settings->spropParameterSets; | |
sprang_webrtc
2016/07/27 08:37:25
h264_extra_settings is an optional, check if popul
| |
3624 EXPECT_EQ("uvw", sprop); | |
3625 | |
3626 EXPECT_EQ(102, cfg.decoders[1].payload_type); | |
3627 EXPECT_EQ("H264", cfg.decoders[1].payload_name); | |
3628 ASSERT_NE(nullptr, cfg.decoders[0].decoder_specific); | |
3629 sprop = | |
3630 cfg.decoders[0].decoder_specific->h264_extra_settings->spropParameterSets; | |
3631 EXPECT_EQ("xyz", sprop); | |
3632 } | |
3633 | |
3598 // Test that RtpParameters for receive stream has one encoding and it has | 3634 // Test that RtpParameters for receive stream has one encoding and it has |
3599 // the correct SSRC. | 3635 // the correct SSRC. |
3600 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) { | 3636 TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) { |
3601 AddRecvStream(); | 3637 AddRecvStream(); |
3602 | 3638 |
3603 webrtc::RtpParameters rtp_parameters = | 3639 webrtc::RtpParameters rtp_parameters = |
3604 channel_->GetRtpReceiveParameters(last_ssrc_); | 3640 channel_->GetRtpReceiveParameters(last_ssrc_); |
3605 ASSERT_EQ(1u, rtp_parameters.encodings.size()); | 3641 ASSERT_EQ(1u, rtp_parameters.encodings.size()); |
3606 EXPECT_EQ(rtc::Optional<uint32_t>(last_ssrc_), | 3642 EXPECT_EQ(rtc::Optional<uint32_t>(last_ssrc_), |
3607 rtp_parameters.encodings[0].ssrc); | 3643 rtp_parameters.encodings[0].ssrc); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3814 } | 3850 } |
3815 | 3851 |
3816 // Test that we normalize send codec format size in simulcast. | 3852 // Test that we normalize send codec format size in simulcast. |
3817 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3853 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3818 cricket::VideoCodec codec(kVp8Codec270p); | 3854 cricket::VideoCodec codec(kVp8Codec270p); |
3819 codec.width += 1; | 3855 codec.width += 1; |
3820 codec.height += 1; | 3856 codec.height += 1; |
3821 VerifySimulcastSettings(codec, 2, 2); | 3857 VerifySimulcastSettings(codec, 2, 2); |
3822 } | 3858 } |
3823 } // namespace cricket | 3859 } // namespace cricket |
OLD | NEW |