Renames test::VideoCapturer to TestVideoCapturer.
Bug: webrtc:9620 Change-Id: Ia9afbc2d4f0448f9479516baa741d925a0aca5ac Reviewed-on: https://webrtc-review.googlesource.com/93760 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24346}
This commit is contained in:

committed by
Commit Bot

parent
4e199e9f08
commit
f1f363fae7
@ -44,10 +44,10 @@ rtc_source_set("video_test_common") {
|
|||||||
"frame_generator_capturer.h",
|
"frame_generator_capturer.h",
|
||||||
"frame_utils.cc",
|
"frame_utils.cc",
|
||||||
"frame_utils.h",
|
"frame_utils.h",
|
||||||
|
"test_video_capturer.cc",
|
||||||
|
"test_video_capturer.h",
|
||||||
"vcm_capturer.cc",
|
"vcm_capturer.cc",
|
||||||
"vcm_capturer.h",
|
"vcm_capturer.h",
|
||||||
"video_capturer.cc",
|
|
||||||
"video_capturer.h",
|
|
||||||
"video_codec_settings.h",
|
"video_codec_settings.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class CallTest : public ::testing::Test {
|
|||||||
|
|
||||||
test::FrameGeneratorCapturer* frame_generator_capturer_;
|
test::FrameGeneratorCapturer* frame_generator_capturer_;
|
||||||
std::vector<rtc::VideoSourceInterface<VideoFrame>*> video_sources_;
|
std::vector<rtc::VideoSourceInterface<VideoFrame>*> video_sources_;
|
||||||
std::vector<std::unique_ptr<VideoCapturer>> video_capturers_;
|
std::vector<std::unique_ptr<TestVideoCapturer>> video_capturers_;
|
||||||
DegradationPreference degradation_preference_ =
|
DegradationPreference degradation_preference_ =
|
||||||
DegradationPreference::MAINTAIN_FRAMERATE;
|
DegradationPreference::MAINTAIN_FRAMERATE;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ void FrameGeneratorCapturer::AddOrUpdateSink(
|
|||||||
// adaptation.
|
// adaptation.
|
||||||
rtc::VideoSinkWants resolution_wants = wants;
|
rtc::VideoSinkWants resolution_wants = wants;
|
||||||
resolution_wants.max_framerate_fps = std::numeric_limits<int>::max();
|
resolution_wants.max_framerate_fps = std::numeric_limits<int>::max();
|
||||||
VideoCapturer::AddOrUpdateSink(sink, resolution_wants);
|
TestVideoCapturer::AddOrUpdateSink(sink, resolution_wants);
|
||||||
|
|
||||||
// Ignore any requests for framerate higher than initially configured.
|
// Ignore any requests for framerate higher than initially configured.
|
||||||
if (wants.max_framerate_fps < target_fps_) {
|
if (wants.max_framerate_fps < target_fps_) {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "rtc_base/criticalsection.h"
|
#include "rtc_base/criticalsection.h"
|
||||||
#include "rtc_base/task_queue.h"
|
#include "rtc_base/task_queue.h"
|
||||||
#include "test/frame_generator.h"
|
#include "test/frame_generator.h"
|
||||||
#include "test/video_capturer.h"
|
#include "test/test_video_capturer.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ namespace test {
|
|||||||
|
|
||||||
class FrameGenerator;
|
class FrameGenerator;
|
||||||
|
|
||||||
class FrameGeneratorCapturer : public VideoCapturer {
|
class FrameGeneratorCapturer : public TestVideoCapturer {
|
||||||
public:
|
public:
|
||||||
class SinkWantsObserver {
|
class SinkWantsObserver {
|
||||||
public:
|
public:
|
||||||
|
@ -8,16 +8,18 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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"
|
#include "rtc_base/constructormagic.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
VideoCapturer::VideoCapturer() : video_adapter_(new cricket::VideoAdapter()) {}
|
TestVideoCapturer::TestVideoCapturer()
|
||||||
VideoCapturer::~VideoCapturer() {}
|
: video_adapter_(new cricket::VideoAdapter()) {}
|
||||||
|
TestVideoCapturer::~TestVideoCapturer() {}
|
||||||
|
|
||||||
absl::optional<VideoFrame> VideoCapturer::AdaptFrame(const VideoFrame& frame) {
|
absl::optional<VideoFrame> TestVideoCapturer::AdaptFrame(
|
||||||
|
const VideoFrame& frame) {
|
||||||
int cropped_width = 0;
|
int cropped_width = 0;
|
||||||
int cropped_height = 0;
|
int cropped_height = 0;
|
||||||
int out_width = 0;
|
int out_width = 0;
|
||||||
@ -47,8 +49,9 @@ absl::optional<VideoFrame> VideoCapturer::AdaptFrame(const VideoFrame& frame) {
|
|||||||
return out_frame;
|
return out_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoCapturer::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
void TestVideoCapturer::AddOrUpdateSink(
|
||||||
const rtc::VideoSinkWants& wants) {
|
rtc::VideoSinkInterface<VideoFrame>* sink,
|
||||||
|
const rtc::VideoSinkWants& wants) {
|
||||||
video_adapter_->OnResolutionFramerateRequest(
|
video_adapter_->OnResolutionFramerateRequest(
|
||||||
wants.target_pixel_count, wants.max_pixel_count, wants.max_framerate_fps);
|
wants.target_pixel_count, wants.max_pixel_count, wants.max_framerate_fps);
|
||||||
}
|
}
|
@ -7,8 +7,8 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#ifndef TEST_VIDEO_CAPTURER_H_
|
#ifndef TEST_TEST_VIDEO_CAPTURER_H_
|
||||||
#define TEST_VIDEO_CAPTURER_H_
|
#define TEST_TEST_VIDEO_CAPTURER_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@ -29,10 +29,10 @@ namespace webrtc {
|
|||||||
class Clock;
|
class Clock;
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class VideoCapturer : public rtc::VideoSourceInterface<VideoFrame> {
|
class TestVideoCapturer : public rtc::VideoSourceInterface<VideoFrame> {
|
||||||
public:
|
public:
|
||||||
VideoCapturer();
|
TestVideoCapturer();
|
||||||
virtual ~VideoCapturer();
|
virtual ~TestVideoCapturer();
|
||||||
|
|
||||||
virtual void Start() = 0;
|
virtual void Start() = 0;
|
||||||
virtual void Stop() = 0;
|
virtual void Stop() = 0;
|
||||||
@ -50,4 +50,4 @@ class VideoCapturer : public rtc::VideoSourceInterface<VideoFrame> {
|
|||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // TEST_VIDEO_CAPTURER_H_
|
#endif // TEST_TEST_VIDEO_CAPTURER_H_
|
@ -83,7 +83,7 @@ void VcmCapturer::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
|||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
RTC_CHECK(!sink_ || sink_ == sink);
|
RTC_CHECK(!sink_ || sink_ == sink);
|
||||||
sink_ = sink;
|
sink_ = sink;
|
||||||
VideoCapturer::AddOrUpdateSink(sink, wants);
|
TestVideoCapturer::AddOrUpdateSink(sink, wants);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcmCapturer::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
void VcmCapturer::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
#include "modules/video_capture/video_capture.h"
|
#include "modules/video_capture/video_capture.h"
|
||||||
#include "rtc_base/criticalsection.h"
|
#include "rtc_base/criticalsection.h"
|
||||||
#include "rtc_base/scoped_ref_ptr.h"
|
#include "rtc_base/scoped_ref_ptr.h"
|
||||||
#include "test/video_capturer.h"
|
#include "test/test_video_capturer.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class VcmCapturer : public VideoCapturer,
|
class VcmCapturer : public TestVideoCapturer,
|
||||||
public rtc::VideoSinkInterface<VideoFrame> {
|
public rtc::VideoSinkInterface<VideoFrame> {
|
||||||
public:
|
public:
|
||||||
static VcmCapturer* Create(size_t width,
|
static VcmCapturer* Create(size_t width,
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
#include "test/rtp_file_reader.h"
|
#include "test/rtp_file_reader.h"
|
||||||
#include "test/run_loop.h"
|
#include "test/run_loop.h"
|
||||||
#include "test/run_test.h"
|
#include "test/run_test.h"
|
||||||
|
#include "test/test_video_capturer.h"
|
||||||
#include "test/testsupport/frame_writer.h"
|
#include "test/testsupport/frame_writer.h"
|
||||||
#include "test/video_capturer.h"
|
|
||||||
#include "test/video_renderer.h"
|
#include "test/video_renderer.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -139,7 +139,7 @@ void VideoAnalyzer::SetReceiver(PacketReceiver* receiver) {
|
|||||||
receiver_ = receiver;
|
receiver_ = receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoAnalyzer::SetSource(test::VideoCapturer* video_capturer,
|
void VideoAnalyzer::SetSource(test::TestVideoCapturer* video_capturer,
|
||||||
bool respect_sink_wants) {
|
bool respect_sink_wants) {
|
||||||
if (respect_sink_wants)
|
if (respect_sink_wants)
|
||||||
captured_frame_forwarder_.SetSource(video_capturer);
|
captured_frame_forwarder_.SetSource(video_capturer);
|
||||||
@ -855,7 +855,7 @@ VideoAnalyzer::CapturedFrameForwarder::CapturedFrameForwarder(
|
|||||||
clock_(clock) {}
|
clock_(clock) {}
|
||||||
|
|
||||||
void VideoAnalyzer::CapturedFrameForwarder::SetSource(
|
void VideoAnalyzer::CapturedFrameForwarder::SetSource(
|
||||||
test::VideoCapturer* video_capturer) {
|
test::TestVideoCapturer* video_capturer) {
|
||||||
video_capturer_ = video_capturer;
|
video_capturer_ = video_capturer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ class VideoAnalyzer : public PacketReceiver,
|
|||||||
~VideoAnalyzer();
|
~VideoAnalyzer();
|
||||||
|
|
||||||
virtual void SetReceiver(PacketReceiver* receiver);
|
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 SetCall(Call* call);
|
||||||
void SetSendStream(VideoSendStream* stream);
|
void SetSendStream(VideoSendStream* stream);
|
||||||
void SetReceiveStream(VideoReceiveStream* stream);
|
void SetReceiveStream(VideoReceiveStream* stream);
|
||||||
@ -151,7 +152,7 @@ class VideoAnalyzer : public PacketReceiver,
|
|||||||
public rtc::VideoSourceInterface<VideoFrame> {
|
public rtc::VideoSourceInterface<VideoFrame> {
|
||||||
public:
|
public:
|
||||||
explicit CapturedFrameForwarder(VideoAnalyzer* analyzer, Clock* clock);
|
explicit CapturedFrameForwarder(VideoAnalyzer* analyzer, Clock* clock);
|
||||||
void SetSource(test::VideoCapturer* video_capturer);
|
void SetSource(test::TestVideoCapturer* video_capturer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnFrame(const VideoFrame& video_frame) override;
|
void OnFrame(const VideoFrame& video_frame) override;
|
||||||
@ -167,7 +168,7 @@ class VideoAnalyzer : public PacketReceiver,
|
|||||||
rtc::CriticalSection crit_;
|
rtc::CriticalSection crit_;
|
||||||
rtc::VideoSinkInterface<VideoFrame>* send_stream_input_
|
rtc::VideoSinkInterface<VideoFrame>* send_stream_input_
|
||||||
RTC_GUARDED_BY(crit_);
|
RTC_GUARDED_BY(crit_);
|
||||||
test::VideoCapturer* video_capturer_;
|
test::TestVideoCapturer* video_capturer_;
|
||||||
Clock* clock_;
|
Clock* clock_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ void VideoQualityTest::DestroyThumbnailStreams() {
|
|||||||
}
|
}
|
||||||
thumbnail_send_streams_.clear();
|
thumbnail_send_streams_.clear();
|
||||||
thumbnail_receive_streams_.clear();
|
thumbnail_receive_streams_.clear();
|
||||||
for (std::unique_ptr<test::VideoCapturer>& video_caputurer :
|
for (std::unique_ptr<test::TestVideoCapturer>& video_caputurer :
|
||||||
thumbnail_capturers_) {
|
thumbnail_capturers_) {
|
||||||
video_caputurer.reset();
|
video_caputurer.reset();
|
||||||
}
|
}
|
||||||
@ -766,12 +766,14 @@ void VideoQualityTest::StartAudioStreams() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VideoQualityTest::StartThumbnailCapture() {
|
void VideoQualityTest::StartThumbnailCapture() {
|
||||||
for (std::unique_ptr<test::VideoCapturer>& capturer : thumbnail_capturers_)
|
for (std::unique_ptr<test::TestVideoCapturer>& capturer :
|
||||||
|
thumbnail_capturers_)
|
||||||
capturer->Start();
|
capturer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoQualityTest::StopThumbnailCapture() {
|
void VideoQualityTest::StopThumbnailCapture() {
|
||||||
for (std::unique_ptr<test::VideoCapturer>& capturer : thumbnail_capturers_)
|
for (std::unique_ptr<test::TestVideoCapturer>& capturer :
|
||||||
|
thumbnail_capturers_)
|
||||||
capturer->Stop();
|
capturer->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ class VideoQualityTest :
|
|||||||
virtual std::unique_ptr<test::LayerFilteringTransport> CreateSendTransport();
|
virtual std::unique_ptr<test::LayerFilteringTransport> CreateSendTransport();
|
||||||
virtual std::unique_ptr<test::DirectTransport> CreateReceiveTransport();
|
virtual std::unique_ptr<test::DirectTransport> CreateReceiveTransport();
|
||||||
|
|
||||||
std::vector<std::unique_ptr<test::VideoCapturer>> thumbnail_capturers_;
|
std::vector<std::unique_ptr<test::TestVideoCapturer>> thumbnail_capturers_;
|
||||||
Clock* const clock_;
|
Clock* const clock_;
|
||||||
|
|
||||||
test::FunctionVideoEncoderFactory video_encoder_factory_;
|
test::FunctionVideoEncoderFactory video_encoder_factory_;
|
||||||
|
Reference in New Issue
Block a user