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 : call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))), |
| 68 engine_(nullptr /* external_encoder_factory */, |
| 69 nullptr /* external_decoder_factory */) {} |
68 | 70 |
69 virtual cricket::VideoCodec DefaultCodec() = 0; | 71 virtual cricket::VideoCodec DefaultCodec() = 0; |
70 | 72 |
71 virtual cricket::StreamParams DefaultSendStreamParams() { | 73 virtual cricket::StreamParams DefaultSendStreamParams() { |
72 return cricket::StreamParams::CreateLegacy(kSsrc); | 74 return cricket::StreamParams::CreateLegacy(kSsrc); |
73 } | 75 } |
74 | 76 |
75 virtual void SetUp() { | 77 virtual void SetUp() { |
76 engine_.Init(); | |
77 cricket::MediaConfig media_config; | 78 cricket::MediaConfig media_config; |
78 // Disabling cpu overuse detection actually disables quality scaling too; it | 79 // Disabling cpu overuse detection actually disables quality scaling too; it |
79 // implies DegradationPreference kMaintainResolution. Automatic scaling | 80 // implies DegradationPreference kMaintainResolution. Automatic scaling |
80 // needs to be disabled, otherwise, tests which check the size of received | 81 // needs to be disabled, otherwise, tests which check the size of received |
81 // frames become flaky. | 82 // frames become flaky. |
82 media_config.video.enable_cpu_overuse_detection = false; | 83 media_config.video.enable_cpu_overuse_detection = false; |
83 channel_.reset(engine_.CreateChannel(call_.get(), media_config, | 84 channel_.reset(engine_.CreateChannel(call_.get(), media_config, |
84 cricket::VideoOptions())); | 85 cricket::VideoOptions())); |
85 channel_->OnReadyToSend(true); | 86 channel_->OnReadyToSend(true); |
86 EXPECT_TRUE(channel_.get() != NULL); | 87 EXPECT_TRUE(channel_.get() != NULL); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 std::unique_ptr<C> channel_; | 937 std::unique_ptr<C> channel_; |
937 cricket::FakeNetworkInterface network_interface_; | 938 cricket::FakeNetworkInterface network_interface_; |
938 cricket::FakeVideoRenderer renderer_; | 939 cricket::FakeVideoRenderer renderer_; |
939 cricket::VideoMediaChannel::Error media_error_; | 940 cricket::VideoMediaChannel::Error media_error_; |
940 | 941 |
941 // Used by test cases where 2 streams are run on the same channel. | 942 // Used by test cases where 2 streams are run on the same channel. |
942 cricket::FakeVideoRenderer renderer2_; | 943 cricket::FakeVideoRenderer renderer2_; |
943 }; | 944 }; |
944 | 945 |
945 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT | 946 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT |
OLD | NEW |