Revert "Partial frame capture API part 5"

This reverts commit 1f0a84a2ecea59f86adc1af70eed974a3c6d59ac.

Reason for revert: Partial Capture API is not needed, according to new info from the Chrome team.

Original change's description:
> Partial frame capture API part 5
> 
> Wire up partial video frames in video quality tests
> 
> Bug: webrtc:10152
> Change-Id: Ifa13bb308258c8d3930a6cfbcc97c95b132cecf3
> Reviewed-on: https://webrtc-review.googlesource.com/c/120410
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26549}

TBR=ilnik@webrtc.org,sprang@webrtc.org,stefan@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:10152
Change-Id: I32017b1a7109a3615598a976f4b0e61edf4e8757
Reviewed-on: https://webrtc-review.googlesource.com/c/122088
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26628}
This commit is contained in:
Ilya Nikolaevskiy 2019-02-11 10:41:50 +01:00 committed by Commit Bot
parent 02f4e32b08
commit 85fc32540e
6 changed files with 9 additions and 49 deletions

View File

@ -60,7 +60,6 @@ class VideoQualityTestFixtureInterface {
std::string clip_name; // "Generator" to generate frames instead. std::string clip_name; // "Generator" to generate frames instead.
size_t capture_device_index; size_t capture_device_index;
SdpVideoFormat::Parameters sdp_params; SdpVideoFormat::Parameters sdp_params;
bool partial_updates;
} video[2]; } video[2];
struct Audio { struct Audio {
bool enabled; bool enabled;

View File

@ -299,11 +299,6 @@ std::vector<std::string> Slides() {
WEBRTC_DEFINE_bool(help, false, "prints this message"); WEBRTC_DEFINE_bool(help, false, "prints this message");
WEBRTC_DEFINE_bool(partial_updates,
false,
"Pass only changed regions from the "
"capturer");
} // namespace flags } // namespace flags
void Loopback() { void Loopback() {
@ -340,8 +335,7 @@ void Loopback() {
false, // Automatic scaling disabled. false, // Automatic scaling disabled.
"", "",
0, // capture_device_index. 0, // capture_device_index.
SdpVideoFormat::Parameters(), SdpVideoFormat::Parameters()};
flags::FLAG_partial_updates};
params.screenshare[0] = {true, flags::GenerateSlides(), params.screenshare[0] = {true, flags::GenerateSlides(),
flags::SlideChangeInterval(), flags::SlideChangeInterval(),
flags::ScrollDuration(), flags::Slides()}; flags::ScrollDuration(), flags::Slides()};

View File

@ -62,15 +62,14 @@ VideoAnalyzer::VideoAnalyzer(test::LayerFilteringTransport* transport,
int selected_tl, int selected_tl,
bool is_quick_test_enabled, bool is_quick_test_enabled,
Clock* clock, Clock* clock,
std::string rtp_dump_name, std::string rtp_dump_name)
bool partial_updates)
: transport_(transport), : transport_(transport),
receiver_(nullptr), receiver_(nullptr),
call_(nullptr), call_(nullptr),
send_stream_(nullptr), send_stream_(nullptr),
receive_stream_(nullptr), receive_stream_(nullptr),
audio_receive_stream_(nullptr), audio_receive_stream_(nullptr),
captured_frame_forwarder_(this, clock, duration_frames, partial_updates), captured_frame_forwarder_(this, clock, duration_frames),
test_label_(test_label), test_label_(test_label),
graph_data_output_file_(graph_data_output_file), graph_data_output_file_(graph_data_output_file),
graph_title_(graph_title), graph_title_(graph_title),
@ -874,17 +873,13 @@ VideoAnalyzer::Sample::Sample(int dropped,
VideoAnalyzer::CapturedFrameForwarder::CapturedFrameForwarder( VideoAnalyzer::CapturedFrameForwarder::CapturedFrameForwarder(
VideoAnalyzer* analyzer, VideoAnalyzer* analyzer,
Clock* clock, Clock* clock,
int frames_to_process, int frames_to_process)
bool partial_updates)
: analyzer_(analyzer), : analyzer_(analyzer),
send_stream_input_(nullptr), send_stream_input_(nullptr),
video_source_(nullptr), video_source_(nullptr),
clock_(clock), clock_(clock),
captured_frames_(0), captured_frames_(0),
frames_to_process_(frames_to_process) { frames_to_process_(frames_to_process) {}
if (partial_updates)
frame_change_extractor_.reset(new FrameChangeExtractor);
}
void VideoAnalyzer::CapturedFrameForwarder::SetSource( void VideoAnalyzer::CapturedFrameForwarder::SetSource(
VideoSourceInterface<VideoFrame>* video_source) { VideoSourceInterface<VideoFrame>* video_source) {
@ -903,13 +898,8 @@ void VideoAnalyzer::CapturedFrameForwarder::OnFrame(
analyzer_->AddCapturedFrameForComparison(copy); analyzer_->AddCapturedFrameForComparison(copy);
rtc::CritScope lock(&crit_); rtc::CritScope lock(&crit_);
++captured_frames_; ++captured_frames_;
if (captured_frames_ > frames_to_process_) if (send_stream_input_ && captured_frames_ <= frames_to_process_)
return;
if (frame_change_extractor_) {
frame_change_extractor_->OnFrame(copy);
} else if (send_stream_input_) {
send_stream_input_->OnFrame(copy); send_stream_input_->OnFrame(copy);
}
} }
void VideoAnalyzer::CapturedFrameForwarder::AddOrUpdateSink( void VideoAnalyzer::CapturedFrameForwarder::AddOrUpdateSink(
@ -920,9 +910,6 @@ void VideoAnalyzer::CapturedFrameForwarder::AddOrUpdateSink(
RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink); RTC_DCHECK(!send_stream_input_ || send_stream_input_ == sink);
send_stream_input_ = sink; send_stream_input_ = sink;
} }
if (frame_change_extractor_) {
frame_change_extractor_->AddOrUpdateSink(sink, wants);
}
if (video_source_) { if (video_source_) {
video_source_->AddOrUpdateSink(this, wants); video_source_->AddOrUpdateSink(this, wants);
} }
@ -933,9 +920,6 @@ void VideoAnalyzer::CapturedFrameForwarder::RemoveSink(
rtc::CritScope lock(&crit_); rtc::CritScope lock(&crit_);
RTC_DCHECK(sink == send_stream_input_); RTC_DCHECK(sink == send_stream_input_);
send_stream_input_ = nullptr; send_stream_input_ = nullptr;
if (frame_change_extractor_) {
frame_change_extractor_->RemoveSink(sink);
}
} }
} // namespace webrtc } // namespace webrtc

View File

@ -18,7 +18,6 @@
#include "api/video/video_source_interface.h" #include "api/video/video_source_interface.h"
#include "rtc_base/time_utils.h" #include "rtc_base/time_utils.h"
#include "test/frame_change_extractor.h"
#include "test/layer_filtering_transport.h" #include "test/layer_filtering_transport.h"
#include "test/rtp_file_writer.h" #include "test/rtp_file_writer.h"
#include "test/statistics.h" #include "test/statistics.h"
@ -43,8 +42,7 @@ class VideoAnalyzer : public PacketReceiver,
int selected_tl, int selected_tl,
bool is_quick_test_enabled, bool is_quick_test_enabled,
Clock* clock, Clock* clock,
std::string rtp_dump_name, std::string rtp_dump_name);
bool partial_updates);
~VideoAnalyzer(); ~VideoAnalyzer();
virtual void SetReceiver(PacketReceiver* receiver); virtual void SetReceiver(PacketReceiver* receiver);
@ -140,8 +138,7 @@ class VideoAnalyzer : public PacketReceiver,
public: public:
CapturedFrameForwarder(VideoAnalyzer* analyzer, CapturedFrameForwarder(VideoAnalyzer* analyzer,
Clock* clock, Clock* clock,
int frames_to_process, int frames_to_process);
bool partial_updates);
void SetSource(rtc::VideoSourceInterface<VideoFrame>* video_source); void SetSource(rtc::VideoSourceInterface<VideoFrame>* video_source);
private: private:
@ -162,7 +159,6 @@ class VideoAnalyzer : public PacketReceiver,
Clock* clock_; Clock* clock_;
int captured_frames_ RTC_GUARDED_BY(crit_); int captured_frames_ RTC_GUARDED_BY(crit_);
int frames_to_process_ RTC_GUARDED_BY(crit_); int frames_to_process_ RTC_GUARDED_BY(crit_);
std::unique_ptr<FrameChangeExtractor> frame_change_extractor_;
}; };
struct FrameWithPsnr { struct FrameWithPsnr {

View File

@ -1091,8 +1091,7 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
kSendRtxSsrcs[params_.ss[0].selected_stream], kSendRtxSsrcs[params_.ss[0].selected_stream],
static_cast<size_t>(params_.ss[0].selected_stream), static_cast<size_t>(params_.ss[0].selected_stream),
params.ss[0].selected_sl, params_.video[0].selected_tl, params.ss[0].selected_sl, params_.video[0].selected_tl,
is_quick_test_enabled, clock_, params_.logging.rtp_dump_name, is_quick_test_enabled, clock_, params_.logging.rtp_dump_name);
params_.video[0].partial_updates);
task_queue_.SendTask([&]() { task_queue_.SendTask([&]() {
analyzer_->SetCall(sender_call_.get()); analyzer_->SetCall(sender_call_.get());
@ -1358,15 +1357,6 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
rtc::VideoSinkWants()); rtc::VideoSinkWants());
} }
ConnectVideoSourcesToStreams(); ConnectVideoSourcesToStreams();
if (params_.video[0].partial_updates) {
frame_change_extractor_.reset(new FrameChangeExtractor());
frame_change_extractor_->SetSource(video_sources_[0].get());
video_send_streams_[0]->SetSource(frame_change_extractor_.get(),
degradation_preference_);
} else {
video_send_streams_[0]->SetSource(video_sources_[0].get(),
degradation_preference_);
}
} }
if (params_.audio.enabled) { if (params_.audio.enabled) {

View File

@ -22,7 +22,6 @@
#include "media/engine/internal_decoder_factory.h" #include "media/engine/internal_decoder_factory.h"
#include "media/engine/internal_encoder_factory.h" #include "media/engine/internal_encoder_factory.h"
#include "test/call_test.h" #include "test/call_test.h"
#include "test/frame_change_extractor.h"
#include "test/frame_generator.h" #include "test/frame_generator.h"
#include "test/layer_filtering_transport.h" #include "test/layer_filtering_transport.h"
#include "video/video_analyzer.h" #include "video/video_analyzer.h"
@ -115,8 +114,6 @@ class VideoQualityTest :
std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_; std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_;
std::vector<VideoReceiveStream*> thumbnail_receive_streams_; std::vector<VideoReceiveStream*> thumbnail_receive_streams_;
std::unique_ptr<FrameChangeExtractor> frame_change_extractor_;
int receive_logs_; int receive_logs_;
int send_logs_; int send_logs_;