Delete NullEventFactory
A preparation for deleting EventFactory and EventWrapper, to instead
use rtc::Event directly.
Bug: webrtc:3380
Change-Id: I4c40daca9268e57b06d506d91e09365091c42ad6
Reviewed-on: https://webrtc-review.googlesource.com/c/109880
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25545}
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index b5e1b22..20c6c1b 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -850,7 +850,6 @@
"session_info_unittest.cc",
"test/stream_generator.cc",
"test/stream_generator.h",
- "test/test_util.h",
"timing_unittest.cc",
"utility/default_video_bitrate_allocator_unittest.cc",
"utility/frame_dropper_unittest.cc",
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index 6ae65d6..3ed18a9 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -20,7 +20,6 @@
#include "modules/video_coding/media_opt_util.h"
#include "modules/video_coding/packet.h"
#include "modules/video_coding/test/stream_generator.h"
-#include "modules/video_coding/test/test_util.h"
#include "rtc_base/location.h"
#include "system_wrappers/include/clock.h"
#include "system_wrappers/include/field_trial.h"
@@ -220,9 +219,7 @@
void SetUp() override {
clock_.reset(new SimulatedClock(0));
jitter_buffer_.reset(new VCMJitterBuffer(
- clock_.get(),
- std::unique_ptr<EventWrapper>(event_factory_.CreateEvent()), this,
- this));
+ clock_.get(), absl::WrapUnique(EventWrapper::Create()), this, this));
jitter_buffer_->Start();
seq_num_ = 1234;
timestamp_ = 0;
@@ -313,7 +310,6 @@
uint8_t data_[1500];
std::unique_ptr<VCMPacket> packet_;
std::unique_ptr<SimulatedClock> clock_;
- NullEventFactory event_factory_;
std::unique_ptr<VCMJitterBuffer> jitter_buffer_;
};
@@ -339,9 +335,7 @@
max_nack_list_size_ = 150;
oldest_packet_to_nack_ = 250;
jitter_buffer_ = new VCMJitterBuffer(
- clock_.get(),
- std::unique_ptr<EventWrapper>(event_factory_.CreateEvent()), this,
- this);
+ clock_.get(), absl::WrapUnique(EventWrapper::Create()), this, this);
stream_generator_ = new StreamGenerator(0, clock_->TimeInMilliseconds());
jitter_buffer_->Start();
jitter_buffer_->SetNackSettings(max_nack_list_size_, oldest_packet_to_nack_,
@@ -433,7 +427,6 @@
VCMJitterBuffer* jitter_buffer_;
StreamGenerator* stream_generator_;
std::unique_ptr<SimulatedClock> clock_;
- NullEventFactory event_factory_;
size_t max_nack_list_size_;
int oldest_packet_to_nack_;
uint8_t data_buffer_[kDataBufferSize];
diff --git a/modules/video_coding/receiver_unittest.cc b/modules/video_coding/receiver_unittest.cc
index 1ff8662..320d466 100644
--- a/modules/video_coding/receiver_unittest.cc
+++ b/modules/video_coding/receiver_unittest.cc
@@ -18,7 +18,6 @@
#include "modules/video_coding/packet.h"
#include "modules/video_coding/receiver.h"
#include "modules/video_coding/test/stream_generator.h"
-#include "modules/video_coding/test/test_util.h"
#include "modules/video_coding/timing.h"
#include "rtc_base/checks.h"
#include "system_wrappers/include/clock.h"
@@ -31,7 +30,7 @@
TestVCMReceiver()
: clock_(new SimulatedClock(0)),
timing_(clock_.get()),
- receiver_(&timing_, clock_.get(), &event_factory_) {
+ receiver_(&timing_, clock_.get(), nullptr) {
stream_generator_.reset(
new StreamGenerator(0, clock_->TimeInMilliseconds()));
}
@@ -81,7 +80,6 @@
std::unique_ptr<SimulatedClock> clock_;
VCMTiming timing_;
- NullEventFactory event_factory_;
VCMReceiver receiver_;
std::unique_ptr<StreamGenerator> stream_generator_;
};
diff --git a/modules/video_coding/test/test_util.h b/modules/video_coding/test/test_util.h
deleted file mode 100644
index a38fc58..0000000
--- a/modules/video_coding/test/test_util.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
-#define MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
-
-#include "system_wrappers/include/event_wrapper.h"
-
-class NullEventFactory : public webrtc::EventFactory {
- public:
- virtual ~NullEventFactory() {}
-
- webrtc::EventWrapper* CreateEvent() override { return new NullEvent; }
-
- private:
- // Private class to avoid more dependencies on it in tests.
- class NullEvent : public webrtc::EventWrapper {
- public:
- ~NullEvent() override {}
- bool Set() override { return true; }
- webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT
- return webrtc::kEventTimeout;
- }
- };
-};
-
-#endif // MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
diff --git a/modules/video_coding/video_receiver_unittest.cc b/modules/video_coding/video_receiver_unittest.cc
index f50398c..c446108 100644
--- a/modules/video_coding/video_receiver_unittest.cc
+++ b/modules/video_coding/video_receiver_unittest.cc
@@ -14,7 +14,6 @@
#include "api/test/mock_video_decoder.h"
#include "modules/video_coding/include/mock/mock_vcm_callbacks.h"
#include "modules/video_coding/include/video_coding.h"
-#include "modules/video_coding/test/test_util.h"
#include "modules/video_coding/timing.h"
#include "modules/video_coding/video_coding_impl.h"
#include "system_wrappers/include/clock.h"
@@ -37,7 +36,7 @@
virtual void SetUp() {
timing_.reset(new VCMTiming(&clock_));
- receiver_.reset(new VideoReceiver(&clock_, &event_factory_, timing_.get()));
+ receiver_.reset(new VideoReceiver(&clock_, nullptr, timing_.get()));
receiver_->RegisterExternalDecoder(&decoder_, kUnusedPayloadType);
const size_t kMaxNackListSize = 250;
const int kMaxPacketAgeToNack = 450;
@@ -81,7 +80,6 @@
}
SimulatedClock clock_;
- NullEventFactory event_factory_;
VideoCodec settings_;
NiceMock<MockVideoDecoder> decoder_;
NiceMock<MockPacketRequestCallback> packet_request_callback_;