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 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2809 | 2809 |
2810 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { | 2810 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { |
2811 TestReceiveUnsignalledSsrcPacket(kRedRtxPayloadType, false); | 2811 TestReceiveUnsignalledSsrcPacket(kRedRtxPayloadType, false); |
2812 } | 2812 } |
2813 | 2813 |
2814 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( | 2814 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( |
2815 bool receiver_first) { | 2815 bool receiver_first) { |
2816 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); | 2816 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
2817 | 2817 |
2818 const uint32_t kSenderSsrc = 0xC0FFEE; | 2818 const uint32_t kSenderSsrc = 0xC0FFEE; |
| 2819 const uint32_t kSecondSenderSsrc = 0xBADCAFE; |
2819 const uint32_t kReceiverSsrc = 0x4711; | 2820 const uint32_t kReceiverSsrc = 0x4711; |
| 2821 const uint32_t kExpectedDefaultReceiverSsrc = 1; |
2820 | 2822 |
2821 if (receiver_first) { | 2823 if (receiver_first) { |
2822 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); | 2824 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); |
2823 std::vector<FakeVideoReceiveStream*> receive_streams = | 2825 std::vector<FakeVideoReceiveStream*> receive_streams = |
2824 fake_call_->GetVideoReceiveStreams(); | 2826 fake_call_->GetVideoReceiveStreams(); |
2825 ASSERT_EQ(1u, receive_streams.size()); | 2827 ASSERT_EQ(1u, receive_streams.size()); |
2826 // Bogus local SSRC when we have no sender. | 2828 // Default local SSRC when we have no sender. |
2827 EXPECT_EQ(1, receive_streams[0]->GetConfig().rtp.local_ssrc); | 2829 EXPECT_EQ(kExpectedDefaultReceiverSsrc, |
| 2830 receive_streams[0]->GetConfig().rtp.local_ssrc); |
2828 } | 2831 } |
2829 AddSendStream(StreamParams::CreateLegacy(kSenderSsrc)); | 2832 AddSendStream(StreamParams::CreateLegacy(kSenderSsrc)); |
2830 if (!receiver_first) | 2833 if (!receiver_first) |
2831 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); | 2834 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); |
2832 std::vector<FakeVideoReceiveStream*> receive_streams = | 2835 std::vector<FakeVideoReceiveStream*> receive_streams = |
2833 fake_call_->GetVideoReceiveStreams(); | 2836 fake_call_->GetVideoReceiveStreams(); |
2834 ASSERT_EQ(1u, receive_streams.size()); | 2837 ASSERT_EQ(1u, receive_streams.size()); |
2835 EXPECT_EQ(kSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc); | 2838 EXPECT_EQ(kSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc); |
| 2839 |
| 2840 // Removing first sender should fall back to another (in this case the second) |
| 2841 // local send stream's SSRC. |
| 2842 AddSendStream(StreamParams::CreateLegacy(kSecondSenderSsrc)); |
| 2843 ASSERT_TRUE(channel_->RemoveSendStream(kSenderSsrc)); |
| 2844 receive_streams = |
| 2845 fake_call_->GetVideoReceiveStreams(); |
| 2846 ASSERT_EQ(1u, receive_streams.size()); |
| 2847 EXPECT_EQ(kSecondSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc); |
| 2848 |
| 2849 // Removing the last sender should fall back to default local SSRC. |
| 2850 ASSERT_TRUE(channel_->RemoveSendStream(kSecondSenderSsrc)); |
| 2851 receive_streams = |
| 2852 fake_call_->GetVideoReceiveStreams(); |
| 2853 ASSERT_EQ(1u, receive_streams.size()); |
| 2854 EXPECT_EQ(kExpectedDefaultReceiverSsrc, |
| 2855 receive_streams[0]->GetConfig().rtp.local_ssrc); |
2836 } | 2856 } |
2837 | 2857 |
2838 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrc) { | 2858 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrc) { |
2839 TestReceiverLocalSsrcConfiguration(false); | 2859 TestReceiverLocalSsrcConfiguration(false); |
2840 } | 2860 } |
2841 | 2861 |
2842 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) { | 2862 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) { |
2843 TestReceiverLocalSsrcConfiguration(true); | 2863 TestReceiverLocalSsrcConfiguration(true); |
2844 } | 2864 } |
2845 | 2865 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 // Ensures that the correct settings are applied to the codec when two temporal | 3226 // Ensures that the correct settings are applied to the codec when two temporal |
3207 // layer screencasting is enabled, and that the correct simulcast settings are | 3227 // layer screencasting is enabled, and that the correct simulcast settings are |
3208 // reapplied when disabling screencasting. | 3228 // reapplied when disabling screencasting. |
3209 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3229 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3210 DISABLED_TwoTemporalLayerScreencastSettings) { | 3230 DISABLED_TwoTemporalLayerScreencastSettings) { |
3211 // TODO(pbos): Implement. | 3231 // TODO(pbos): Implement. |
3212 FAIL() << "Not implemented."; | 3232 FAIL() << "Not implemented."; |
3213 } | 3233 } |
3214 | 3234 |
3215 } // namespace cricket | 3235 } // namespace cricket |
OLD | NEW |