Chromium Code Reviews| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly | 158 // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly |
| 159 // initialized when the constructor is called. | 159 // initialized when the constructor is called. |
| 160 WebRtcVoiceEngine voice_engine_; | 160 WebRtcVoiceEngine voice_engine_; |
| 161 WebRtcVideoEngine2 engine_; | 161 WebRtcVideoEngine2 engine_; |
| 162 VideoCodec default_codec_; | 162 VideoCodec default_codec_; |
| 163 VideoCodec default_red_codec_; | 163 VideoCodec default_red_codec_; |
| 164 VideoCodec default_ulpfec_codec_; | 164 VideoCodec default_ulpfec_codec_; |
| 165 std::map<int, int> default_apt_rtx_types_; | 165 std::map<int, int> default_apt_rtx_types_; |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 class WebRtcVideoEngine2VoiceTest : public WebRtcVideoEngine2Test { | |
| 169 public: | |
| 170 WebRtcVideoEngine2VoiceTest() : WebRtcVideoEngine2Test(&voice_engine_) {} | |
| 171 }; | |
| 172 | |
| 173 TEST_F(WebRtcVideoEngine2VoiceTest, ConfiguresAvSyncForFirstReceiveChannel) { | |
| 174 FakeCallFactory call_factory; | |
| 175 engine_.SetCallFactory(&call_factory); | |
| 176 voice_engine_.Init(rtc::Thread::Current()); | |
| 177 engine_.Init(); | |
| 178 | |
| 179 rtc::scoped_ptr<VoiceMediaChannel> voice_channel( | |
| 180 voice_engine_.CreateChannel(cricket::AudioOptions())); | |
| 181 ASSERT_TRUE(voice_channel.get() != nullptr); | |
| 182 WebRtcVoiceMediaChannel* webrtc_voice_channel = | |
| 183 static_cast<WebRtcVoiceMediaChannel*>(voice_channel.get()); | |
| 184 ASSERT_NE(webrtc_voice_channel->voe_channel(), -1); | |
| 185 rtc::scoped_ptr<VideoMediaChannel> channel( | |
| 186 engine_.CreateChannel(cricket::VideoOptions(), voice_channel.get())); | |
| 187 | |
| 188 FakeCall* fake_call = call_factory.GetCall(); | |
| 189 ASSERT_TRUE(fake_call != nullptr); | |
| 190 | |
| 191 webrtc::Call::Config call_config = fake_call->GetConfig(); | |
| 192 | |
| 193 ASSERT_TRUE(voice_engine_.voe()->engine() != nullptr); | |
| 194 ASSERT_EQ(voice_engine_.voe()->engine(), call_config.voice_engine); | |
| 195 | |
| 196 EXPECT_TRUE(channel->AddRecvStream(StreamParams::CreateLegacy(kSsrc))); | |
| 197 EXPECT_TRUE(channel->AddRecvStream(StreamParams::CreateLegacy(kSsrc + 1))); | |
| 198 std::vector<FakeVideoReceiveStream*> receive_streams = | |
| 199 fake_call->GetVideoReceiveStreams(); | |
| 200 | |
| 201 ASSERT_EQ(2u, receive_streams.size()); | |
| 202 EXPECT_EQ(webrtc_voice_channel->voe_channel(), | |
| 203 receive_streams[0]->GetConfig().audio_channel_id); | |
| 204 EXPECT_EQ(-1, receive_streams[1]->GetConfig().audio_channel_id) | |
| 205 << "AV sync should only be set up for the first receive channel."; | |
| 206 } | |
| 207 | |
| 208 TEST_F(WebRtcVideoEngine2Test, FindCodec) { | 168 TEST_F(WebRtcVideoEngine2Test, FindCodec) { |
| 209 const std::vector<cricket::VideoCodec>& c = engine_.codecs(); | 169 const std::vector<cricket::VideoCodec>& c = engine_.codecs(); |
| 210 EXPECT_EQ(cricket::DefaultVideoCodecList().size(), c.size()); | 170 EXPECT_EQ(cricket::DefaultVideoCodecList().size(), c.size()); |
| 211 | 171 |
| 212 cricket::VideoCodec vp8(104, "VP8", 320, 200, 30, 0); | 172 cricket::VideoCodec vp8(104, "VP8", 320, 200, 30, 0); |
| 213 EXPECT_TRUE(engine_.FindCodec(vp8)); | 173 EXPECT_TRUE(engine_.FindCodec(vp8)); |
| 214 | 174 |
| 215 cricket::VideoCodec vp8_ci(104, "vp8", 320, 200, 30, 0); | 175 cricket::VideoCodec vp8_ci(104, "vp8", 320, 200, 30, 0); |
| 216 EXPECT_TRUE(engine_.FindCodec(vp8)); | 176 EXPECT_TRUE(engine_.FindCodec(vp8)); |
| 217 | 177 |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 991 } else { | 951 } else { |
| 992 return AddSendStream(StreamParams::CreateLegacy(last_ssrc_)); | 952 return AddSendStream(StreamParams::CreateLegacy(last_ssrc_)); |
| 993 } | 953 } |
| 994 } | 954 } |
| 995 | 955 |
| 996 FakeCall* fake_call_; | 956 FakeCall* fake_call_; |
| 997 rtc::scoped_ptr<VideoMediaChannel> channel_; | 957 rtc::scoped_ptr<VideoMediaChannel> channel_; |
| 998 uint32 last_ssrc_; | 958 uint32 last_ssrc_; |
| 999 }; | 959 }; |
| 1000 | 960 |
| 961 TEST_F(WebRtcVideoChannel2Test, SetsSyncGroupFromSyncLabel) { | |
| 962 // Test that changing the combined_audio_video_bwe option results in the | |
|
the sun
2015/06/11 11:52:04
c/p error
pbos-webrtc
2015/06/11 14:48:53
Removed, done.
| |
| 963 // expected state changes on an associated Call. | |
| 964 const uint32 kVideoSsrc = 123; | |
| 965 const std::string kSyncLabel = "AvSyncLabel"; | |
| 966 | |
| 967 cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc); | |
| 968 sp.sync_label = kSyncLabel; | |
| 969 EXPECT_TRUE(channel_->AddRecvStream(sp)); | |
| 970 | |
| 971 EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size()); | |
| 972 EXPECT_EQ(kSyncLabel, | |
| 973 fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group) | |
| 974 << "SyncGroup should be set based on sync_label"; | |
| 975 } | |
| 976 | |
| 1001 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { | 977 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { |
| 1002 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); | 978 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); |
| 1003 EXPECT_TRUE(channel_->SetSend(true)); | 979 EXPECT_TRUE(channel_->SetSend(true)); |
| 1004 cricket::VideoOptions options; | 980 cricket::VideoOptions options; |
| 1005 options.conference_mode.Set(true); | 981 options.conference_mode.Set(true); |
| 1006 EXPECT_TRUE(channel_->SetOptions(options)); | 982 EXPECT_TRUE(channel_->SetOptions(options)); |
| 1007 | 983 |
| 1008 // Send side. | 984 // Send side. |
| 1009 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1); | 985 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1); |
| 1010 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); | 986 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); |
| (...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3024 // Ensures that the correct settings are applied to the codec when two temporal | 3000 // Ensures that the correct settings are applied to the codec when two temporal |
| 3025 // layer screencasting is enabled, and that the correct simulcast settings are | 3001 // layer screencasting is enabled, and that the correct simulcast settings are |
| 3026 // reapplied when disabling screencasting. | 3002 // reapplied when disabling screencasting. |
| 3027 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3003 TEST_F(WebRtcVideoChannel2SimulcastTest, |
| 3028 DISABLED_TwoTemporalLayerScreencastSettings) { | 3004 DISABLED_TwoTemporalLayerScreencastSettings) { |
| 3029 // TODO(pbos): Implement. | 3005 // TODO(pbos): Implement. |
| 3030 FAIL() << "Not implemented."; | 3006 FAIL() << "Not implemented."; |
| 3031 } | 3007 } |
| 3032 | 3008 |
| 3033 } // namespace cricket | 3009 } // namespace cricket |
| OLD | NEW |