OLD | NEW |
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 cricket::VideoCodec fec(102, "ULPFEC", 0, 0, 30, 0); | 200 cricket::VideoCodec fec(102, "ULPFEC", 0, 0, 30, 0); |
201 EXPECT_TRUE(engine_.FindCodec(fec)); | 201 EXPECT_TRUE(engine_.FindCodec(fec)); |
202 | 202 |
203 cricket::VideoCodec fec_ci(102, "ulpfec", 0, 0, 30, 0); | 203 cricket::VideoCodec fec_ci(102, "ulpfec", 0, 0, 30, 0); |
204 EXPECT_TRUE(engine_.FindCodec(fec)); | 204 EXPECT_TRUE(engine_.FindCodec(fec)); |
205 | 205 |
206 cricket::VideoCodec rtx(96, "rtx", 0, 0, 30, 0); | 206 cricket::VideoCodec rtx(96, "rtx", 0, 0, 30, 0); |
207 EXPECT_TRUE(engine_.FindCodec(rtx)); | 207 EXPECT_TRUE(engine_.FindCodec(rtx)); |
208 } | 208 } |
209 | 209 |
210 TEST_F(WebRtcVideoEngine2Test, SetDefaultEncoderConfigPreservesFeedbackParams) { | |
211 cricket::VideoCodec max_settings( | |
212 engine_.codecs()[0].id, engine_.codecs()[0].name, | |
213 engine_.codecs()[0].width / 2, engine_.codecs()[0].height / 2, 30, 0); | |
214 // This codec shouldn't have NACK by default or the test is pointless. | |
215 EXPECT_FALSE(max_settings.HasFeedbackParam( | |
216 FeedbackParam(kRtcpFbParamNack, kParamValueEmpty))); | |
217 // The engine should by default have it however. | |
218 EXPECT_TRUE(engine_.codecs()[0].HasFeedbackParam( | |
219 FeedbackParam(kRtcpFbParamNack, kParamValueEmpty))); | |
220 | |
221 // Set constrained max codec settings. | |
222 EXPECT_TRUE(engine_.SetDefaultEncoderConfig( | |
223 cricket::VideoEncoderConfig(max_settings))); | |
224 | |
225 // Verify that feedback parameters are retained. | |
226 EXPECT_TRUE(engine_.codecs()[0].HasFeedbackParam( | |
227 FeedbackParam(kRtcpFbParamNack, kParamValueEmpty))); | |
228 } | |
229 | |
230 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { | 210 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { |
231 std::vector<VideoCodec> engine_codecs = engine_.codecs(); | 211 std::vector<VideoCodec> engine_codecs = engine_.codecs(); |
232 for (size_t i = 0; i < engine_codecs.size(); ++i) { | 212 for (size_t i = 0; i < engine_codecs.size(); ++i) { |
233 if (engine_codecs[i].name != kRtxCodecName) | 213 if (engine_codecs[i].name != kRtxCodecName) |
234 continue; | 214 continue; |
235 int associated_payload_type; | 215 int associated_payload_type; |
236 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, | 216 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, |
237 &associated_payload_type)); | 217 &associated_payload_type)); |
238 EXPECT_EQ(default_codec_.id, associated_payload_type); | 218 EXPECT_EQ(default_codec_.id, associated_payload_type); |
239 return; | 219 return; |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 codecs.push_back(kH264Codec); | 768 codecs.push_back(kH264Codec); |
789 | 769 |
790 rtc::scoped_ptr<VideoMediaChannel> channel( | 770 rtc::scoped_ptr<VideoMediaChannel> channel( |
791 SetUpForExternalDecoderFactory(&decoder_factory, codecs)); | 771 SetUpForExternalDecoderFactory(&decoder_factory, codecs)); |
792 | 772 |
793 EXPECT_TRUE( | 773 EXPECT_TRUE( |
794 channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc))); | 774 channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc))); |
795 ASSERT_EQ(1u, decoder_factory.decoders().size()); | 775 ASSERT_EQ(1u, decoder_factory.decoders().size()); |
796 } | 776 } |
797 | 777 |
798 class WebRtcVideoEngine2BaseTest | |
799 : public VideoEngineTest<cricket::WebRtcVideoEngine2> { | |
800 protected: | |
801 typedef VideoEngineTest<cricket::WebRtcVideoEngine2> Base; | |
802 }; | |
803 | |
804 #define WEBRTC_ENGINE_BASE_TEST(test) \ | |
805 TEST_F(WebRtcVideoEngine2BaseTest, test) { Base::test##Body(); } | |
806 | |
807 WEBRTC_ENGINE_BASE_TEST(ConstrainNewCodec2); | |
808 | |
809 class WebRtcVideoChannel2BaseTest | 778 class WebRtcVideoChannel2BaseTest |
810 : public VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> { | 779 : public VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> { |
811 protected: | 780 protected: |
812 typedef VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> Base; | 781 typedef VideoMediaChannelTest<WebRtcVideoEngine2, WebRtcVideoChannel2> Base; |
813 | 782 |
814 cricket::VideoCodec DefaultCodec() override { return kVp8Codec; } | 783 cricket::VideoCodec DefaultCodec() override { return kVp8Codec; } |
815 }; | 784 }; |
816 | 785 |
817 #define WEBRTC_BASE_TEST(test) \ | 786 #define WEBRTC_BASE_TEST(test) \ |
818 TEST_F(WebRtcVideoChannel2BaseTest, test) { Base::test(); } | 787 TEST_F(WebRtcVideoChannel2BaseTest, test) { Base::test(); } |
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3337 // Ensures that the correct settings are applied to the codec when two temporal | 3306 // Ensures that the correct settings are applied to the codec when two temporal |
3338 // layer screencasting is enabled, and that the correct simulcast settings are | 3307 // layer screencasting is enabled, and that the correct simulcast settings are |
3339 // reapplied when disabling screencasting. | 3308 // reapplied when disabling screencasting. |
3340 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3309 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3341 DISABLED_TwoTemporalLayerScreencastSettings) { | 3310 DISABLED_TwoTemporalLayerScreencastSettings) { |
3342 // TODO(pbos): Implement. | 3311 // TODO(pbos): Implement. |
3343 FAIL() << "Not implemented."; | 3312 FAIL() << "Not implemented."; |
3344 } | 3313 } |
3345 | 3314 |
3346 } // namespace cricket | 3315 } // namespace cricket |
OLD | NEW |