From f1f363fae75714a0259fac32198240f638fee7da Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Mon, 13 Aug 2018 14:24:58 +0200 Subject: [PATCH] Renames test::VideoCapturer to TestVideoCapturer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:9620 Change-Id: Ia9afbc2d4f0448f9479516baa741d925a0aca5ac Reviewed-on: https://webrtc-review.googlesource.com/93760 Reviewed-by: Erik Språng Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#24346} --- test/BUILD.gn | 4 ++-- test/call_test.h | 2 +- test/frame_generator_capturer.cc | 2 +- test/frame_generator_capturer.h | 4 ++-- .../{video_capturer.cc => test_video_capturer.cc} | 15 +++++++++------ test/{video_capturer.h => test_video_capturer.h} | 12 ++++++------ test/vcm_capturer.cc | 2 +- test/vcm_capturer.h | 4 ++-- video/replay.cc | 2 +- video/video_analyzer.cc | 4 ++-- video/video_analyzer.h | 7 ++++--- video/video_quality_test.cc | 8 +++++--- video/video_quality_test.h | 2 +- 13 files changed, 37 insertions(+), 31 deletions(-) rename test/{video_capturer.cc => test_video_capturer.cc} (80%) rename test/{video_capturer.h => test_video_capturer.h} (83%) diff --git a/test/BUILD.gn b/test/BUILD.gn index 6a3762288d..ac56bc6a01 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -44,10 +44,10 @@ rtc_source_set("video_test_common") { "frame_generator_capturer.h", "frame_utils.cc", "frame_utils.h", + "test_video_capturer.cc", + "test_video_capturer.h", "vcm_capturer.cc", "vcm_capturer.h", - "video_capturer.cc", - "video_capturer.h", "video_codec_settings.h", ] diff --git a/test/call_test.h b/test/call_test.h index 54be39ac98..f6c7e7fbf7 100644 --- a/test/call_test.h +++ b/test/call_test.h @@ -190,7 +190,7 @@ class CallTest : public ::testing::Test { test::FrameGeneratorCapturer* frame_generator_capturer_; std::vector*> video_sources_; - std::vector> video_capturers_; + std::vector> video_capturers_; DegradationPreference degradation_preference_ = DegradationPreference::MAINTAIN_FRAMERATE; diff --git a/test/frame_generator_capturer.cc b/test/frame_generator_capturer.cc index 184fdd76ef..6a58a3fb0b 100644 --- a/test/frame_generator_capturer.cc +++ b/test/frame_generator_capturer.cc @@ -227,7 +227,7 @@ void FrameGeneratorCapturer::AddOrUpdateSink( // adaptation. rtc::VideoSinkWants resolution_wants = wants; resolution_wants.max_framerate_fps = std::numeric_limits::max(); - VideoCapturer::AddOrUpdateSink(sink, resolution_wants); + TestVideoCapturer::AddOrUpdateSink(sink, resolution_wants); // Ignore any requests for framerate higher than initially configured. if (wants.max_framerate_fps < target_fps_) { diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h index 63219900d8..ac32fa45b4 100644 --- a/test/frame_generator_capturer.h +++ b/test/frame_generator_capturer.h @@ -17,7 +17,7 @@ #include "rtc_base/criticalsection.h" #include "rtc_base/task_queue.h" #include "test/frame_generator.h" -#include "test/video_capturer.h" +#include "test/test_video_capturer.h" namespace webrtc { @@ -25,7 +25,7 @@ namespace test { class FrameGenerator; -class FrameGeneratorCapturer : public VideoCapturer { +class FrameGeneratorCapturer : public TestVideoCapturer { public: class SinkWantsObserver { public: diff --git a/test/video_capturer.cc b/test/test_video_capturer.cc similarity index 80% rename from test/video_capturer.cc rename to test/test_video_capturer.cc index 4faf4491cb..d13f6e0771 100644 --- a/test/video_capturer.cc +++ b/test/test_video_capturer.cc @@ -8,16 +8,18 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/video_capturer.h" +#include "test/test_video_capturer.h" #include "rtc_base/constructormagic.h" namespace webrtc { namespace test { -VideoCapturer::VideoCapturer() : video_adapter_(new cricket::VideoAdapter()) {} -VideoCapturer::~VideoCapturer() {} +TestVideoCapturer::TestVideoCapturer() + : video_adapter_(new cricket::VideoAdapter()) {} +TestVideoCapturer::~TestVideoCapturer() {} -absl::optional VideoCapturer::AdaptFrame(const VideoFrame& frame) { +absl::optional TestVideoCapturer::AdaptFrame( + const VideoFrame& frame) { int cropped_width = 0; int cropped_height = 0; int out_width = 0; @@ -47,8 +49,9 @@ absl::optional VideoCapturer::AdaptFrame(const VideoFrame& frame) { return out_frame; } -void VideoCapturer::AddOrUpdateSink(rtc::VideoSinkInterface* sink, - const rtc::VideoSinkWants& wants) { +void TestVideoCapturer::AddOrUpdateSink( + rtc::VideoSinkInterface* sink, + const rtc::VideoSinkWants& wants) { video_adapter_->OnResolutionFramerateRequest( wants.target_pixel_count, wants.max_pixel_count, wants.max_framerate_fps); } diff --git a/test/video_capturer.h b/test/test_video_capturer.h similarity index 83% rename from test/video_capturer.h rename to test/test_video_capturer.h index d117b9682b..4611429ee3 100644 --- a/test/video_capturer.h +++ b/test/test_video_capturer.h @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_VIDEO_CAPTURER_H_ -#define TEST_VIDEO_CAPTURER_H_ +#ifndef TEST_TEST_VIDEO_CAPTURER_H_ +#define TEST_TEST_VIDEO_CAPTURER_H_ #include @@ -29,10 +29,10 @@ namespace webrtc { class Clock; namespace test { -class VideoCapturer : public rtc::VideoSourceInterface { +class TestVideoCapturer : public rtc::VideoSourceInterface { public: - VideoCapturer(); - virtual ~VideoCapturer(); + TestVideoCapturer(); + virtual ~TestVideoCapturer(); virtual void Start() = 0; virtual void Stop() = 0; @@ -50,4 +50,4 @@ class VideoCapturer : public rtc::VideoSourceInterface { } // namespace test } // namespace webrtc -#endif // TEST_VIDEO_CAPTURER_H_ +#endif // TEST_TEST_VIDEO_CAPTURER_H_ diff --git a/test/vcm_capturer.cc b/test/vcm_capturer.cc index 3e4e0f63c0..3cd1db1c80 100644 --- a/test/vcm_capturer.cc +++ b/test/vcm_capturer.cc @@ -83,7 +83,7 @@ void VcmCapturer::AddOrUpdateSink(rtc::VideoSinkInterface* sink, rtc::CritScope lock(&crit_); RTC_CHECK(!sink_ || sink_ == sink); sink_ = sink; - VideoCapturer::AddOrUpdateSink(sink, wants); + TestVideoCapturer::AddOrUpdateSink(sink, wants); } void VcmCapturer::RemoveSink(rtc::VideoSinkInterface* sink) { diff --git a/test/vcm_capturer.h b/test/vcm_capturer.h index 524cfe4038..59df4c71e2 100644 --- a/test/vcm_capturer.h +++ b/test/vcm_capturer.h @@ -17,12 +17,12 @@ #include "modules/video_capture/video_capture.h" #include "rtc_base/criticalsection.h" #include "rtc_base/scoped_ref_ptr.h" -#include "test/video_capturer.h" +#include "test/test_video_capturer.h" namespace webrtc { namespace test { -class VcmCapturer : public VideoCapturer, +class VcmCapturer : public TestVideoCapturer, public rtc::VideoSinkInterface { public: static VcmCapturer* Create(size_t width, diff --git a/video/replay.cc b/video/replay.cc index a84c3fe85c..15920d9d9a 100644 --- a/video/replay.cc +++ b/video/replay.cc @@ -33,8 +33,8 @@ #include "test/rtp_file_reader.h" #include "test/run_loop.h" #include "test/run_test.h" +#include "test/test_video_capturer.h" #include "test/testsupport/frame_writer.h" -#include "test/video_capturer.h" #include "test/video_renderer.h" namespace { diff --git a/video/video_analyzer.cc b/video/video_analyzer.cc index 04b5c766c8..bc5210ab9a 100644 --- a/video/video_analyzer.cc +++ b/video/video_analyzer.cc @@ -139,7 +139,7 @@ void VideoAnalyzer::SetReceiver(PacketReceiver* receiver) { receiver_ = receiver; } -void VideoAnalyzer::SetSource(test::VideoCapturer* video_capturer, +void VideoAnalyzer::SetSource(test::TestVideoCapturer* video_capturer, bool respect_sink_wants) { if (respect_sink_wants) captured_frame_forwarder_.SetSource(video_capturer); @@ -855,7 +855,7 @@ VideoAnalyzer::CapturedFrameForwarder::CapturedFrameForwarder( clock_(clock) {} void VideoAnalyzer::CapturedFrameForwarder::SetSource( - test::VideoCapturer* video_capturer) { + test::TestVideoCapturer* video_capturer) { video_capturer_ = video_capturer; } diff --git a/video/video_analyzer.h b/video/video_analyzer.h index b4d31dbaea..681d1f464f 100644 --- a/video/video_analyzer.h +++ b/video/video_analyzer.h @@ -46,7 +46,8 @@ class VideoAnalyzer : public PacketReceiver, ~VideoAnalyzer(); virtual void SetReceiver(PacketReceiver* receiver); - void SetSource(test::VideoCapturer* video_capturer, bool respect_sink_wants); + void SetSource(test::TestVideoCapturer* video_capturer, + bool respect_sink_wants); void SetCall(Call* call); void SetSendStream(VideoSendStream* stream); void SetReceiveStream(VideoReceiveStream* stream); @@ -151,7 +152,7 @@ class VideoAnalyzer : public PacketReceiver, public rtc::VideoSourceInterface { public: explicit CapturedFrameForwarder(VideoAnalyzer* analyzer, Clock* clock); - void SetSource(test::VideoCapturer* video_capturer); + void SetSource(test::TestVideoCapturer* video_capturer); private: void OnFrame(const VideoFrame& video_frame) override; @@ -167,7 +168,7 @@ class VideoAnalyzer : public PacketReceiver, rtc::CriticalSection crit_; rtc::VideoSinkInterface* send_stream_input_ RTC_GUARDED_BY(crit_); - test::VideoCapturer* video_capturer_; + test::TestVideoCapturer* video_capturer_; Clock* clock_; }; diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index 7da9fda403..c61d772408 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -635,7 +635,7 @@ void VideoQualityTest::DestroyThumbnailStreams() { } thumbnail_send_streams_.clear(); thumbnail_receive_streams_.clear(); - for (std::unique_ptr& video_caputurer : + for (std::unique_ptr& video_caputurer : thumbnail_capturers_) { video_caputurer.reset(); } @@ -766,12 +766,14 @@ void VideoQualityTest::StartAudioStreams() { } void VideoQualityTest::StartThumbnailCapture() { - for (std::unique_ptr& capturer : thumbnail_capturers_) + for (std::unique_ptr& capturer : + thumbnail_capturers_) capturer->Start(); } void VideoQualityTest::StopThumbnailCapture() { - for (std::unique_ptr& capturer : thumbnail_capturers_) + for (std::unique_ptr& capturer : + thumbnail_capturers_) capturer->Stop(); } diff --git a/video/video_quality_test.h b/video/video_quality_test.h index 5bef9483e2..b25d7e1345 100644 --- a/video/video_quality_test.h +++ b/video/video_quality_test.h @@ -89,7 +89,7 @@ class VideoQualityTest : virtual std::unique_ptr CreateSendTransport(); virtual std::unique_ptr CreateReceiveTransport(); - std::vector> thumbnail_capturers_; + std::vector> thumbnail_capturers_; Clock* const clock_; test::FunctionVideoEncoderFactory video_encoder_factory_;