OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 22 matching lines...) Loading... |
33 // the "send" flag is applied to the media engine based on the encoding | 33 // the "send" flag is applied to the media engine based on the encoding |
34 // |active| flag. | 34 // |active| flag. |
35 fake_packet_transport_.SetWritable(true); | 35 fake_packet_transport_.SetWritable(true); |
36 fake_media_engine_ = new cricket::FakeMediaEngine(); | 36 fake_media_engine_ = new cricket::FakeMediaEngine(); |
37 // Note: This doesn't need to use fake network classes, since we already | 37 // Note: This doesn't need to use fake network classes, since we already |
38 // use FakePacketTransport. | 38 // use FakePacketTransport. |
39 auto ortc_factory_result = OrtcFactory::Create( | 39 auto ortc_factory_result = OrtcFactory::Create( |
40 nullptr, nullptr, nullptr, nullptr, nullptr, | 40 nullptr, nullptr, nullptr, nullptr, nullptr, |
41 std::unique_ptr<cricket::MediaEngineInterface>(fake_media_engine_)); | 41 std::unique_ptr<cricket::MediaEngineInterface>(fake_media_engine_)); |
42 ortc_factory_ = ortc_factory_result.MoveValue(); | 42 ortc_factory_ = ortc_factory_result.MoveValue(); |
43 RtcpParameters rtcp_parameters; | 43 RtpTransportParameters parameters; |
44 rtcp_parameters.mux = true; | 44 parameters.rtcp.mux = true; |
45 auto rtp_transport_result = ortc_factory_->CreateRtpTransport( | 45 auto rtp_transport_result = ortc_factory_->CreateRtpTransport( |
46 rtcp_parameters, &fake_packet_transport_, nullptr, nullptr); | 46 parameters, &fake_packet_transport_, nullptr, nullptr); |
47 rtp_transport_ = rtp_transport_result.MoveValue(); | 47 rtp_transport_ = rtp_transport_result.MoveValue(); |
48 } | 48 } |
49 | 49 |
50 protected: | 50 protected: |
51 rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack( | 51 rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack( |
52 const std::string& id) { | 52 const std::string& id) { |
53 return ortc_factory_->CreateAudioTrack(id, nullptr); | 53 return ortc_factory_->CreateAudioTrack(id, nullptr); |
54 } | 54 } |
55 | 55 |
56 rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( | 56 rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack( |
(...skipping 89 matching lines...) Loading... |
146 cricket::MEDIA_TYPE_VIDEO, rtp_transport_.get()); | 146 cricket::MEDIA_TYPE_VIDEO, rtp_transport_.get()); |
147 auto video_sender = video_sender_result.MoveValue(); | 147 auto video_sender = video_sender_result.MoveValue(); |
148 EXPECT_EQ(RTCErrorType::INVALID_PARAMETER, | 148 EXPECT_EQ(RTCErrorType::INVALID_PARAMETER, |
149 video_sender->SetTrack(CreateAudioTrack("audio")).type()); | 149 video_sender->SetTrack(CreateAudioTrack("audio")).type()); |
150 } | 150 } |
151 | 151 |
152 // Currently SetTransport isn't supported. When it is, replace this test with a | 152 // Currently SetTransport isn't supported. When it is, replace this test with a |
153 // test/tests for it. | 153 // test/tests for it. |
154 TEST_F(OrtcRtpSenderTest, SetTransportFails) { | 154 TEST_F(OrtcRtpSenderTest, SetTransportFails) { |
155 rtc::FakePacketTransport fake_packet_transport("another_transport"); | 155 rtc::FakePacketTransport fake_packet_transport("another_transport"); |
156 RtcpParameters rtcp_parameters; | 156 RtpTransportParameters parameters; |
157 rtcp_parameters.mux = true; | 157 parameters.rtcp.mux = true; |
158 auto rtp_transport_result = ortc_factory_->CreateRtpTransport( | 158 auto rtp_transport_result = ortc_factory_->CreateRtpTransport( |
159 rtcp_parameters, &fake_packet_transport, nullptr, nullptr); | 159 parameters, &fake_packet_transport, nullptr, nullptr); |
160 auto rtp_transport = rtp_transport_result.MoveValue(); | 160 auto rtp_transport = rtp_transport_result.MoveValue(); |
161 | 161 |
162 auto sender_result = ortc_factory_->CreateRtpSender(cricket::MEDIA_TYPE_AUDIO, | 162 auto sender_result = ortc_factory_->CreateRtpSender(cricket::MEDIA_TYPE_AUDIO, |
163 rtp_transport_.get()); | 163 rtp_transport_.get()); |
164 auto sender = sender_result.MoveValue(); | 164 auto sender = sender_result.MoveValue(); |
165 EXPECT_EQ(RTCErrorType::UNSUPPORTED_OPERATION, | 165 EXPECT_EQ(RTCErrorType::UNSUPPORTED_OPERATION, |
166 sender->SetTransport(rtp_transport.get()).type()); | 166 sender->SetTransport(rtp_transport.get()).type()); |
167 } | 167 } |
168 | 168 |
169 TEST_F(OrtcRtpSenderTest, GetTransport) { | 169 TEST_F(OrtcRtpSenderTest, GetTransport) { |
(...skipping 488 matching lines...) Loading... |
658 cricket::MEDIA_TYPE_AUDIO, rtp_transport_.get()); | 658 cricket::MEDIA_TYPE_AUDIO, rtp_transport_.get()); |
659 auto video_sender_result = ortc_factory_->CreateRtpSender( | 659 auto video_sender_result = ortc_factory_->CreateRtpSender( |
660 CreateVideoTrack("video"), rtp_transport_.get()); | 660 CreateVideoTrack("video"), rtp_transport_.get()); |
661 auto audio_sender = audio_sender_result.MoveValue(); | 661 auto audio_sender = audio_sender_result.MoveValue(); |
662 auto video_sender = video_sender_result.MoveValue(); | 662 auto video_sender = video_sender_result.MoveValue(); |
663 EXPECT_EQ(cricket::MEDIA_TYPE_AUDIO, audio_sender->GetKind()); | 663 EXPECT_EQ(cricket::MEDIA_TYPE_AUDIO, audio_sender->GetKind()); |
664 EXPECT_EQ(cricket::MEDIA_TYPE_VIDEO, video_sender->GetKind()); | 664 EXPECT_EQ(cricket::MEDIA_TYPE_VIDEO, video_sender->GetKind()); |
665 } | 665 } |
666 | 666 |
667 } // namespace webrtc | 667 } // namespace webrtc |
OLD | NEW |