Revert "Add a high bitrate full stack test with fake codec"

This reverts commit 15df2774f4e85cf8900768c1793edcf17d651dcd.

Reason for revert: It's causing the Android perf bots to fail. E.g.: https://ci.chromium.org/buildbot/client.webrtc.perf/Android32%20Tests%20%28L%20Nexus4%29/6666

Original change's description:
> Add a high bitrate full stack test with fake codec
> 
> This CL adds a fake codec factory  in WebRTC that can be used in tests to
> produce target bitrate output.
> 
> We also add a high bitrate test that makes use of fake codec. This test assumes
> ideal network conditions with target bandwidth being available and exercises
> WebRTC calls with a high target bitrate(100 Mbps) end-to-end.
> 
> Bug: chromium:879723
> Change-Id: I981124e2087054ed72c5447e239f28aae0878e29
> Reviewed-on: https://webrtc-review.googlesource.com/c/97185
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26182}

TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,emircan@webrtc.org,kron@webrtc.org

Change-Id: I33cd01ce345d81d66543f9be99750fa100760b5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:879723
Reviewed-on: https://webrtc-review.googlesource.com/c/116785
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26192}
This commit is contained in:
Oskar Sundbom
2019-01-10 11:48:52 +00:00
committed by Commit Bot
parent 6613f8e98a
commit 8984cd61ca
9 changed files with 6 additions and 183 deletions

View File

@ -234,8 +234,6 @@ rtc_static_library("rtc_internal_video_codecs") {
sources = [
"engine/convert_legacy_video_factory.cc",
"engine/convert_legacy_video_factory.h",
"engine/fake_video_codec_factory.cc",
"engine/fake_video_codec_factory.h",
"engine/internaldecoderfactory.cc",
"engine/internaldecoderfactory.h",
"engine/internalencoderfactory.cc",
@ -271,7 +269,6 @@ rtc_static_library("rtc_internal_video_codecs") {
"../api/video_codecs:video_codecs_api",
"../call:call_interfaces",
"../call:video_stream_api",
"../modules:module_api",
"../modules/video_coding:webrtc_h264",
"../modules/video_coding:webrtc_multiplex",
"../modules/video_coding:webrtc_vp8",
@ -280,7 +277,6 @@ rtc_static_library("rtc_internal_video_codecs") {
"../rtc_base:deprecation",
"../rtc_base:rtc_base_approved",
"../rtc_base/system:rtc_export",
"../test:fake_video_codecs",
"//third_party/abseil-cpp/absl/strings",
]
}

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "media/engine/fake_video_codec_factory.h"
#include "absl/memory/memory.h"
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_decoder.h"
#include "api/video_codecs/video_encoder.h"
#include "modules/include/module_common_types.h"
#include "modules/video_coding/include/video_codec_interface.h"
#include "modules/video_coding/include/video_error_codes.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "test/fake_decoder.h"
#include "test/fake_encoder.h"
namespace {
static const char kFakeCodecFactoryCodecName[] = "FakeCodec";
} // anonymous namespace
namespace webrtc {
FakeVideoEncoderFactory::FakeVideoEncoderFactory() = default;
// static
std::unique_ptr<VideoEncoder> FakeVideoEncoderFactory::CreateVideoEncoder() {
return absl::make_unique<test::FakeEncoder>(Clock::GetRealTimeClock(),
10000000);
}
std::vector<SdpVideoFormat> FakeVideoEncoderFactory::GetSupportedFormats()
const {
return std::vector<SdpVideoFormat>(
1, SdpVideoFormat(kFakeCodecFactoryCodecName));
}
VideoEncoderFactory::CodecInfo FakeVideoEncoderFactory::QueryVideoEncoder(
const SdpVideoFormat& format) const {
return VideoEncoderFactory::CodecInfo{false, false};
}
std::unique_ptr<VideoEncoder> FakeVideoEncoderFactory::CreateVideoEncoder(
const SdpVideoFormat& format) {
return absl::make_unique<test::FakeEncoder>(Clock::GetRealTimeClock(),
10000000);
}
FakeVideoDecoderFactory::FakeVideoDecoderFactory() = default;
// static
std::unique_ptr<VideoDecoder> FakeVideoDecoderFactory::CreateVideoDecoder() {
return absl::make_unique<test::FakeDecoder>();
}
std::vector<SdpVideoFormat> FakeVideoDecoderFactory::GetSupportedFormats()
const {
return std::vector<SdpVideoFormat>(
1, SdpVideoFormat(kFakeCodecFactoryCodecName));
}
std::unique_ptr<VideoDecoder> FakeVideoDecoderFactory::CreateVideoDecoder(
const SdpVideoFormat& format) {
return absl::make_unique<test::FakeDecoder>();
}
} // namespace webrtc

View File

@ -1,54 +0,0 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
#define MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_
#include <memory>
#include <vector>
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h"
namespace webrtc {
// Provides a fake video encoder instance that produces frames large enough for
// the given bitrate constraints.
class FakeVideoEncoderFactory : public VideoEncoderFactory {
public:
FakeVideoEncoderFactory();
static std::unique_ptr<VideoEncoder> CreateVideoEncoder();
// VideoEncoderFactory implementation
std::vector<SdpVideoFormat> GetSupportedFormats() const override;
VideoEncoderFactory::CodecInfo QueryVideoEncoder(
const SdpVideoFormat& format) const override;
std::unique_ptr<VideoEncoder> CreateVideoEncoder(
const SdpVideoFormat& format) override;
};
// Provides a fake video decoder instance that ignores the given bitstream and
// produces frames.
class FakeVideoDecoderFactory : public VideoDecoderFactory {
public:
FakeVideoDecoderFactory();
static std::unique_ptr<VideoDecoder> CreateVideoDecoder();
// VideoDecoderFactory implementation
std::vector<SdpVideoFormat> GetSupportedFormats() const override;
std::unique_ptr<VideoDecoder> CreateVideoDecoder(
const SdpVideoFormat& format) override;
};
} // namespace webrtc
#endif // MEDIA_ENGINE_FAKE_VIDEO_CODEC_FACTORY_H_

View File

@ -589,7 +589,7 @@ rtc_source_set("single_threaded_task_queue") {
}
rtc_source_set("fake_video_codecs") {
allow_poison = [ "software_video_codecs" ]
testonly = true
visibility = [ "*" ]
sources = [
"configurable_frame_size_encoder.cc",

View File

@ -47,9 +47,7 @@ void WriteCounter(unsigned char* payload, uint32_t counter) {
}; // namespace
FakeEncoder::FakeEncoder(Clock* clock) : FakeEncoder(clock, 100000) {}
FakeEncoder::FakeEncoder(Clock* clock, size_t buffer_size)
FakeEncoder::FakeEncoder(Clock* clock)
: clock_(clock),
callback_(nullptr),
configured_input_framerate_(-1),
@ -58,8 +56,7 @@ FakeEncoder::FakeEncoder(Clock* clock, size_t buffer_size)
counter_(0),
debt_bytes_(0) {
// Generate some arbitrary not-all-zero data
encoded_buffer_.resize(buffer_size);
for (size_t i = 0; i < encoded_buffer_.size(); ++i) {
for (size_t i = 0; i < sizeof(encoded_buffer_); ++i) {
encoded_buffer_[i] = static_cast<uint8_t>(i);
}
for (bool& used : used_layers_) {
@ -133,12 +130,12 @@ int32_t FakeEncoder::Encode(const VideoFrame& input_image,
specifics.codecType = kVideoCodecGeneric;
std::unique_ptr<uint8_t[]> encoded_buffer(
new uint8_t[frame_info.layers[i].size]);
memcpy(encoded_buffer.get(), encoded_buffer_.data(),
memcpy(encoded_buffer.get(), encoded_buffer_,
frame_info.layers[i].size - 4);
// Write a counter to the image to make each frame unique.
WriteCounter(encoded_buffer.get() + frame_info.layers[i].size - 4, counter);
EncodedImage encoded(encoded_buffer.get(), frame_info.layers[i].size,
encoded_buffer_.size());
sizeof(encoded_buffer_));
encoded.SetTimestamp(input_image.timestamp());
encoded.capture_time_ms_ = input_image.render_time_ms();
encoded._frameType =

View File

@ -36,7 +36,6 @@ namespace test {
class FakeEncoder : public VideoEncoder {
public:
explicit FakeEncoder(Clock* clock);
FakeEncoder(Clock* clock, size_t buffer_size);
virtual ~FakeEncoder() = default;
// Sets max bitrate. Not thread-safe, call before registering the encoder.
@ -92,7 +91,7 @@ class FakeEncoder : public VideoEncoder {
uint32_t counter_ RTC_GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_;
std::vector<uint8_t> encoded_buffer_;
uint8_t encoded_buffer_[100000];
bool used_layers_[kMaxSimulcastStreams];
// Current byte debt to be payed over a number of frames.

View File

@ -264,7 +264,6 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils",
"../system_wrappers",
"../test:fake_video_codecs",
"../test:fileutils",
"../test:perf_test",
"../test:rtp_test_utils",

View File

@ -1094,37 +1094,6 @@ TEST(FullStackTest, SimulcastVP8_3SL_Low) {
fixture->RunWithAnalyzer(simulcast);
}
// This test assumes ideal network conditions with target bandwidth being
// available and exercises WebRTC calls with a high target bitrate(100 Mbps).
TEST(FullStackTest, HighBitrateWithFakeCodec) {
auto fixture = CreateVideoQualityTestFixture();
const int target_bitrate = 100000000;
ParamsWithLogging generator;
generator.call.send_side_bwe = true;
generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate;
generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate;
generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate;
generator.video[0] = {true,
360,
240,
30,
target_bitrate / 2,
target_bitrate,
target_bitrate * 2,
false,
"FakeCodec",
1,
0,
0,
false,
false,
false,
"Generator"};
generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0,
kFullStackTestDurationSecs};
fixture->RunWithAnalyzer(generator);
}
TEST(FullStackTest, LargeRoomVP8_5thumb) {
auto fixture = CreateVideoQualityTestFixture();
ParamsWithLogging large_room;

View File

@ -23,7 +23,6 @@
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
#include "media/engine/adm_helpers.h"
#include "media/engine/encoder_simulcast_proxy.h"
#include "media/engine/fake_video_codec_factory.h"
#include "media/engine/internalencoderfactory.h"
#include "media/engine/webrtcvideoengine.h"
#include "modules/audio_device/include/audio_device.h"
@ -171,8 +170,6 @@ std::unique_ptr<VideoDecoder> VideoQualityTest::CreateVideoDecoder(
if (format.name == "multiplex") {
decoder = absl::make_unique<MultiplexDecoderAdapter>(
&internal_decoder_factory_, SdpVideoFormat(cricket::kVp9CodecName));
} else if (format.name == "FakeCodec") {
decoder = webrtc::FakeVideoDecoderFactory::CreateVideoDecoder();
} else {
decoder = internal_decoder_factory_.CreateVideoDecoder(format);
}
@ -197,8 +194,6 @@ std::unique_ptr<VideoEncoder> VideoQualityTest::CreateVideoEncoder(
} else if (format.name == "multiplex") {
encoder = absl::make_unique<MultiplexEncoderAdapter>(
&internal_encoder_factory_, SdpVideoFormat(cricket::kVp9CodecName));
} else if (format.name == "FakeCodec") {
encoder = webrtc::FakeVideoEncoderFactory::CreateVideoEncoder();
} else {
encoder = internal_encoder_factory_.CreateVideoEncoder(format);
}
@ -561,8 +556,6 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
payload_type = kPayloadTypeVP9;
} else if (params_.video[video_idx].codec == "multiplex") {
payload_type = kPayloadTypeVP9;
} else if (params_.video[video_idx].codec == "FakeCodec") {
payload_type = kFakeVideoSendPayloadType;
} else {
RTC_NOTREACHED() << "Codec not supported!";
return;