Use VideoSourceInterface for owning test video sources
CallTest, VideoQualityTest and VideoAnalyzer used test::TestVideoCapturer
as an interface for video sources. Change to use VideoSourceInterface instead,
since that's all they need.
This is a preparation for making test::VcmCapturer usable as a
VideoTrackSource, and replace use of cricket::VideoCapturer in example code.
Bug: webrtc:6353
Change-Id: I445f5f6f9b7342230b89f53a5722df9c9e92834f
Reviewed-on: https://webrtc-review.googlesource.com/c/114881
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26047}
diff --git a/test/call_test.cc b/test/call_test.cc
index 7a01079..80b86f0 100644
--- a/test/call_test.cc
+++ b/test/call_test.cc
@@ -63,7 +63,7 @@
task_queue_.SendTask([this]() {
fake_send_audio_device_ = nullptr;
fake_recv_audio_device_ = nullptr;
- video_capturers_.clear();
+ video_sources_.clear();
});
}
@@ -454,12 +454,10 @@
int width,
int height) {
video_sources_.clear();
- video_capturers_.clear();
frame_generator_capturer_ = test::FrameGeneratorCapturer::Create(
width, height, absl::nullopt, absl::nullopt, framerate * speed, clock);
- video_capturers_.emplace_back(
+ video_sources_.emplace_back(
std::unique_ptr<FrameGeneratorCapturer>(frame_generator_capturer_));
- video_sources_.push_back(video_capturers_.back().get());
ConnectVideoSourcesToStreams();
}
@@ -467,12 +465,10 @@
int width,
int height) {
video_sources_.clear();
- video_capturers_.clear();
frame_generator_capturer_ = test::FrameGeneratorCapturer::Create(
width, height, absl::nullopt, absl::nullopt, framerate, clock_);
- video_capturers_.emplace_back(
+ video_sources_.emplace_back(
std::unique_ptr<FrameGeneratorCapturer>(frame_generator_capturer_));
- video_sources_.push_back(video_capturers_.back().get());
ConnectVideoSourcesToStreams();
}
@@ -560,7 +556,7 @@
void CallTest::ConnectVideoSourcesToStreams() {
for (size_t i = 0; i < video_sources_.size(); ++i)
- video_send_streams_[i]->SetSource(video_sources_[i],
+ video_send_streams_[i]->SetSource(video_sources_[i].get(),
degradation_preference_);
}