OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 inline bool IsEqualCodec(const cricket::VideoCodec& a, | 57 inline bool IsEqualCodec(const cricket::VideoCodec& a, |
58 const cricket::VideoCodec& b) { | 58 const cricket::VideoCodec& b) { |
59 return a.id == b.id && a.name == b.name; | 59 return a.id == b.id && a.name == b.name; |
60 } | 60 } |
61 | 61 |
62 template<class E, class C> | 62 template<class E, class C> |
63 class VideoMediaChannelTest : public testing::Test, | 63 class VideoMediaChannelTest : public testing::Test, |
64 public sigslot::has_slots<> { | 64 public sigslot::has_slots<> { |
65 protected: | 65 protected: |
66 VideoMediaChannelTest<E, C>() | 66 VideoMediaChannelTest<E, C>() |
67 : call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))) {} | 67 : rtp_transport_controller_send_( |
| 68 rtc::MakeUnique<webrtc::RtpTransportControllerSend>( |
| 69 webrtc::Clock::GetRealTimeClock(), &event_log_)) { |
| 70 webrtc::Call::Config call_config(&event_log_); |
| 71 call_config.audio_rtp_transport_send = rtp_transport_controller_send_.get(); |
| 72 call_config.video_rtp_transport_send = rtp_transport_controller_send_.get(); |
| 73 call_config.send_side_cc = rtp_transport_controller_send_->send_side_cc(); |
| 74 call_ = rtc::WrapUnique(webrtc::Call::Create(call_config)); |
| 75 } |
68 | 76 |
69 virtual cricket::VideoCodec DefaultCodec() = 0; | 77 virtual cricket::VideoCodec DefaultCodec() = 0; |
70 | 78 |
71 virtual cricket::StreamParams DefaultSendStreamParams() { | 79 virtual cricket::StreamParams DefaultSendStreamParams() { |
72 return cricket::StreamParams::CreateLegacy(kSsrc); | 80 return cricket::StreamParams::CreateLegacy(kSsrc); |
73 } | 81 } |
74 | 82 |
75 virtual void SetUp() { | 83 virtual void SetUp() { |
76 engine_.Init(); | 84 engine_.Init(); |
77 cricket::MediaConfig media_config; | 85 cricket::MediaConfig media_config; |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 SetUpSecondStream(); | 930 SetUpSecondStream(); |
923 // Test sending and receiving on first stream. | 931 // Test sending and receiving on first stream. |
924 SendAndReceive(codec); | 932 SendAndReceive(codec); |
925 // Test sending and receiving on second stream. | 933 // Test sending and receiving on second stream. |
926 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); | 934 EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); |
927 EXPECT_GT(NumRtpPackets(), 0); | 935 EXPECT_GT(NumRtpPackets(), 0); |
928 EXPECT_EQ(1, renderer2_.num_rendered_frames()); | 936 EXPECT_EQ(1, renderer2_.num_rendered_frames()); |
929 } | 937 } |
930 | 938 |
931 webrtc::RtcEventLogNullImpl event_log_; | 939 webrtc::RtcEventLogNullImpl event_log_; |
932 const std::unique_ptr<webrtc::Call> call_; | 940 const std::unique_ptr<webrtc::RtpTransportControllerSendInterface> |
| 941 rtp_transport_controller_send_; |
| 942 std::unique_ptr<webrtc::Call> call_; |
933 E engine_; | 943 E engine_; |
934 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_; | 944 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_; |
935 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_2_; | 945 std::unique_ptr<cricket::FakeVideoCapturer> video_capturer_2_; |
936 std::unique_ptr<C> channel_; | 946 std::unique_ptr<C> channel_; |
937 cricket::FakeNetworkInterface network_interface_; | 947 cricket::FakeNetworkInterface network_interface_; |
938 cricket::FakeVideoRenderer renderer_; | 948 cricket::FakeVideoRenderer renderer_; |
939 cricket::VideoMediaChannel::Error media_error_; | 949 cricket::VideoMediaChannel::Error media_error_; |
940 | 950 |
941 // Used by test cases where 2 streams are run on the same channel. | 951 // Used by test cases where 2 streams are run on the same channel. |
942 cricket::FakeVideoRenderer renderer2_; | 952 cricket::FakeVideoRenderer renderer2_; |
943 }; | 953 }; |
944 | 954 |
945 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT | 955 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT |
OLD | NEW |