OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2009 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 187 } |
188 } | 188 } |
189 typename T::Channel* CreateChannel( | 189 typename T::Channel* CreateChannel( |
190 rtc::Thread* thread, | 190 rtc::Thread* thread, |
191 cricket::MediaEngineInterface* engine, | 191 cricket::MediaEngineInterface* engine, |
192 typename T::MediaChannel* ch, | 192 typename T::MediaChannel* ch, |
193 cricket::TransportController* transport_controller, | 193 cricket::TransportController* transport_controller, |
194 bool rtcp) { | 194 bool rtcp) { |
195 typename T::Channel* channel = new typename T::Channel( | 195 typename T::Channel* channel = new typename T::Channel( |
196 thread, engine, ch, transport_controller, cricket::CN_AUDIO, rtcp); | 196 thread, engine, ch, transport_controller, cricket::CN_AUDIO, rtcp); |
197 if (!channel->Init()) { | 197 if (!channel->Init(cricket::CN_AUDIO)) { |
198 delete channel; | 198 delete channel; |
199 channel = NULL; | 199 channel = NULL; |
200 } | 200 } |
201 return channel; | 201 return channel; |
202 } | 202 } |
203 | 203 |
204 bool SendInitiate() { | 204 bool SendInitiate() { |
205 bool result = channel1_->SetLocalContent(&local_media_content1_, | 205 bool result = channel1_->SetLocalContent(&local_media_content1_, |
206 CA_OFFER, NULL); | 206 CA_OFFER, NULL); |
207 if (result) { | 207 if (result) { |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 // override to add NULL parameter | 1969 // override to add NULL parameter |
1970 template <> | 1970 template <> |
1971 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( | 1971 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( |
1972 rtc::Thread* thread, | 1972 rtc::Thread* thread, |
1973 cricket::MediaEngineInterface* engine, | 1973 cricket::MediaEngineInterface* engine, |
1974 cricket::FakeVideoMediaChannel* ch, | 1974 cricket::FakeVideoMediaChannel* ch, |
1975 cricket::TransportController* transport_controller, | 1975 cricket::TransportController* transport_controller, |
1976 bool rtcp) { | 1976 bool rtcp) { |
1977 cricket::VideoChannel* channel = new cricket::VideoChannel( | 1977 cricket::VideoChannel* channel = new cricket::VideoChannel( |
1978 thread, ch, transport_controller, cricket::CN_VIDEO, rtcp); | 1978 thread, ch, transport_controller, cricket::CN_VIDEO, rtcp); |
1979 if (!channel->Init()) { | 1979 if (!channel->Init(cricket::CN_VIDEO)) { |
1980 delete channel; | 1980 delete channel; |
1981 channel = NULL; | 1981 channel = NULL; |
1982 } | 1982 } |
1983 return channel; | 1983 return channel; |
1984 } | 1984 } |
1985 | 1985 |
1986 // override to add 0 parameter | 1986 // override to add 0 parameter |
1987 template<> | 1987 template<> |
1988 bool ChannelTest<VideoTraits>::AddStream1(int id) { | 1988 bool ChannelTest<VideoTraits>::AddStream1(int id) { |
1989 return channel1_->AddRecvStream(cricket::StreamParams::CreateLegacy(id)); | 1989 return channel1_->AddRecvStream(cricket::StreamParams::CreateLegacy(id)); |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 // Override to avoid engine channel parameter. | 2623 // Override to avoid engine channel parameter. |
2624 template <> | 2624 template <> |
2625 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel( | 2625 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel( |
2626 rtc::Thread* thread, | 2626 rtc::Thread* thread, |
2627 cricket::MediaEngineInterface* engine, | 2627 cricket::MediaEngineInterface* engine, |
2628 cricket::FakeDataMediaChannel* ch, | 2628 cricket::FakeDataMediaChannel* ch, |
2629 cricket::TransportController* transport_controller, | 2629 cricket::TransportController* transport_controller, |
2630 bool rtcp) { | 2630 bool rtcp) { |
2631 cricket::DataChannel* channel = new cricket::DataChannel( | 2631 cricket::DataChannel* channel = new cricket::DataChannel( |
2632 thread, ch, transport_controller, cricket::CN_DATA, rtcp); | 2632 thread, ch, transport_controller, cricket::CN_DATA, rtcp); |
2633 if (!channel->Init()) { | 2633 if (!channel->Init(cricket::CN_DATA)) { |
2634 delete channel; | 2634 delete channel; |
2635 channel = NULL; | 2635 channel = NULL; |
2636 } | 2636 } |
2637 return channel; | 2637 return channel; |
2638 } | 2638 } |
2639 | 2639 |
2640 template<> | 2640 template<> |
2641 void ChannelTest<DataTraits>::CreateContent( | 2641 void ChannelTest<DataTraits>::CreateContent( |
2642 int flags, | 2642 int flags, |
2643 const cricket::AudioCodec& audio_codec, | 2643 const cricket::AudioCodec& audio_codec, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2810 }; | 2810 }; |
2811 rtc::CopyOnWriteBuffer payload(data, 3); | 2811 rtc::CopyOnWriteBuffer payload(data, 3); |
2812 cricket::SendDataResult result; | 2812 cricket::SendDataResult result; |
2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2814 EXPECT_EQ(params.ssrc, | 2814 EXPECT_EQ(params.ssrc, |
2815 media_channel1_->last_sent_data_params().ssrc); | 2815 media_channel1_->last_sent_data_params().ssrc); |
2816 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2816 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2817 } | 2817 } |
2818 | 2818 |
2819 // TODO(pthatcher): TestSetReceiver? | 2819 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |