Migrate WebRTC on FrameGeneratorInterface and remove FrameGenerator class

Bug: webrtc:10138
Change-Id: If85290581a72f81cf60181de7a7134cc9db7716e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161327
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30033}
This commit is contained in:
Artem Titov
2019-12-05 15:59:00 +01:00
committed by Commit Bot
parent af51be7869
commit 33f9d2b383
43 changed files with 793 additions and 692 deletions

View File

@ -12,6 +12,7 @@
#include <utility>
#include "api/test/create_frame_generator.h"
#include "api/video_codecs/video_encoder.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/video_coding/include/video_error_codes.h"
@ -73,9 +74,9 @@ void VideoCodecUnitTest::SetUp() {
ModifyCodecSettings(&codec_settings_);
input_frame_generator_ = test::FrameGenerator::CreateSquareGenerator(
input_frame_generator_ = test::CreateSquareFrameGenerator(
codec_settings_.width, codec_settings_.height,
test::FrameGenerator::OutputType::kI420, absl::optional<int>());
test::FrameGeneratorInterface::OutputType::kI420, absl::optional<int>());
encoder_ = CreateEncoder();
decoder_ = CreateDecoder();
@ -94,7 +95,7 @@ void VideoCodecUnitTest::SetUp() {
void VideoCodecUnitTest::ModifyCodecSettings(VideoCodec* codec_settings) {}
VideoFrame VideoCodecUnitTest::NextInputFrame() {
test::FrameGenerator::VideoFrameData frame_data =
test::FrameGeneratorInterface::VideoFrameData frame_data =
input_frame_generator_->NextFrame();
VideoFrame input_frame = VideoFrame::Builder()
.set_video_frame_buffer(frame_data.buffer)

View File

@ -14,6 +14,7 @@
#include <memory>
#include <vector>
#include "api/test/frame_generator_interface.h"
#include "api/video_codecs/video_decoder.h"
#include "api/video_codecs/video_encoder.h"
#include "modules/video_coding/include/video_codec_interface.h"
@ -22,7 +23,6 @@
#include "rtc_base/critical_section.h"
#include "rtc_base/event.h"
#include "rtc_base/thread_annotations.h"
#include "test/frame_generator.h"
#include "test/gtest.h"
namespace webrtc {
@ -101,7 +101,7 @@ class VideoCodecUnitTest : public ::testing::Test {
std::unique_ptr<VideoEncoder> encoder_;
std::unique_ptr<VideoDecoder> decoder_;
std::unique_ptr<test::FrameGenerator> input_frame_generator_;
std::unique_ptr<test::FrameGeneratorInterface> input_frame_generator_;
private:
FakeEncodeCompleteCallback encode_complete_callback_;

View File

@ -12,6 +12,8 @@
#include <memory>
#include "api/test/create_frame_generator.h"
#include "api/test/frame_generator_interface.h"
#include "api/test/mock_video_decoder.h"
#include "api/test/mock_video_encoder.h"
#include "api/video_codecs/video_encoder.h"
@ -487,9 +489,9 @@ TEST_F(TestVp8Impl, DontDropKeyframes) {
// Reset the frame generator with large number of squares, leading to lots of
// details and high probability of overshoot.
input_frame_generator_ = test::FrameGenerator::CreateSquareGenerator(
input_frame_generator_ = test::CreateSquareFrameGenerator(
codec_settings_.width, codec_settings_.height,
test::FrameGenerator::OutputType::kI420,
test::FrameGeneratorInterface::OutputType::kI420,
/* num_squares = */ absl::optional<int>(300));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,

View File

@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/test/create_frame_generator.h"
#include "api/test/frame_generator_interface.h"
#include "api/video/color_space.h"
#include "api/video/i420_buffer.h"
#include "api/video_codecs/video_encoder.h"
@ -1616,9 +1618,10 @@ class TestVp9ImplProfile2 : public TestVp9Impl {
return;
TestVp9Impl::SetUp();
input_frame_generator_ = test::FrameGenerator::CreateSquareGenerator(
input_frame_generator_ = test::CreateSquareFrameGenerator(
codec_settings_.width, codec_settings_.height,
test::FrameGenerator::OutputType::kI010, absl::optional<int>());
test::FrameGeneratorInterface::OutputType::kI010,
absl::optional<int>());
}
std::unique_ptr<VideoEncoder> CreateEncoder() override {