Revert "Use the factory instead of using the builtin code path in VideoCodecInitializer."

This reverts commit be142178aaf6ab4089b4d81c88c3d59c12cca567.

Reason for revert: breaking internal projects

Original change's description:
> Use the factory instead of using the builtin code path in `VideoCodecInitializer`.
> 
> Bug: webrtc:9513
> Change-Id: Ia299ae1044a3ff4c91e208200938cba540bdcea6
> Reviewed-on: https://webrtc-review.googlesource.com/c/94782
> Commit-Queue: Jiawei Ou <ouj@fb.com>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25456}

TBR=brandtr@webrtc.org,magjed@webrtc.org,sakal@webrtc.org,nisse@webrtc.org,andersc@webrtc.org,tommi@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,srte@webrtc.org,perkj@webrtc.org,tkchin@webrtc.org,shampson@webrtc.org,glaznev@webrtc.org,ouj@fb.com,qingsi@webrtc.org

Change-Id: I8040ccabe3ae6464d72c7696adb663c1dd275b63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9513
Reviewed-on: https://webrtc-review.googlesource.com/c/108980
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25459}
This commit is contained in:
Qingsi Wang 2018-11-01 04:45:53 +00:00 committed by Commit Bot
parent 7852d291c9
commit 59844ce57e
57 changed files with 137 additions and 389 deletions

View File

@ -544,18 +544,6 @@ if (rtc_include_tests) {
] ]
} }
rtc_source_set("mock_video_bitrate_allocator_factory") {
testonly = true
sources = [
"test/mock_video_bitrate_allocator_factory.h",
]
deps = [
"../api/video:video_bitrate_allocator_factory",
"../test:test_support",
]
}
rtc_source_set("mock_video_codec_factory") { rtc_source_set("mock_video_codec_factory") {
testonly = true testonly = true
sources = [ sources = [

View File

@ -1,37 +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 API_TEST_MOCK_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_
#define API_TEST_MOCK_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_
#include <memory>
#include "api/video/video_bitrate_allocator_factory.h"
#include "test/gmock.h"
namespace webrtc {
class MockVideoBitrateAllocatorFactory
: public webrtc::VideoBitrateAllocatorFactory {
public:
virtual std::unique_ptr<VideoBitrateAllocator> CreateVideoBitrateAllocator(
const VideoCodec& codec) {
return std::unique_ptr<VideoBitrateAllocator>(
CreateVideoBitrateAllocatorProxy(codec));
}
~MockVideoBitrateAllocatorFactory() { Die(); }
MOCK_METHOD1(CreateVideoBitrateAllocatorProxy,
VideoBitrateAllocator*(const VideoCodec&));
MOCK_METHOD0(Die, void());
};
} // namespace webrtc
#endif // API_TEST_MOCK_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_

View File

@ -174,7 +174,6 @@ rtc_source_set("video_stream_encoder") {
] ]
deps = [ deps = [
":video_bitrate_allocator_factory",
":video_frame", ":video_frame",
# For rtpparameters.h # For rtpparameters.h
@ -205,22 +204,3 @@ rtc_source_set("video_stream_encoder_create") {
"//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/memory",
] ]
} }
rtc_static_library("builtin_video_bitrate_allocator_factory") {
visibility = [ "*" ]
sources = [
"builtin_video_bitrate_allocator_factory.cc",
"builtin_video_bitrate_allocator_factory.h",
]
deps = [
":video_bitrate_allocation",
":video_bitrate_allocator_factory",
"../../media:rtc_media_base",
"../../modules/video_coding:video_coding_utility",
"../../modules/video_coding:webrtc_vp9_helpers",
"../../rtc_base:ptr_util",
"../../rtc_base/system:fallthrough",
"//third_party/abseil-cpp/absl/memory",
]
}

View File

@ -11,7 +11,6 @@
#ifndef API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_ #ifndef API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
#define API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_ #define API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
namespace webrtc { namespace webrtc {
@ -25,9 +24,6 @@ struct VideoStreamEncoderSettings {
// Ownership stays with WebrtcVideoEngine (delegated from PeerConnection). // Ownership stays with WebrtcVideoEngine (delegated from PeerConnection).
VideoEncoderFactory* encoder_factory = nullptr; VideoEncoderFactory* encoder_factory = nullptr;
// Ownership stays with WebrtcVideoEngine (delegated from PeerConnection).
VideoBitrateAllocatorFactory* bitrate_allocator_factory = nullptr;
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -386,7 +386,6 @@ if (rtc_include_tests) {
"..:webrtc_common", "..:webrtc_common",
"../api:simulated_network_api", "../api:simulated_network_api",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_bitrate_allocation", "../api/video:video_bitrate_allocation",
"../api/video_codecs:video_codecs_api", "../api/video_codecs:video_codecs_api",
"../logging:rtc_event_log_api", "../logging:rtc_event_log_api",

View File

@ -126,8 +126,6 @@ class BitrateEstimatorTest : public test::CallTest {
video_send_config.rtp.ssrcs.push_back(kVideoSendSsrcs[0]); video_send_config.rtp.ssrcs.push_back(kVideoSendSsrcs[0]);
video_send_config.encoder_settings.encoder_factory = video_send_config.encoder_settings.encoder_factory =
&fake_encoder_factory_; &fake_encoder_factory_;
video_send_config.encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
video_send_config.rtp.payload_name = "FAKE"; video_send_config.rtp.payload_name = "FAKE";
video_send_config.rtp.payload_type = kFakeVideoSendPayloadType; video_send_config.rtp.payload_type = kFakeVideoSendPayloadType;
SetVideoSendConfig(video_send_config); SetVideoSendConfig(video_send_config);

View File

@ -16,7 +16,6 @@
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/test/simulated_network.h" #include "api/test/simulated_network.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/video_bitrate_allocation.h" #include "api/video/video_bitrate_allocation.h"
#include "api/video_codecs/video_encoder_config.h" #include "api/video_codecs/video_encoder_config.h"
#include "call/call.h" #include "call/call.h"
@ -731,9 +730,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
last_set_bitrate_kbps_(0), last_set_bitrate_kbps_(0),
send_stream_(nullptr), send_stream_(nullptr),
frame_generator_(nullptr), frame_generator_(nullptr),
encoder_factory_(this), encoder_factory_(this) {}
bitrate_allocator_factory_(
CreateBuiltinVideoBitrateAllocatorFactory()) {}
int32_t InitEncode(const VideoCodec* config, int32_t InitEncode(const VideoCodec* config,
int32_t number_of_cores, int32_t number_of_cores,
@ -780,8 +777,6 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
std::vector<VideoReceiveStream::Config>* receive_configs, std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override { VideoEncoderConfig* encoder_config) override {
send_config->encoder_settings.encoder_factory = &encoder_factory_; send_config->encoder_settings.encoder_factory = &encoder_factory_;
send_config->encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
encoder_config->max_bitrate_bps = 2 * kReconfigureThresholdKbps * 1000; encoder_config->max_bitrate_bps = 2 * kReconfigureThresholdKbps * 1000;
encoder_config->video_stream_factory = encoder_config->video_stream_factory =
new rtc::RefCountedObject<VideoStreamFactory>(); new rtc::RefCountedObject<VideoStreamFactory>();
@ -817,7 +812,6 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
VideoSendStream* send_stream_; VideoSendStream* send_stream_;
test::FrameGeneratorCapturer* frame_generator_; test::FrameGeneratorCapturer* frame_generator_;
test::VideoEncoderProxyFactory encoder_factory_; test::VideoEncoderProxyFactory encoder_factory_;
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
VideoEncoderConfig encoder_config_; VideoEncoderConfig encoder_config_;
} test; } test;

View File

@ -503,7 +503,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
"../api:libjingle_peerconnection_api", "../api:libjingle_peerconnection_api",
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../logging:rtc_event_log_impl_base", "../logging:rtc_event_log_impl_base",
"../media:rtc_audio_video", "../media:rtc_audio_video",
"../modules/audio_processing:audio_processing", "../modules/audio_processing:audio_processing",

View File

@ -49,7 +49,6 @@ if (is_android) {
"//api:libjingle_peerconnection_api", "//api:libjingle_peerconnection_api",
"//api/audio_codecs:builtin_audio_decoder_factory", "//api/audio_codecs:builtin_audio_decoder_factory",
"//api/audio_codecs:builtin_audio_encoder_factory", "//api/audio_codecs:builtin_audio_encoder_factory",
"//api/video:builtin_video_bitrate_allocator_factory",
"//logging:rtc_event_log_impl_base", "//logging:rtc_event_log_impl_base",
"//media:rtc_audio_video", "//media:rtc_audio_video",
"//media:rtc_internal_video_codecs", "//media:rtc_internal_video_codecs",

View File

@ -16,7 +16,6 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/peerconnectioninterface.h" #include "api/peerconnectioninterface.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "examples/androidnativeapi/generated_jni/jni/CallClient_jni.h" #include "examples/androidnativeapi/generated_jni/jni/CallClient_jni.h"
#include "media/engine/internaldecoderfactory.h" #include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h" #include "media/engine/internalencoderfactory.h"
@ -160,7 +159,6 @@ void AndroidCallClient::CreatePeerConnectionFactory() {
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(),
absl::make_unique<webrtc::InternalEncoderFactory>(), absl::make_unique<webrtc::InternalEncoderFactory>(),
absl::make_unique<webrtc::InternalDecoderFactory>(), absl::make_unique<webrtc::InternalDecoderFactory>(),
webrtc::CreateBuiltinVideoBitrateAllocatorFactory(),
nullptr /* audio_mixer */, webrtc::AudioProcessingBuilder().Create()); nullptr /* audio_mixer */, webrtc::AudioProcessingBuilder().Create());
RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get(); RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get();

View File

@ -21,7 +21,6 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/peerconnectioninterface.h" #include "api/peerconnectioninterface.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "media/engine/webrtcmediaengine.h" #include "media/engine/webrtcmediaengine.h"
#include "modules/audio_processing/include/audio_processing.h" #include "modules/audio_processing/include/audio_processing.h"
#include "sdk/objc/native/api/video_capturer.h" #include "sdk/objc/native/api/video_capturer.h"
@ -117,16 +116,12 @@ void ObjCCallClient::CreatePeerConnectionFactory() {
std::unique_ptr<webrtc::VideoEncoderFactory> videoEncoderFactory = std::unique_ptr<webrtc::VideoEncoderFactory> videoEncoderFactory =
webrtc::ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] init]); webrtc::ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] init]);
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> videoBitrateAllocatorFactory =
webrtc::CreateBuiltinVideoBitrateAllocatorFactory();
std::unique_ptr<cricket::MediaEngineInterface> media_engine = std::unique_ptr<cricket::MediaEngineInterface> media_engine =
cricket::WebRtcMediaEngineFactory::Create(nullptr /* adm */, cricket::WebRtcMediaEngineFactory::Create(nullptr /* adm */,
webrtc::CreateBuiltinAudioEncoderFactory(), webrtc::CreateBuiltinAudioEncoderFactory(),
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(),
std::move(videoEncoderFactory), std::move(videoEncoderFactory),
std::move(videoDecoderFactory), std::move(videoDecoderFactory),
std::move(videoBitrateAllocatorFactory),
nullptr /* audio_mixer */, nullptr /* audio_mixer */,
webrtc::AudioProcessingBuilder().Create()); webrtc::AudioProcessingBuilder().Create());
RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get(); RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get();

View File

@ -278,7 +278,6 @@ rtc_static_library("rtc_audio_video") {
defines = [] defines = []
libs = [] libs = []
deps = [ deps = [
"../api/video:video_bitrate_allocator_factory",
"../modules/audio_processing/aec_dump:aec_dump", "../modules/audio_processing/aec_dump:aec_dump",
"../modules/video_coding:video_codec_interface", "../modules/video_coding:video_codec_interface",
"../modules/video_coding:video_coding", "../modules/video_coding:video_coding",
@ -627,13 +626,10 @@ if (rtc_include_tests) {
":rtc_vp9_profile", ":rtc_vp9_profile",
"../api:create_simulcast_test_fixture_api", "../api:create_simulcast_test_fixture_api",
"../api:libjingle_peerconnection_api", "../api:libjingle_peerconnection_api",
"../api:mock_video_bitrate_allocator",
"../api:mock_video_bitrate_allocator_factory",
"../api:mock_video_codec_factory", "../api:mock_video_codec_factory",
"../api:simulcast_test_fixture_api", "../api:simulcast_test_fixture_api",
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_bitrate_allocation", "../api/video:video_bitrate_allocation",
"../api/video:video_frame", "../api/video:video_frame",
"../api/video_codecs:builtin_video_decoder_factory", "../api/video_codecs:builtin_video_decoder_factory",

View File

@ -123,7 +123,6 @@ FakeVideoSendStream::FakeVideoSendStream(
source_(nullptr), source_(nullptr),
num_swapped_frames_(0) { num_swapped_frames_(0) {
RTC_DCHECK(config.encoder_settings.encoder_factory != nullptr); RTC_DCHECK(config.encoder_settings.encoder_factory != nullptr);
RTC_DCHECK(config.encoder_settings.bitrate_allocator_factory != nullptr);
ReconfigureVideoEncoder(std::move(encoder_config)); ReconfigureVideoEncoder(std::move(encoder_config));
} }

View File

@ -15,7 +15,6 @@
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
#include "media/engine/webrtcvoiceengine.h" #include "media/engine/webrtcvoiceengine.h"
@ -39,19 +38,15 @@ MediaEngineInterface* CreateWebRtcMediaEngine(
audio_decoder_factory, audio_decoder_factory,
WebRtcVideoEncoderFactory* video_encoder_factory, WebRtcVideoEncoderFactory* video_encoder_factory,
WebRtcVideoDecoderFactory* video_decoder_factory, WebRtcVideoDecoderFactory* video_decoder_factory,
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) { rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) {
#ifdef HAVE_WEBRTC_VIDEO #ifdef HAVE_WEBRTC_VIDEO
typedef WebRtcVideoEngine VideoEngine; typedef WebRtcVideoEngine VideoEngine;
std::tuple<std::unique_ptr<WebRtcVideoEncoderFactory>, std::tuple<std::unique_ptr<WebRtcVideoEncoderFactory>,
std::unique_ptr<WebRtcVideoDecoderFactory>, std::unique_ptr<WebRtcVideoDecoderFactory>>
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>>
video_args( video_args(
(std::unique_ptr<WebRtcVideoEncoderFactory>(video_encoder_factory)), (std::unique_ptr<WebRtcVideoEncoderFactory>(video_encoder_factory)),
(std::unique_ptr<WebRtcVideoDecoderFactory>(video_decoder_factory)), (std::unique_ptr<WebRtcVideoDecoderFactory>(video_decoder_factory)));
(std::move(video_bitrate_allocator_factory)));
#else #else
typedef NullWebRtcVideoEngine VideoEngine; typedef NullWebRtcVideoEngine VideoEngine;
std::tuple<> video_args; std::tuple<> video_args;
@ -71,13 +66,11 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create(
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
audio_decoder_factory, audio_decoder_factory,
WebRtcVideoEncoderFactory* video_encoder_factory, WebRtcVideoEncoderFactory* video_encoder_factory,
WebRtcVideoDecoderFactory* video_decoder_factory, WebRtcVideoDecoderFactory* video_decoder_factory) {
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> return CreateWebRtcMediaEngine(adm, audio_encoder_factory,
video_bitrate_allocator_factory) { audio_decoder_factory, video_encoder_factory,
return CreateWebRtcMediaEngine( video_decoder_factory, nullptr,
adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory, webrtc::AudioProcessingBuilder().Create());
video_decoder_factory, std::move(video_bitrate_allocator_factory),
nullptr, webrtc::AudioProcessingBuilder().Create());
} }
MediaEngineInterface* WebRtcMediaEngineFactory::Create( MediaEngineInterface* WebRtcMediaEngineFactory::Create(
@ -88,14 +81,11 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create(
audio_decoder_factory, audio_decoder_factory,
WebRtcVideoEncoderFactory* video_encoder_factory, WebRtcVideoEncoderFactory* video_encoder_factory,
WebRtcVideoDecoderFactory* video_decoder_factory, WebRtcVideoDecoderFactory* video_decoder_factory,
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) { rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) {
return CreateWebRtcMediaEngine( return CreateWebRtcMediaEngine(
adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory, adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
video_decoder_factory, std::move(video_bitrate_allocator_factory), video_decoder_factory, audio_mixer, audio_processing);
audio_mixer, audio_processing);
} }
#endif #endif
@ -105,18 +95,14 @@ std::unique_ptr<MediaEngineInterface> WebRtcMediaEngineFactory::Create(
rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory, std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory, std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory,
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) { rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing) {
#ifdef HAVE_WEBRTC_VIDEO #ifdef HAVE_WEBRTC_VIDEO
typedef WebRtcVideoEngine VideoEngine; typedef WebRtcVideoEngine VideoEngine;
std::tuple<std::unique_ptr<webrtc::VideoEncoderFactory>, std::tuple<std::unique_ptr<webrtc::VideoEncoderFactory>,
std::unique_ptr<webrtc::VideoDecoderFactory>, std::unique_ptr<webrtc::VideoDecoderFactory>>
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>>
video_args(std::move(video_encoder_factory), video_args(std::move(video_encoder_factory),
std::move(video_decoder_factory), std::move(video_decoder_factory));
std::move(video_bitrate_allocator_factory));
#else #else
typedef NullWebRtcVideoEngine VideoEngine; typedef NullWebRtcVideoEngine VideoEngine;
std::tuple<> video_args; std::tuple<> video_args;

View File

@ -25,7 +25,6 @@ class AudioMixer;
class AudioProcessing; class AudioProcessing;
class VideoDecoderFactory; class VideoDecoderFactory;
class VideoEncoderFactory; class VideoEncoderFactory;
class VideoBitrateAllocatorFactory;
} // namespace webrtc } // namespace webrtc
namespace cricket { namespace cricket {
class WebRtcVideoDecoderFactory; class WebRtcVideoDecoderFactory;
@ -50,9 +49,7 @@ class WebRtcMediaEngineFactory {
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
audio_decoder_factory, audio_decoder_factory,
WebRtcVideoEncoderFactory* video_encoder_factory, WebRtcVideoEncoderFactory* video_encoder_factory,
WebRtcVideoDecoderFactory* video_decoder_factory, WebRtcVideoDecoderFactory* video_decoder_factory);
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory);
static MediaEngineInterface* Create( static MediaEngineInterface* Create(
webrtc::AudioDeviceModule* adm, webrtc::AudioDeviceModule* adm,
const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
@ -61,8 +58,6 @@ class WebRtcMediaEngineFactory {
audio_decoder_factory, audio_decoder_factory,
WebRtcVideoEncoderFactory* video_encoder_factory, WebRtcVideoEncoderFactory* video_encoder_factory,
WebRtcVideoDecoderFactory* video_decoder_factory, WebRtcVideoDecoderFactory* video_decoder_factory,
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> apm); rtc::scoped_refptr<webrtc::AudioProcessing> apm);
#endif #endif
@ -76,8 +71,6 @@ class WebRtcMediaEngineFactory {
rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory, std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory, std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory,
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing); rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing);
}; };

View File

@ -12,7 +12,6 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h"
#include "media/engine/webrtcmediaengine.h" #include "media/engine/webrtcmediaengine.h"
@ -245,9 +244,8 @@ TEST(WebRtcMediaEngineFactoryTest, CreateWithBuiltinDecoders) {
nullptr /* adm */, webrtc::CreateBuiltinAudioEncoderFactory(), nullptr /* adm */, webrtc::CreateBuiltinAudioEncoderFactory(),
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(),
webrtc::CreateBuiltinVideoEncoderFactory(), webrtc::CreateBuiltinVideoEncoderFactory(),
webrtc::CreateBuiltinVideoDecoderFactory(), webrtc::CreateBuiltinVideoDecoderFactory(), nullptr /* audio_mixer */,
webrtc::CreateBuiltinVideoBitrateAllocatorFactory(), webrtc::AudioProcessingBuilder().Create()));
nullptr /* audio_mixer */, webrtc::AudioProcessingBuilder().Create()));
EXPECT_TRUE(engine); EXPECT_TRUE(engine);
} }

View File

@ -437,26 +437,20 @@ void DefaultUnsignalledSsrcHandler::SetDefaultSink(
#if defined(USE_BUILTIN_SW_CODECS) #if defined(USE_BUILTIN_SW_CODECS)
WebRtcVideoEngine::WebRtcVideoEngine( WebRtcVideoEngine::WebRtcVideoEngine(
std::unique_ptr<WebRtcVideoEncoderFactory> external_video_encoder_factory, std::unique_ptr<WebRtcVideoEncoderFactory> external_video_encoder_factory,
std::unique_ptr<WebRtcVideoDecoderFactory> external_video_decoder_factory, std::unique_ptr<WebRtcVideoDecoderFactory> external_video_decoder_factory)
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory)
: decoder_factory_(ConvertVideoDecoderFactory( : decoder_factory_(ConvertVideoDecoderFactory(
std::move(external_video_decoder_factory))), std::move(external_video_decoder_factory))),
encoder_factory_(ConvertVideoEncoderFactory( encoder_factory_(ConvertVideoEncoderFactory(
std::move(external_video_encoder_factory))), std::move(external_video_encoder_factory))) {
bitrate_allocator_factory_(std::move(video_bitrate_allocator_factory)) {
RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()"; RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
} }
#endif #endif
WebRtcVideoEngine::WebRtcVideoEngine( WebRtcVideoEngine::WebRtcVideoEngine(
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory, std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory, std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory)
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory)
: decoder_factory_(std::move(video_decoder_factory)), : decoder_factory_(std::move(video_decoder_factory)),
encoder_factory_(std::move(video_encoder_factory)), encoder_factory_(std::move(video_encoder_factory)) {
bitrate_allocator_factory_(std::move(video_bitrate_allocator_factory)) {
RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()"; RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
} }
@ -471,8 +465,7 @@ WebRtcVideoChannel* WebRtcVideoEngine::CreateChannel(
const webrtc::CryptoOptions& crypto_options) { const webrtc::CryptoOptions& crypto_options) {
RTC_LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); RTC_LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString();
return new WebRtcVideoChannel(call, config, options, crypto_options, return new WebRtcVideoChannel(call, config, options, crypto_options,
encoder_factory_.get(), decoder_factory_.get(), encoder_factory_.get(), decoder_factory_.get());
bitrate_allocator_factory_.get());
} }
std::vector<VideoCodec> WebRtcVideoEngine::codecs() const { std::vector<VideoCodec> WebRtcVideoEngine::codecs() const {
@ -523,15 +516,13 @@ WebRtcVideoChannel::WebRtcVideoChannel(
const VideoOptions& options, const VideoOptions& options,
const webrtc::CryptoOptions& crypto_options, const webrtc::CryptoOptions& crypto_options,
webrtc::VideoEncoderFactory* encoder_factory, webrtc::VideoEncoderFactory* encoder_factory,
webrtc::VideoDecoderFactory* decoder_factory, webrtc::VideoDecoderFactory* decoder_factory)
webrtc::VideoBitrateAllocatorFactory* bitrate_allocator_factory)
: VideoMediaChannel(config), : VideoMediaChannel(config),
call_(call), call_(call),
unsignalled_ssrc_handler_(&default_unsignalled_ssrc_handler_), unsignalled_ssrc_handler_(&default_unsignalled_ssrc_handler_),
video_config_(config.video), video_config_(config.video),
encoder_factory_(encoder_factory), encoder_factory_(encoder_factory),
decoder_factory_(decoder_factory), decoder_factory_(decoder_factory),
bitrate_allocator_factory_(bitrate_allocator_factory),
preferred_dscp_(rtc::DSCP_DEFAULT), preferred_dscp_(rtc::DSCP_DEFAULT),
default_send_options_(options), default_send_options_(options),
last_stats_log_ms_(-1), last_stats_log_ms_(-1),
@ -1078,8 +1069,6 @@ bool WebRtcVideoChannel::AddSendStream(const StreamParams& sp) {
config.encoder_settings.experiment_cpu_load_estimator = config.encoder_settings.experiment_cpu_load_estimator =
video_config_.experiment_cpu_load_estimator; video_config_.experiment_cpu_load_estimator;
config.encoder_settings.encoder_factory = encoder_factory_; config.encoder_settings.encoder_factory = encoder_factory_;
config.encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_;
config.crypto_options = crypto_options_; config.crypto_options = crypto_options_;
config.rtp.extmap_allow_mixed = ExtmapAllowMixed(); config.rtp.extmap_allow_mixed = ExtmapAllowMixed();

View File

@ -19,7 +19,6 @@
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/call/transport.h" #include "api/call/transport.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video/video_frame.h" #include "api/video/video_frame.h"
#include "api/video/video_sink_interface.h" #include "api/video/video_sink_interface.h"
#include "api/video/video_source_interface.h" #include "api/video/video_source_interface.h"
@ -85,18 +84,15 @@ class WebRtcVideoEngine {
// Internal SW video codecs will be added on top of the external codecs. // Internal SW video codecs will be added on top of the external codecs.
WebRtcVideoEngine( WebRtcVideoEngine(
std::unique_ptr<WebRtcVideoEncoderFactory> external_video_encoder_factory, std::unique_ptr<WebRtcVideoEncoderFactory> external_video_encoder_factory,
std::unique_ptr<WebRtcVideoDecoderFactory> external_video_decoder_factory, std::unique_ptr<WebRtcVideoDecoderFactory>
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> external_video_decoder_factory);
video_bitrate_allocator_factory);
#endif #endif
// These video codec factories represents all video codecs, i.e. both software // These video codec factories represents all video codecs, i.e. both software
// and external hardware codecs. // and external hardware codecs.
WebRtcVideoEngine( WebRtcVideoEngine(
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory, std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory, std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory);
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory);
virtual ~WebRtcVideoEngine(); virtual ~WebRtcVideoEngine();
@ -112,20 +108,16 @@ class WebRtcVideoEngine {
private: private:
const std::unique_ptr<webrtc::VideoDecoderFactory> decoder_factory_; const std::unique_ptr<webrtc::VideoDecoderFactory> decoder_factory_;
const std::unique_ptr<webrtc::VideoEncoderFactory> encoder_factory_; const std::unique_ptr<webrtc::VideoEncoderFactory> encoder_factory_;
const std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
bitrate_allocator_factory_;
}; };
class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport { class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
public: public:
WebRtcVideoChannel( WebRtcVideoChannel(webrtc::Call* call,
webrtc::Call* call,
const MediaConfig& config, const MediaConfig& config,
const VideoOptions& options, const VideoOptions& options,
const webrtc::CryptoOptions& crypto_options, const webrtc::CryptoOptions& crypto_options,
webrtc::VideoEncoderFactory* encoder_factory, webrtc::VideoEncoderFactory* encoder_factory,
webrtc::VideoDecoderFactory* decoder_factory, webrtc::VideoDecoderFactory* decoder_factory);
webrtc::VideoBitrateAllocatorFactory* bitrate_allocator_factory);
~WebRtcVideoChannel() override; ~WebRtcVideoChannel() override;
// VideoMediaChannel implementation // VideoMediaChannel implementation
@ -499,7 +491,6 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
webrtc::VideoEncoderFactory* const encoder_factory_; webrtc::VideoEncoderFactory* const encoder_factory_;
webrtc::VideoDecoderFactory* const decoder_factory_; webrtc::VideoDecoderFactory* const decoder_factory_;
webrtc::VideoBitrateAllocatorFactory* const bitrate_allocator_factory_;
std::vector<VideoCodecSettings> recv_codecs_; std::vector<VideoCodecSettings> recv_codecs_;
std::vector<webrtc::RtpExtension> recv_rtp_extensions_; std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
// See reason for keeping track of the FlexFEC payload type separately in // See reason for keeping track of the FlexFEC payload type separately in

View File

@ -16,12 +16,9 @@
#include "absl/strings/match.h" #include "absl/strings/match.h"
#include "api/rtpparameters.h" #include "api/rtpparameters.h"
#include "api/test/mock_video_bitrate_allocator.h"
#include "api/test/mock_video_bitrate_allocator_factory.h"
#include "api/test/mock_video_decoder_factory.h" #include "api/test/mock_video_decoder_factory.h"
#include "api/test/mock_video_encoder_factory.h" #include "api/test/mock_video_encoder_factory.h"
#include "api/units/time_delta.h" #include "api/units/time_delta.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/video_bitrate_allocation.h" #include "api/video/video_bitrate_allocation.h"
#include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h"
@ -217,8 +214,7 @@ class WebRtcVideoEngineTest : public ::testing::Test {
engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>( engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>(
encoder_factory_), encoder_factory_),
std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>( std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>(
decoder_factory_), decoder_factory_)) {
webrtc::CreateBuiltinVideoBitrateAllocatorFactory()) {
// Ensure fake clock doesn't return 0, which will cause some initializations // Ensure fake clock doesn't return 0, which will cause some initializations
// fail inside RTP senders. // fail inside RTP senders.
fake_clock_.AdvanceTimeMicros(1); fake_clock_.AdvanceTimeMicros(1);
@ -1013,10 +1009,8 @@ TEST_F(WebRtcVideoEngineTest, GetSourcesWithNonExistingSsrc) {
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullFactories) { TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullFactories) {
std::unique_ptr<webrtc::VideoEncoderFactory> encoder_factory; std::unique_ptr<webrtc::VideoEncoderFactory> encoder_factory;
std::unique_ptr<webrtc::VideoDecoderFactory> decoder_factory; std::unique_ptr<webrtc::VideoDecoderFactory> decoder_factory;
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> rate_allocator_factory;
WebRtcVideoEngine engine(std::move(encoder_factory), WebRtcVideoEngine engine(std::move(encoder_factory),
std::move(decoder_factory), std::move(decoder_factory));
std::move(rate_allocator_factory));
EXPECT_EQ(0u, engine.codecs().size()); EXPECT_EQ(0u, engine.codecs().size());
} }
@ -1026,18 +1020,13 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, EmptyFactories) {
new webrtc::MockVideoEncoderFactory(); new webrtc::MockVideoEncoderFactory();
webrtc::MockVideoDecoderFactory* decoder_factory = webrtc::MockVideoDecoderFactory* decoder_factory =
new webrtc::MockVideoDecoderFactory(); new webrtc::MockVideoDecoderFactory();
webrtc::MockVideoBitrateAllocatorFactory* rate_allocator_factory =
new webrtc::MockVideoBitrateAllocatorFactory();
WebRtcVideoEngine engine( WebRtcVideoEngine engine(
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)), (std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)), (std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
(std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>(
rate_allocator_factory)));
EXPECT_CALL(*encoder_factory, GetSupportedFormats()); EXPECT_CALL(*encoder_factory, GetSupportedFormats());
EXPECT_EQ(0u, engine.codecs().size()); EXPECT_EQ(0u, engine.codecs().size());
EXPECT_CALL(*encoder_factory, Die()); EXPECT_CALL(*encoder_factory, Die());
EXPECT_CALL(*decoder_factory, Die()); EXPECT_CALL(*decoder_factory, Die());
EXPECT_CALL(*rate_allocator_factory, Die());
} }
// Test full behavior in the video engine when video codec factories of the new // Test full behavior in the video engine when video codec factories of the new
@ -1050,17 +1039,9 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
new webrtc::MockVideoEncoderFactory(); new webrtc::MockVideoEncoderFactory();
webrtc::MockVideoDecoderFactory* decoder_factory = webrtc::MockVideoDecoderFactory* decoder_factory =
new webrtc::MockVideoDecoderFactory(); new webrtc::MockVideoDecoderFactory();
webrtc::MockVideoBitrateAllocatorFactory* rate_allocator_factory =
new webrtc::MockVideoBitrateAllocatorFactory();
EXPECT_CALL(*rate_allocator_factory,
CreateVideoBitrateAllocatorProxy(Field(
&webrtc::VideoCodec::codecType, webrtc::kVideoCodecVP8)))
.WillOnce(testing::Return(new webrtc::MockVideoBitrateAllocator()));
WebRtcVideoEngine engine( WebRtcVideoEngine engine(
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)), (std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)), (std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
(std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>(
rate_allocator_factory)));
const webrtc::SdpVideoFormat vp8_format("VP8"); const webrtc::SdpVideoFormat vp8_format("VP8");
const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format}; const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format};
EXPECT_CALL(*encoder_factory, GetSupportedFormats()) EXPECT_CALL(*encoder_factory, GetSupportedFormats())
@ -1156,7 +1137,6 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
// Remove streams previously added to free the encoder and decoder instance. // Remove streams previously added to free the encoder and decoder instance.
EXPECT_CALL(*encoder_factory, Die()); EXPECT_CALL(*encoder_factory, Die());
EXPECT_CALL(*decoder_factory, Die()); EXPECT_CALL(*decoder_factory, Die());
EXPECT_CALL(*rate_allocator_factory, Die());
EXPECT_TRUE(send_channel->RemoveSendStream(send_ssrc)); EXPECT_TRUE(send_channel->RemoveSendStream(send_ssrc));
EXPECT_TRUE(recv_channel->RemoveRecvStream(recv_ssrc)); EXPECT_TRUE(recv_channel->RemoveRecvStream(recv_ssrc));
} }
@ -1165,16 +1145,12 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullDecoder) { TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullDecoder) {
// |engine| take ownership of the factories. // |engine| take ownership of the factories.
webrtc::MockVideoEncoderFactory* encoder_factory = webrtc::MockVideoEncoderFactory* encoder_factory =
new webrtc::MockVideoEncoderFactory(); new testing::StrictMock<webrtc::MockVideoEncoderFactory>();
webrtc::MockVideoDecoderFactory* decoder_factory = webrtc::MockVideoDecoderFactory* decoder_factory =
new webrtc::MockVideoDecoderFactory(); new testing::StrictMock<webrtc::MockVideoDecoderFactory>();
webrtc::MockVideoBitrateAllocatorFactory* rate_allocator_factory =
new webrtc::MockVideoBitrateAllocatorFactory();
WebRtcVideoEngine engine( WebRtcVideoEngine engine(
(std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)), (std::unique_ptr<webrtc::VideoEncoderFactory>(encoder_factory)),
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)), (std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)));
(std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>(
rate_allocator_factory)));
const webrtc::SdpVideoFormat vp8_format("VP8"); const webrtc::SdpVideoFormat vp8_format("VP8");
const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format}; const std::vector<webrtc::SdpVideoFormat> supported_formats = {vp8_format};
EXPECT_CALL(*encoder_factory, GetSupportedFormats()) EXPECT_CALL(*encoder_factory, GetSupportedFormats())
@ -1267,8 +1243,7 @@ class WebRtcVideoChannelBaseTest : public testing::Test {
protected: protected:
WebRtcVideoChannelBaseTest() WebRtcVideoChannelBaseTest()
: engine_(webrtc::CreateBuiltinVideoEncoderFactory(), : engine_(webrtc::CreateBuiltinVideoEncoderFactory(),
webrtc::CreateBuiltinVideoDecoderFactory(), webrtc::CreateBuiltinVideoDecoderFactory()) {}
webrtc::CreateBuiltinVideoBitrateAllocatorFactory()) {}
virtual void SetUp() { virtual void SetUp() {
// One testcase calls SetUp in a loop, only create call_ once. // One testcase calls SetUp in a loop, only create call_ once.
@ -6785,14 +6760,10 @@ class WebRtcVideoChannelSimulcastTest : public testing::Test {
: fake_call_(), : fake_call_(),
encoder_factory_(new cricket::FakeWebRtcVideoEncoderFactory), encoder_factory_(new cricket::FakeWebRtcVideoEncoderFactory),
decoder_factory_(new cricket::FakeWebRtcVideoDecoderFactory), decoder_factory_(new cricket::FakeWebRtcVideoDecoderFactory),
mock_rate_allocator_factory_(
new webrtc::MockVideoBitrateAllocatorFactory),
engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>( engine_(std::unique_ptr<cricket::FakeWebRtcVideoEncoderFactory>(
encoder_factory_), encoder_factory_),
std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>( std::unique_ptr<cricket::FakeWebRtcVideoDecoderFactory>(
decoder_factory_), decoder_factory_)),
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>(
mock_rate_allocator_factory_)),
last_ssrc_(0) {} last_ssrc_(0) {}
void SetUp() override { void SetUp() override {
@ -6949,7 +6920,6 @@ class WebRtcVideoChannelSimulcastTest : public testing::Test {
FakeCall fake_call_; FakeCall fake_call_;
cricket::FakeWebRtcVideoEncoderFactory* encoder_factory_; cricket::FakeWebRtcVideoEncoderFactory* encoder_factory_;
cricket::FakeWebRtcVideoDecoderFactory* decoder_factory_; cricket::FakeWebRtcVideoDecoderFactory* decoder_factory_;
webrtc::MockVideoBitrateAllocatorFactory* mock_rate_allocator_factory_;
WebRtcVideoEngine engine_; WebRtcVideoEngine engine_;
std::unique_ptr<VideoMediaChannel> channel_; std::unique_ptr<VideoMediaChannel> channel_;
uint32_t last_ssrc_; uint32_t last_ssrc_;

View File

@ -158,7 +158,6 @@ rtc_static_library("video_coding") {
"..:module_api_public", "..:module_api_public",
"../..:webrtc_common", "../..:webrtc_common",
"../../api:fec_controller_api", "../../api:fec_controller_api",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:encoded_frame", "../../api/video:encoded_frame",
"../../api/video:video_bitrate_allocator", "../../api/video:video_bitrate_allocator",
"../../api/video:video_frame", "../../api/video:video_frame",
@ -643,7 +642,6 @@ if (rtc_include_tests) {
":webrtc_vp9_helpers", ":webrtc_vp9_helpers",
"../..:webrtc_common", "../..:webrtc_common",
"../../api:videocodec_test_fixture_api", "../../api:videocodec_test_fixture_api",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:video_bitrate_allocator", "../../api/video:video_bitrate_allocator",
"../../api/video:video_frame", "../../api/video:video_frame",
"../../api/video:video_frame_i420", "../../api/video:video_frame_i420",
@ -897,9 +895,7 @@ if (rtc_include_tests) {
"../../api:simulcast_test_fixture_api", "../../api:simulcast_test_fixture_api",
"../../api:videocodec_test_fixture_api", "../../api:videocodec_test_fixture_api",
"../../api/test/video:function_video_factory", "../../api/test/video:function_video_factory",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:video_bitrate_allocator", "../../api/video:video_bitrate_allocator",
"../../api/video:video_bitrate_allocator_factory",
"../../api/video:video_frame", "../../api/video:video_frame",
"../../api/video:video_frame_i420", "../../api/video:video_frame_i420",
"../../api/video_codecs:create_vp8_temporal_layers", "../../api/video_codecs:create_vp8_temporal_layers",

View File

@ -14,7 +14,6 @@
#include <limits> #include <limits>
#include <utility> #include <utility>
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/i420_buffer.h" #include "api/video/i420_buffer.h"
#include "common_types.h" // NOLINT(build/include) #include "common_types.h" // NOLINT(build/include)
#include "common_video/h264/h264_common.h" #include "common_video/h264/h264_common.h"
@ -174,9 +173,8 @@ VideoProcessor::VideoProcessor(webrtc::VideoEncoder* encoder,
stats_(stats), stats_(stats),
encoder_(encoder), encoder_(encoder),
decoders_(decoders), decoders_(decoders),
bitrate_allocator_( bitrate_allocator_(VideoCodecInitializer::CreateBitrateAllocator(
CreateBuiltinVideoBitrateAllocatorFactory() config_.codec_settings)),
->CreateVideoBitrateAllocator(config_.codec_settings)),
framerate_fps_(0), framerate_fps_(0),
encode_callback_(this), encode_callback_(this),
input_frame_reader_(input_frame_reader), input_frame_reader_(input_frame_reader),

View File

@ -30,9 +30,15 @@ class VideoCodecInitializer {
// type used. For instance, VP8 will create an allocator than can handle // type used. For instance, VP8 will create an allocator than can handle
// simulcast and temporal layering. // simulcast and temporal layering.
// GetBitrateAllocator is called implicitly from here, no need to call again. // GetBitrateAllocator is called implicitly from here, no need to call again.
static bool SetupCodec(const VideoEncoderConfig& config, static bool SetupCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams, const std::vector<VideoStream>& streams,
VideoCodec* codec); VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator);
// Create a bitrate allocator for the specified codec.
static std::unique_ptr<VideoBitrateAllocator> CreateBitrateAllocator(
const VideoCodec& codec);
private: private:
static VideoCodec VideoEncoderConfigToVideoCodec( static VideoCodec VideoEncoderConfigToVideoCodec(

View File

@ -24,13 +24,15 @@
namespace webrtc { namespace webrtc {
bool VideoCodecInitializer::SetupCodec(const VideoEncoderConfig& config, bool VideoCodecInitializer::SetupCodec(
const VideoEncoderConfig& config,
const std::vector<VideoStream>& streams, const std::vector<VideoStream>& streams,
VideoCodec* codec) { VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) {
if (config.codec_type == kVideoCodecMultiplex) { if (config.codec_type == kVideoCodecMultiplex) {
VideoEncoderConfig associated_config = config.Copy(); VideoEncoderConfig associated_config = config.Copy();
associated_config.codec_type = kVideoCodecVP9; associated_config.codec_type = kVideoCodecVP9;
if (!SetupCodec(associated_config, streams, codec)) { if (!SetupCodec(associated_config, streams, codec, bitrate_allocator)) {
RTC_LOG(LS_ERROR) << "Failed to create stereo encoder configuration."; RTC_LOG(LS_ERROR) << "Failed to create stereo encoder configuration.";
return false; return false;
} }
@ -39,9 +41,31 @@ bool VideoCodecInitializer::SetupCodec(const VideoEncoderConfig& config,
} }
*codec = VideoEncoderConfigToVideoCodec(config, streams); *codec = VideoEncoderConfigToVideoCodec(config, streams);
*bitrate_allocator = CreateBitrateAllocator(*codec);
return true; return true;
} }
std::unique_ptr<VideoBitrateAllocator>
VideoCodecInitializer::CreateBitrateAllocator(const VideoCodec& codec) {
std::unique_ptr<VideoBitrateAllocator> rate_allocator;
switch (codec.codecType) {
case kVideoCodecVP8:
RTC_FALLTHROUGH();
case kVideoCodecH264:
rate_allocator.reset(new SimulcastRateAllocator(codec));
break;
case kVideoCodecVP9:
rate_allocator.reset(new SvcRateAllocator(codec));
break;
default:
rate_allocator.reset(new DefaultVideoBitrateAllocator(codec));
}
return rate_allocator;
}
// TODO(sprang): Split this up and separate the codec specific parts. // TODO(sprang): Split this up and separate the codec specific parts.
VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec( VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
const VideoEncoderConfig& config, const VideoEncoderConfig& config,

View File

@ -9,13 +9,12 @@
*/ */
#include "modules/video_coding/include/video_codec_initializer.h" #include "modules/video_coding/include/video_codec_initializer.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h" #include "api/video/video_bitrate_allocator.h"
#include "api/video_codecs/create_vp8_temporal_layers.h" #include "api/video_codecs/create_vp8_temporal_layers.h"
#include "api/video_codecs/video_encoder.h" #include "api/video_codecs/video_encoder.h"
#include "api/video_codecs/vp8_temporal_layers.h" #include "api/video_codecs/vp8_temporal_layers.h"
#include "common_types.h" // NOLINT(build/include) #include "common_types.h" // NOLINT(build/include)
#include "modules/video_coding/codecs/vp9/include/vp9_globals.h" #include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
#include "rtc_base/checks.h"
#include "rtc_base/refcountedobject.h" #include "rtc_base/refcountedobject.h"
#include "test/gtest.h" #include "test/gtest.h"
@ -76,13 +75,12 @@ class VideoCodecInitializerTest : public ::testing::Test {
bool InitializeCodec() { bool InitializeCodec() {
codec_out_ = VideoCodec(); codec_out_ = VideoCodec();
bitrate_allocator_out_.reset();
temporal_layers_.clear(); temporal_layers_.clear();
if (!VideoCodecInitializer::SetupCodec(config_, streams_, &codec_out_)) { if (!VideoCodecInitializer::SetupCodec(config_, streams_, &codec_out_,
&bitrate_allocator_out_)) {
return false; return false;
} }
bitrate_allocator_ = CreateBuiltinVideoBitrateAllocatorFactory()
->CreateVideoBitrateAllocator(codec_out_);
RTC_CHECK(bitrate_allocator_);
if (codec_out_.codecType == VideoCodecType::kVideoCodecMultiplex) if (codec_out_.codecType == VideoCodecType::kVideoCodecMultiplex)
return true; return true;
@ -128,7 +126,7 @@ class VideoCodecInitializerTest : public ::testing::Test {
// Output. // Output.
VideoCodec codec_out_; VideoCodec codec_out_;
std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_out_;
std::vector<std::unique_ptr<Vp8TemporalLayers>> temporal_layers_; std::vector<std::unique_ptr<Vp8TemporalLayers>> temporal_layers_;
}; };
@ -137,8 +135,9 @@ TEST_F(VideoCodecInitializerTest, SingleStreamVp8Screenshare) {
streams_.push_back(DefaultStream()); streams_.push_back(DefaultStream());
EXPECT_TRUE(InitializeCodec()); EXPECT_TRUE(InitializeCodec());
VideoBitrateAllocation bitrate_allocation = bitrate_allocator_->GetAllocation( VideoBitrateAllocation bitrate_allocation =
kDefaultTargetBitrateBps, kDefaultFrameRate); bitrate_allocator_out_->GetAllocation(kDefaultTargetBitrateBps,
kDefaultFrameRate);
EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams); EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams);
EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers); EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers);
EXPECT_EQ(kDefaultTargetBitrateBps, bitrate_allocation.get_sum_bps()); EXPECT_EQ(kDefaultTargetBitrateBps, bitrate_allocation.get_sum_bps());
@ -151,8 +150,9 @@ TEST_F(VideoCodecInitializerTest, SingleStreamVp8ScreenshareInactive) {
streams_.push_back(inactive_stream); streams_.push_back(inactive_stream);
EXPECT_TRUE(InitializeCodec()); EXPECT_TRUE(InitializeCodec());
VideoBitrateAllocation bitrate_allocation = bitrate_allocator_->GetAllocation( VideoBitrateAllocation bitrate_allocation =
kDefaultTargetBitrateBps, kDefaultFrameRate); bitrate_allocator_out_->GetAllocation(kDefaultTargetBitrateBps,
kDefaultFrameRate);
EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams); EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams);
EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers); EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers);
EXPECT_EQ(0U, bitrate_allocation.get_sum_bps()); EXPECT_EQ(0U, bitrate_allocation.get_sum_bps());
@ -165,8 +165,9 @@ TEST_F(VideoCodecInitializerTest, TemporalLayeredVp8Screenshare) {
EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams); EXPECT_EQ(1u, codec_out_.numberOfSimulcastStreams);
EXPECT_EQ(2u, codec_out_.VP8()->numberOfTemporalLayers); EXPECT_EQ(2u, codec_out_.VP8()->numberOfTemporalLayers);
VideoBitrateAllocation bitrate_allocation = bitrate_allocator_->GetAllocation( VideoBitrateAllocation bitrate_allocation =
kScreenshareCodecTargetBitrateBps, kScreenshareDefaultFramerate); bitrate_allocator_out_->GetAllocation(kScreenshareCodecTargetBitrateBps,
kScreenshareDefaultFramerate);
EXPECT_EQ(kScreenshareCodecTargetBitrateBps, EXPECT_EQ(kScreenshareCodecTargetBitrateBps,
bitrate_allocation.get_sum_bps()); bitrate_allocation.get_sum_bps());
EXPECT_EQ(kScreenshareTl0BitrateBps, bitrate_allocation.GetBitrate(0, 0)); EXPECT_EQ(kScreenshareTl0BitrateBps, bitrate_allocation.GetBitrate(0, 0));
@ -184,8 +185,9 @@ TEST_F(VideoCodecInitializerTest, SimulcastVp8Screenshare) {
EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers); EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers);
const uint32_t max_bitrate_bps = const uint32_t max_bitrate_bps =
streams_[0].target_bitrate_bps + streams_[1].max_bitrate_bps; streams_[0].target_bitrate_bps + streams_[1].max_bitrate_bps;
VideoBitrateAllocation bitrate_allocation = bitrate_allocator_->GetAllocation( VideoBitrateAllocation bitrate_allocation =
max_bitrate_bps, kScreenshareDefaultFramerate); bitrate_allocator_out_->GetAllocation(max_bitrate_bps,
kScreenshareDefaultFramerate);
EXPECT_EQ(max_bitrate_bps, bitrate_allocation.get_sum_bps()); EXPECT_EQ(max_bitrate_bps, bitrate_allocation.get_sum_bps());
EXPECT_EQ(static_cast<uint32_t>(streams_[0].target_bitrate_bps), EXPECT_EQ(static_cast<uint32_t>(streams_[0].target_bitrate_bps),
bitrate_allocation.GetSpatialLayerSum(0)); bitrate_allocation.GetSpatialLayerSum(0));
@ -208,8 +210,9 @@ TEST_F(VideoCodecInitializerTest, SimulcastVp8ScreenshareInactive) {
EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers); EXPECT_EQ(1u, codec_out_.VP8()->numberOfTemporalLayers);
const uint32_t target_bitrate = const uint32_t target_bitrate =
streams_[0].target_bitrate_bps + streams_[1].target_bitrate_bps; streams_[0].target_bitrate_bps + streams_[1].target_bitrate_bps;
VideoBitrateAllocation bitrate_allocation = bitrate_allocator_->GetAllocation( VideoBitrateAllocation bitrate_allocation =
target_bitrate, kScreenshareDefaultFramerate); bitrate_allocator_out_->GetAllocation(target_bitrate,
kScreenshareDefaultFramerate);
EXPECT_EQ(static_cast<uint32_t>(streams_[0].max_bitrate_bps), EXPECT_EQ(static_cast<uint32_t>(streams_[0].max_bitrate_bps),
bitrate_allocation.get_sum_bps()); bitrate_allocation.get_sum_bps());
EXPECT_EQ(static_cast<uint32_t>(streams_[0].max_bitrate_bps), EXPECT_EQ(static_cast<uint32_t>(streams_[0].max_bitrate_bps),
@ -232,7 +235,7 @@ TEST_F(VideoCodecInitializerTest, HighFpsSimulcastVp8Screenshare) {
const uint32_t max_bitrate_bps = const uint32_t max_bitrate_bps =
streams_[0].target_bitrate_bps + streams_[1].max_bitrate_bps; streams_[0].target_bitrate_bps + streams_[1].max_bitrate_bps;
VideoBitrateAllocation bitrate_allocation = VideoBitrateAllocation bitrate_allocation =
bitrate_allocator_->GetAllocation(max_bitrate_bps, kDefaultFrameRate); bitrate_allocator_out_->GetAllocation(max_bitrate_bps, kDefaultFrameRate);
EXPECT_EQ(max_bitrate_bps, bitrate_allocation.get_sum_bps()); EXPECT_EQ(max_bitrate_bps, bitrate_allocation.get_sum_bps());
EXPECT_EQ(static_cast<uint32_t>(streams_[0].target_bitrate_bps), EXPECT_EQ(static_cast<uint32_t>(streams_[0].target_bitrate_bps),
bitrate_allocation.GetSpatialLayerSum(0)); bitrate_allocation.GetSpatialLayerSum(0));

View File

@ -13,7 +13,6 @@
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/video_bitrate_allocator.h" #include "api/video/video_bitrate_allocator.h"
#include "common_types.h" // NOLINT(build/include) #include "common_types.h" // NOLINT(build/include)
#include "common_video/libyuv/include/webrtc_libyuv.h" #include "common_video/libyuv/include/webrtc_libyuv.h"
@ -87,7 +86,6 @@ class VideoCodingModuleImpl : public VideoCodingModule {
KeyFrameRequestSender* keyframe_request_sender) KeyFrameRequestSender* keyframe_request_sender)
: VideoCodingModule(), : VideoCodingModule(),
sender_(clock, &post_encode_callback_), sender_(clock, &post_encode_callback_),
rate_allocator_factory_(CreateBuiltinVideoBitrateAllocatorFactory()),
timing_(new VCMTiming(clock)), timing_(new VCMTiming(clock)),
receiver_(clock, receiver_(clock,
event_factory, event_factory,
@ -116,8 +114,7 @@ class VideoCodingModuleImpl : public VideoCodingModule {
// asynchronously keep the instance alive until destruction or until a // asynchronously keep the instance alive until destruction or until a
// new send codec is registered. // new send codec is registered.
VideoCodec codec = *sendCodec; VideoCodec codec = *sendCodec;
rate_allocator_ = rate_allocator_ = VideoCodecInitializer::CreateBitrateAllocator(codec);
rate_allocator_factory_->CreateVideoBitrateAllocator(codec);
return sender_.RegisterSendCodec(&codec, numberOfCores, maxPayloadSize); return sender_.RegisterSendCodec(&codec, numberOfCores, maxPayloadSize);
} }
return sender_.RegisterSendCodec(sendCodec, numberOfCores, maxPayloadSize); return sender_.RegisterSendCodec(sendCodec, numberOfCores, maxPayloadSize);
@ -216,9 +213,8 @@ class VideoCodingModuleImpl : public VideoCodingModule {
rtc::ThreadChecker construction_thread_; rtc::ThreadChecker construction_thread_;
EncodedImageCallbackWrapper post_encode_callback_; EncodedImageCallbackWrapper post_encode_callback_;
vcm::VideoSender sender_; vcm::VideoSender sender_;
const std::unique_ptr<VideoBitrateAllocatorFactory> rate_allocator_factory_;
std::unique_ptr<VideoBitrateAllocator> rate_allocator_; std::unique_ptr<VideoBitrateAllocator> rate_allocator_;
const std::unique_ptr<VCMTiming> timing_; std::unique_ptr<VCMTiming> timing_;
vcm::VideoReceiver receiver_; vcm::VideoReceiver receiver_;
}; };
} // namespace } // namespace

View File

@ -217,6 +217,23 @@ rtc_static_library("peerconnection") {
] ]
} }
rtc_static_library("builtin_video_bitrate_allocator_factory") {
sources = [
"builtin_video_bitrate_allocator_factory.cc",
"builtin_video_bitrate_allocator_factory.h",
]
deps = [
"../api/video:video_bitrate_allocator_factory",
"../media:rtc_media_base",
"../modules/video_coding:video_coding_utility",
"../modules/video_coding:webrtc_vp9_helpers",
"../rtc_base:ptr_util",
"../rtc_base/system:fallthrough",
"//third_party/abseil-cpp/absl/memory",
]
}
# This target implements CreatePeerConnectionFactory methods that will create a # This target implements CreatePeerConnectionFactory methods that will create a
# PeerConnection will full functionality (audio, video and data). Applications # PeerConnection will full functionality (audio, video and data). Applications
# that wish to reduce their binary size by ommitting functionality they don't # that wish to reduce their binary size by ommitting functionality they don't
@ -233,7 +250,6 @@ rtc_static_library("create_pc_factory") {
"../api:libjingle_peerconnection_api", "../api:libjingle_peerconnection_api",
"../api/audio:audio_mixer_api", "../api/audio:audio_mixer_api",
"../api/audio_codecs:audio_codecs_api", "../api/audio_codecs:audio_codecs_api",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video_codecs:video_codecs_api", "../api/video_codecs:video_codecs_api",
"../call", "../call",
"../call:call_interfaces", "../call:call_interfaces",
@ -486,7 +502,6 @@ if (rtc_include_tests) {
"../api:libjingle_peerconnection_api", "../api:libjingle_peerconnection_api",
"../api:mock_rtp", "../api:mock_rtp",
"../api/units:time_delta", "../api/units:time_delta",
"../api/video:builtin_video_bitrate_allocator_factory",
"../logging:fake_rtc_event_log", "../logging:fake_rtc_event_log",
"../rtc_base:checks", "../rtc_base:checks",
"../rtc_base:stringutils", "../rtc_base:stringutils",

View File

@ -8,7 +8,7 @@
* 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 "api/video/builtin_video_bitrate_allocator_factory.h" #include "pc/builtin_video_bitrate_allocator_factory.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "media/base/codec.h" #include "media/base/codec.h"

View File

@ -8,8 +8,8 @@
* 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 API_VIDEO_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_ #ifndef PC_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_
#define API_VIDEO_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_ #define PC_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_
#include <memory> #include <memory>
@ -22,4 +22,4 @@ CreateBuiltinVideoBitrateAllocatorFactory();
} // namespace webrtc } // namespace webrtc
#endif // API_VIDEO_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_ #endif // PC_BUILTIN_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_

View File

@ -10,7 +10,6 @@
#include "api/call/callfactoryinterface.h" #include "api/call/callfactoryinterface.h"
#include "api/peerconnectioninterface.h" #include "api/peerconnectioninterface.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
#include "logging/rtc_event_log/rtc_event_log_factory_interface.h" #include "logging/rtc_event_log/rtc_event_log_factory_interface.h"
@ -53,15 +52,10 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
audio_processing_use = AudioProcessingBuilder().Create(); audio_processing_use = AudioProcessingBuilder().Create();
} }
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory =
CreateBuiltinVideoBitrateAllocatorFactory();
std::unique_ptr<cricket::MediaEngineInterface> media_engine( std::unique_ptr<cricket::MediaEngineInterface> media_engine(
cricket::WebRtcMediaEngineFactory::Create( cricket::WebRtcMediaEngineFactory::Create(
default_adm, audio_encoder_factory, audio_decoder_factory, default_adm, audio_encoder_factory, audio_decoder_factory,
video_encoder_factory, video_decoder_factory, video_encoder_factory, video_decoder_factory, audio_mixer,
std::move(video_bitrate_allocator_factory), audio_mixer,
audio_processing_use)); audio_processing_use));
std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory(); std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory();
@ -93,15 +87,10 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
audio_processing_use = AudioProcessingBuilder().Create(); audio_processing_use = AudioProcessingBuilder().Create();
} }
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory =
CreateBuiltinVideoBitrateAllocatorFactory();
std::unique_ptr<cricket::MediaEngineInterface> media_engine( std::unique_ptr<cricket::MediaEngineInterface> media_engine(
cricket::WebRtcMediaEngineFactory::Create( cricket::WebRtcMediaEngineFactory::Create(
default_adm, audio_encoder_factory, audio_decoder_factory, default_adm, audio_encoder_factory, audio_decoder_factory,
video_encoder_factory, video_decoder_factory, video_encoder_factory, video_decoder_factory, audio_mixer,
std::move(video_bitrate_allocator_factory), audio_mixer,
audio_processing_use)); audio_processing_use));
std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory(); std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory();
@ -130,16 +119,11 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
if (!audio_processing) if (!audio_processing)
audio_processing = AudioProcessingBuilder().Create(); audio_processing = AudioProcessingBuilder().Create();
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory =
CreateBuiltinVideoBitrateAllocatorFactory();
std::unique_ptr<cricket::MediaEngineInterface> media_engine = std::unique_ptr<cricket::MediaEngineInterface> media_engine =
cricket::WebRtcMediaEngineFactory::Create( cricket::WebRtcMediaEngineFactory::Create(
default_adm, audio_encoder_factory, audio_decoder_factory, default_adm, audio_encoder_factory, audio_decoder_factory,
std::move(video_encoder_factory), std::move(video_decoder_factory), std::move(video_encoder_factory), std::move(video_decoder_factory),
std::move(video_bitrate_allocator_factory), audio_mixer, audio_mixer, audio_processing);
audio_processing);
std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory(); std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory();

View File

@ -29,7 +29,6 @@
#include "api/peerconnectionproxy.h" #include "api/peerconnectionproxy.h"
#include "api/rtpreceiverinterface.h" #include "api/rtpreceiverinterface.h"
#include "api/umametrics.h" #include "api/umametrics.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h"
#include "api/video_codecs/sdp_video_format.h" #include "api/video_codecs/sdp_video_format.h"
@ -622,9 +621,7 @@ class PeerConnectionWrapper : public webrtc::PeerConnectionObserver,
webrtc::CreateBuiltinAudioEncoderFactory(), webrtc::CreateBuiltinAudioEncoderFactory(),
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(),
webrtc::CreateBuiltinVideoEncoderFactory(), webrtc::CreateBuiltinVideoEncoderFactory(),
webrtc::CreateBuiltinVideoDecoderFactory(), webrtc::CreateBuiltinVideoDecoderFactory(), nullptr,
webrtc::CreateBuiltinVideoBitrateAllocatorFactory(),
nullptr /* audio_mixer */,
webrtc::AudioProcessingBuilder().Create()); webrtc::AudioProcessingBuilder().Create());
pc_factory_dependencies.call_factory = webrtc::CreateCallFactory(); pc_factory_dependencies.call_factory = webrtc::CreateCallFactory();
if (event_log_factory) { if (event_log_factory) {

View File

@ -10,7 +10,6 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h"
#include "media/engine/webrtcmediaengine.h" #include "media/engine/webrtcmediaengine.h"
@ -57,7 +56,6 @@ class PeerConnectionFactoryForJsepTest : public PeerConnectionFactory {
CreateBuiltinAudioDecoderFactory(), CreateBuiltinAudioDecoderFactory(),
CreateBuiltinVideoEncoderFactory(), CreateBuiltinVideoEncoderFactory(),
CreateBuiltinVideoDecoderFactory(), CreateBuiltinVideoDecoderFactory(),
CreateBuiltinVideoBitrateAllocatorFactory(),
nullptr, nullptr,
AudioProcessingBuilder().Create()), AudioProcessingBuilder().Create()),
CreateCallFactory(), CreateCallFactory(),

View File

@ -22,7 +22,6 @@
#include "api/peerconnectioninterface.h" #include "api/peerconnectioninterface.h"
#include "api/rtpreceiverinterface.h" #include "api/rtpreceiverinterface.h"
#include "api/rtpsenderinterface.h" #include "api/rtpsenderinterface.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_decoder_factory.h"
#include "api/video_codecs/builtin_video_encoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h"
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h" #include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
@ -634,8 +633,6 @@ class PeerConnectionFactoryForTest : public webrtc::PeerConnectionFactory {
auto audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory(); auto audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
auto video_encoder_factory = webrtc::CreateBuiltinVideoEncoderFactory(); auto video_encoder_factory = webrtc::CreateBuiltinVideoEncoderFactory();
auto video_decoder_factory = webrtc::CreateBuiltinVideoDecoderFactory(); auto video_decoder_factory = webrtc::CreateBuiltinVideoDecoderFactory();
auto video_bitrate_allocator_factory =
webrtc::CreateBuiltinVideoBitrateAllocatorFactory();
// Use fake audio device module since we're only testing the interface // Use fake audio device module since we're only testing the interface
// level, and using a real one could make tests flaky when run in parallel. // level, and using a real one could make tests flaky when run in parallel.
@ -643,8 +640,7 @@ class PeerConnectionFactoryForTest : public webrtc::PeerConnectionFactory {
cricket::WebRtcMediaEngineFactory::Create( cricket::WebRtcMediaEngineFactory::Create(
FakeAudioCaptureModule::Create(), audio_encoder_factory, FakeAudioCaptureModule::Create(), audio_encoder_factory,
audio_decoder_factory, std::move(video_encoder_factory), audio_decoder_factory, std::move(video_encoder_factory),
std::move(video_decoder_factory), std::move(video_decoder_factory), nullptr,
std::move(video_bitrate_allocator_factory), nullptr,
webrtc::AudioProcessingBuilder().Create())); webrtc::AudioProcessingBuilder().Create()));
std::unique_ptr<webrtc::CallFactoryInterface> call_factory = std::unique_ptr<webrtc::CallFactoryInterface> call_factory =

View File

@ -913,7 +913,6 @@ if (is_ios || is_mac) {
"../api/audio_codecs:audio_codecs_api", "../api/audio_codecs:audio_codecs_api",
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_frame", "../api/video:video_frame",
"../api/video_codecs:video_codecs_api", "../api/video_codecs:video_codecs_api",
"../common_video", "../common_video",

View File

@ -573,7 +573,6 @@ if (is_android) {
":vp9_jni", # TODO(bugs.webrtc.org/7925): Remove. ":vp9_jni", # TODO(bugs.webrtc.org/7925): Remove.
"../..:webrtc_common", "../..:webrtc_common",
"../../api:libjingle_peerconnection_api", "../../api:libjingle_peerconnection_api",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:encoded_image", "../../api/video:encoded_image",
"../../api/video:video_frame", "../../api/video:video_frame",
"../../api/video_codecs:builtin_video_decoder_factory", "../../api/video_codecs:builtin_video_decoder_factory",
@ -663,7 +662,6 @@ if (is_android) {
":native_api_jni", ":native_api_jni",
"../..:webrtc_common", "../..:webrtc_common",
"../../api:libjingle_peerconnection_api", "../../api:libjingle_peerconnection_api",
"../../api/video:video_bitrate_allocator_factory",
"../../api/video_codecs:video_codecs_api", "../../api/video_codecs:video_codecs_api",
"../../logging:rtc_event_log_api", "../../logging:rtc_event_log_api",
"../../logging:rtc_event_log_impl_base", "../../logging:rtc_event_log_impl_base",
@ -876,7 +874,6 @@ if (is_android) {
deps = [ deps = [
":base_jni", ":base_jni",
"../../api/video:video_bitrate_allocator_factory",
"../../api/video_codecs:video_codecs_api", "../../api/video_codecs:video_codecs_api",
] ]
} }
@ -899,7 +896,6 @@ if (is_android) {
deps = [ deps = [
":base_jni", ":base_jni",
"../../api:callfactory_api", "../../api:callfactory_api",
"../../api/video:video_bitrate_allocator_factory",
"../../api/video_codecs:video_codecs_api", "../../api/video_codecs:video_codecs_api",
"../../call:call_interfaces", "../../call:call_interfaces",
"../../logging:rtc_event_log_api", "../../logging:rtc_event_log_api",
@ -1392,7 +1388,6 @@ if (is_android) {
":video_jni", ":video_jni",
"../../api/audio_codecs:builtin_audio_decoder_factory", "../../api/audio_codecs:builtin_audio_decoder_factory",
"../../api/audio_codecs:builtin_audio_encoder_factory", "../../api/audio_codecs:builtin_audio_encoder_factory",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:video_frame", "../../api/video:video_frame",
"../../media:rtc_audio_video", "../../media:rtc_audio_video",
"../../media:rtc_internal_video_codecs", "../../media:rtc_internal_video_codecs",

View File

@ -12,7 +12,6 @@
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "media/base/mediaengine.h" #include "media/base/mediaengine.h"
#include "media/engine/internaldecoderfactory.h" #include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h" #include "media/engine/internalencoderfactory.h"
@ -45,7 +44,6 @@ rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> CreateTestPCF(
webrtc::CreateBuiltinAudioDecoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(),
absl::make_unique<webrtc::InternalEncoderFactory>(), absl::make_unique<webrtc::InternalEncoderFactory>(),
absl::make_unique<webrtc::InternalDecoderFactory>(), absl::make_unique<webrtc::InternalDecoderFactory>(),
webrtc::CreateBuiltinVideoBitrateAllocatorFactory(),
nullptr /* audio_mixer */, webrtc::AudioProcessingBuilder().Create()); nullptr /* audio_mixer */, webrtc::AudioProcessingBuilder().Create());
RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get(); RTC_LOG(LS_INFO) << "Media engine created: " << media_engine.get();

View File

@ -12,7 +12,6 @@
#include <utility> #include <utility>
#include "api/call/callfactoryinterface.h" #include "api/call/callfactoryinterface.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
#include "logging/rtc_event_log/rtc_event_log_factory_interface.h" #include "logging/rtc_event_log/rtc_event_log_factory_interface.h"
@ -37,15 +36,12 @@ cricket::MediaEngineInterface* CreateMediaEngine(
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
std::unique_ptr<VideoEncoderFactory> video_encoder_factory, std::unique_ptr<VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<VideoDecoderFactory> video_decoder_factory, std::unique_ptr<VideoDecoderFactory> video_decoder_factory,
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<AudioMixer> audio_mixer, rtc::scoped_refptr<AudioMixer> audio_mixer,
rtc::scoped_refptr<AudioProcessing> audio_processor) { rtc::scoped_refptr<AudioProcessing> audio_processor) {
return cricket::WebRtcMediaEngineFactory::Create( return cricket::WebRtcMediaEngineFactory::Create(
adm, audio_encoder_factory, audio_decoder_factory, adm, audio_encoder_factory, audio_decoder_factory,
std::move(video_encoder_factory), std::move(video_decoder_factory), std::move(video_encoder_factory), std::move(video_decoder_factory),
std::move(video_bitrate_allocator_factory), audio_mixer, audio_mixer, audio_processor)
audio_processor)
.release(); .release();
} }

View File

@ -25,7 +25,6 @@ class AudioMixer;
class AudioProcessing; class AudioProcessing;
class VideoEncoderFactory; class VideoEncoderFactory;
class VideoDecoderFactory; class VideoDecoderFactory;
class VideoBitrateAllocatorFactory;
} // namespace webrtc } // namespace webrtc
namespace cricket { namespace cricket {
@ -44,8 +43,6 @@ cricket::MediaEngineInterface* CreateMediaEngine(
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
std::unique_ptr<VideoEncoderFactory> video_encoder_factory, std::unique_ptr<VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<VideoDecoderFactory> video_decoder_factory, std::unique_ptr<VideoDecoderFactory> video_decoder_factory,
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<AudioMixer> audio_mixer, rtc::scoped_refptr<AudioMixer> audio_mixer,
rtc::scoped_refptr<AudioProcessing> audio_processor); rtc::scoped_refptr<AudioProcessing> audio_processor);

View File

@ -27,8 +27,6 @@ cricket::MediaEngineInterface* CreateMediaEngine(
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
std::unique_ptr<VideoEncoderFactory> video_encoder_factory, std::unique_ptr<VideoEncoderFactory> video_encoder_factory,
std::unique_ptr<VideoDecoderFactory> video_decoder_factory, std::unique_ptr<VideoDecoderFactory> video_decoder_factory,
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory,
rtc::scoped_refptr<AudioMixer> audio_mixer, rtc::scoped_refptr<AudioMixer> audio_mixer,
rtc::scoped_refptr<AudioProcessing> audio_processor) { rtc::scoped_refptr<AudioProcessing> audio_processor) {
return nullptr; return nullptr;

View File

@ -10,7 +10,6 @@
#include "sdk/android/src/jni/pc/video.h" #include "sdk/android/src/jni/pc/video.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
@ -36,10 +35,5 @@ void* CreateVideoSource(JNIEnv* env,
return nullptr; return nullptr;
} }
std::unique_ptr<VideoBitrateAllocatorFactory>
CreateVideoBitrateAllocatorFactory() {
return nullptr;
}
} // namespace jni } // namespace jni
} // namespace webrtc } // namespace webrtc

View File

@ -13,7 +13,6 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
#include "media/base/mediaengine.h" #include "media/base/mediaengine.h"
@ -260,17 +259,13 @@ jlong CreatePeerConnectionFactoryForJava(
std::unique_ptr<RtcEventLogFactoryInterface> rtc_event_log_factory( std::unique_ptr<RtcEventLogFactoryInterface> rtc_event_log_factory(
CreateRtcEventLogFactory()); CreateRtcEventLogFactory());
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory = CreateVideoBitrateAllocatorFactory();
std::unique_ptr<cricket::MediaEngineInterface> media_engine(CreateMediaEngine( std::unique_ptr<cricket::MediaEngineInterface> media_engine(CreateMediaEngine(
audio_device_module, audio_encoder_factory, audio_decoder_factory, audio_device_module, audio_encoder_factory, audio_decoder_factory,
std::unique_ptr<VideoEncoderFactory>( std::unique_ptr<VideoEncoderFactory>(
CreateVideoEncoderFactory(jni, jencoder_factory)), CreateVideoEncoderFactory(jni, jencoder_factory)),
std::unique_ptr<VideoDecoderFactory>( std::unique_ptr<VideoDecoderFactory>(
CreateVideoDecoderFactory(jni, jdecoder_factory)), CreateVideoDecoderFactory(jni, jdecoder_factory)),
std::move(video_bitrate_allocator_factory), audio_mixer, audio_mixer, audio_processor));
audio_processor));
PeerConnectionFactoryDependencies dependencies; PeerConnectionFactoryDependencies dependencies;
dependencies.network_thread = network_thread.get(); dependencies.network_thread = network_thread.get();
dependencies.worker_thread = worker_thread.get(); dependencies.worker_thread = worker_thread.get();

View File

@ -13,7 +13,6 @@
#include <jni.h> #include <jni.h>
#include <memory> #include <memory>
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h" #include "api/video_codecs/video_encoder_factory.h"
#include "api/videosourceproxy.h" #include "api/videosourceproxy.h"
@ -53,10 +52,5 @@ void* CreateVideoSource(JNIEnv* env,
.release(); .release();
} }
std::unique_ptr<VideoBitrateAllocatorFactory>
CreateVideoBitrateAllocatorFactory() {
return CreateBuiltinVideoBitrateAllocatorFactory();
}
} // namespace jni } // namespace jni
} // namespace webrtc } // namespace webrtc

View File

@ -13,7 +13,6 @@
#include <jni.h> #include <jni.h>
#include <memory>
#include "rtc_base/scoped_ref_ptr.h" #include "rtc_base/scoped_ref_ptr.h"
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
#include "sdk/android/native_api/jni/scoped_java_ref.h" #include "sdk/android/native_api/jni/scoped_java_ref.h"
@ -21,7 +20,6 @@
namespace webrtc { namespace webrtc {
class VideoEncoderFactory; class VideoEncoderFactory;
class VideoDecoderFactory; class VideoDecoderFactory;
class VideoBitrateAllocatorFactory;
} // namespace webrtc } // namespace webrtc
namespace webrtc { namespace webrtc {
@ -40,9 +38,6 @@ void* CreateVideoSource(JNIEnv* env,
rtc::Thread* worker_thread, rtc::Thread* worker_thread,
jboolean is_screencast); jboolean is_screencast);
std::unique_ptr<VideoBitrateAllocatorFactory>
CreateVideoBitrateAllocatorFactory();
} // namespace jni } // namespace jni
} // namespace webrtc } // namespace webrtc

View File

@ -30,7 +30,6 @@
// is not smart enough to take the #ifdef into account. // is not smart enough to take the #ifdef into account.
#include "api/audio_codecs/builtin_audio_decoder_factory.h" // nogncheck #include "api/audio_codecs/builtin_audio_decoder_factory.h" // nogncheck
#include "api/audio_codecs/builtin_audio_encoder_factory.h" // nogncheck #include "api/audio_codecs/builtin_audio_encoder_factory.h" // nogncheck
#include "api/video/builtin_video_bitrate_allocator_factory.h" // nogncheck
#include "media/engine/convert_legacy_video_factory.h" // nogncheck #include "media/engine/convert_legacy_video_factory.h" // nogncheck
#include "modules/audio_device/include/audio_device.h" // nogncheck #include "modules/audio_device/include/audio_device.h" // nogncheck
#include "modules/audio_processing/include/audio_processing.h" // nogncheck #include "modules/audio_processing/include/audio_processing.h" // nogncheck
@ -194,13 +193,11 @@
if (!audioProcessingModule) audioProcessingModule = webrtc::AudioProcessingBuilder().Create(); if (!audioProcessingModule) audioProcessingModule = webrtc::AudioProcessingBuilder().Create();
std::unique_ptr<cricket::MediaEngineInterface> media_engine = std::unique_ptr<cricket::MediaEngineInterface> media_engine =
cricket::WebRtcMediaEngineFactory::Create( cricket::WebRtcMediaEngineFactory::Create(audioDeviceModule,
audioDeviceModule,
audioEncoderFactory, audioEncoderFactory,
audioDecoderFactory, audioDecoderFactory,
std::move(videoEncoderFactory), std::move(videoEncoderFactory),
std::move(videoDecoderFactory), std::move(videoDecoderFactory),
webrtc::CreateBuiltinVideoBitrateAllocatorFactory(),
nullptr, // audio mixer nullptr, // audio mixer
audioProcessingModule); audioProcessingModule);

View File

@ -327,7 +327,6 @@ if (rtc_include_tests) {
"../api:create_simulcast_test_fixture_api", "../api:create_simulcast_test_fixture_api",
"../api:simulcast_test_fixture_api", "../api:simulcast_test_fixture_api",
"../api/test/video:function_video_factory", "../api/test/video:function_video_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_frame_i420", "../api/video:video_frame_i420",
"../modules/rtp_rtcp:rtp_rtcp", "../modules/rtp_rtcp:rtp_rtcp",
"../modules/video_capture", "../modules/video_capture",
@ -663,8 +662,6 @@ rtc_source_set("test_common") {
"../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_decoder_factory",
"../api/audio_codecs:builtin_audio_encoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory",
"../api/test/video:function_video_factory", "../api/test/video:function_video_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_bitrate_allocator_factory",
"../api/video:video_frame", "../api/video:video_frame",
"../api/video_codecs:video_codecs_api", "../api/video_codecs:video_codecs_api",
"../audio", "../audio",

View File

@ -15,7 +15,6 @@
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_encoder_config.h" #include "api/video_codecs/video_encoder_config.h"
#include "call/fake_network_pipe.h" #include "call/fake_network_pipe.h"
#include "call/rtp_transport_controller_send.h" #include "call/rtp_transport_controller_send.h"
@ -55,7 +54,6 @@ CallTest::CallTest()
return fake_encoder; return fake_encoder;
}), }),
fake_decoder_factory_([]() { return absl::make_unique<FakeDecoder>(); }), fake_decoder_factory_([]() { return absl::make_unique<FakeDecoder>(); }),
bitrate_allocator_factory_(CreateBuiltinVideoBitrateAllocatorFactory()),
num_video_streams_(1), num_video_streams_(1),
num_audio_streams_(0), num_audio_streams_(0),
num_flexfec_streams_(0), num_flexfec_streams_(0),
@ -235,8 +233,6 @@ void CallTest::CreateVideoSendConfig(VideoSendStream::Config* video_config,
RTC_DCHECK_LE(num_video_streams + num_used_ssrcs, kNumSsrcs); RTC_DCHECK_LE(num_video_streams + num_used_ssrcs, kNumSsrcs);
*video_config = VideoSendStream::Config(send_transport); *video_config = VideoSendStream::Config(send_transport);
video_config->encoder_settings.encoder_factory = &fake_encoder_factory_; video_config->encoder_settings.encoder_factory = &fake_encoder_factory_;
video_config->encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
video_config->rtp.payload_name = "FAKE"; video_config->rtp.payload_name = "FAKE";
video_config->rtp.payload_type = kFakeVideoSendPayloadType; video_config->rtp.payload_type = kFakeVideoSendPayloadType;
video_config->rtp.extensions.push_back( video_config->rtp.extensions.push_back(

View File

@ -15,7 +15,6 @@
#include "api/test/video/function_video_decoder_factory.h" #include "api/test/video/function_video_decoder_factory.h"
#include "api/test/video/function_video_encoder_factory.h" #include "api/test/video/function_video_encoder_factory.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "call/call.h" #include "call/call.h"
#include "call/rtp_transport_controller_send.h" #include "call/rtp_transport_controller_send.h"
#include "logging/rtc_event_log/rtc_event_log.h" #include "logging/rtc_event_log/rtc_event_log.h"
@ -206,7 +205,6 @@ class CallTest : public ::testing::Test {
test::FunctionVideoEncoderFactory fake_encoder_factory_; test::FunctionVideoEncoderFactory fake_encoder_factory_;
int fake_encoder_max_bitrate_ = -1; int fake_encoder_max_bitrate_ = -1;
test::FunctionVideoDecoderFactory fake_decoder_factory_; test::FunctionVideoDecoderFactory fake_decoder_factory_;
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
// Number of simulcast substreams. // Number of simulcast substreams.
size_t num_video_streams_; size_t num_video_streams_;
size_t num_audio_streams_; size_t num_audio_streams_;

View File

@ -46,7 +46,6 @@ if (rtc_include_tests) {
"../../api/units:data_rate", "../../api/units:data_rate",
"../../api/units:time_delta", "../../api/units:time_delta",
"../../api/units:timestamp", "../../api/units:timestamp",
"../../api/video:builtin_video_bitrate_allocator_factory",
"../../api/video:video_frame", "../../api/video:video_frame",
"../../api/video:video_frame_i420", "../../api/video:video_frame_i420",
"../../api/video_codecs:video_codecs_api", "../../api/video_codecs:video_codecs_api",

View File

@ -13,7 +13,6 @@
#include <utility> #include <utility>
#include "api/test/video/function_video_encoder_factory.h" #include "api/test/video/function_video_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "media/base/mediaconstants.h" #include "media/base/mediaconstants.h"
#include "media/engine/internaldecoderfactory.h" #include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h" #include "media/engine/internalencoderfactory.h"
@ -214,15 +213,9 @@ SendVideoStream::SendVideoStream(CallClient* sender,
} }
RTC_CHECK(encoder_factory_); RTC_CHECK(encoder_factory_);
bitrate_allocator_factory_ = CreateBuiltinVideoBitrateAllocatorFactory();
RTC_CHECK(bitrate_allocator_factory_);
VideoSendStream::Config send_config = VideoSendStream::Config send_config =
CreateVideoSendStreamConfig(config, ssrcs_, send_transport); CreateVideoSendStreamConfig(config, ssrcs_, send_transport);
send_config.encoder_settings.encoder_factory = encoder_factory_.get(); send_config.encoder_settings.encoder_factory = encoder_factory_.get();
send_config.encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
VideoEncoderConfig encoder_config = CreateVideoEncoderConfig(config); VideoEncoderConfig encoder_config = CreateVideoEncoderConfig(config);
send_stream_ = sender_->call_->CreateVideoSendStream( send_stream_ = sender_->call_->CreateVideoSendStream(

View File

@ -50,7 +50,6 @@ class SendVideoStream {
CallClient* const sender_; CallClient* const sender_;
const VideoStreamConfig config_; const VideoStreamConfig config_;
std::unique_ptr<VideoEncoderFactory> encoder_factory_; std::unique_ptr<VideoEncoderFactory> encoder_factory_;
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
std::unique_ptr<TestVideoCapturer> video_capturer_; std::unique_ptr<TestVideoCapturer> video_capturer_;
FrameGeneratorCapturer* frame_generator_ = nullptr; FrameGeneratorCapturer* frame_generator_ = nullptr;
int next_local_network_id_ = 0; int next_local_network_id_ = 0;

View File

@ -154,7 +154,6 @@ rtc_source_set("video_stream_encoder_impl") {
deps = [ deps = [
"../api/video:encoded_image", "../api/video:encoded_image",
"../api/video:video_bitrate_allocator", "../api/video:video_bitrate_allocator",
"../api/video:video_bitrate_allocator_factory",
"../api/video:video_frame", "../api/video:video_frame",
"../api/video:video_frame_i420", "../api/video:video_frame_i420",
"../api/video:video_stream_encoder", "../api/video:video_stream_encoder",
@ -208,8 +207,6 @@ if (rtc_include_tests) {
"../api:fec_controller_api", "../api:fec_controller_api",
"../api:test_dependency_factory", "../api:test_dependency_factory",
"../api:video_quality_test_fixture_api", "../api:video_quality_test_fixture_api",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:video_bitrate_allocator_factory",
"../call:fake_network", "../call:fake_network",
"../call:simulated_network", "../call:simulated_network",
"../logging:rtc_event_log_api", "../logging:rtc_event_log_api",
@ -434,7 +431,6 @@ if (rtc_include_tests) {
"../api:fake_frame_encryptor", "../api:fake_frame_encryptor",
"../api:simulated_network_api", "../api:simulated_network_api",
"../api/test/video:function_video_factory", "../api/test/video:function_video_factory",
"../api/video:builtin_video_bitrate_allocator_factory",
"../api/video:encoded_image", "../api/video:encoded_image",
"../api/video:video_frame", "../api/video:video_frame",
"../api/video:video_frame_i420", "../api/video:video_frame_i420",

View File

@ -9,7 +9,6 @@
*/ */
#include "api/test/simulated_network.h" #include "api/test/simulated_network.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h" #include "call/fake_network_pipe.h"
#include "call/simulated_network.h" #include "call/simulated_network.h"
#include "modules/rtp_rtcp/include/rtp_rtcp.h" #include "modules/rtp_rtcp/include/rtp_rtcp.h"
@ -274,8 +273,6 @@ TEST_F(BandwidthEndToEndTest, ReportsSetEncoderRates) {
task_queue_(task_queue), task_queue_(task_queue),
send_stream_(nullptr), send_stream_(nullptr),
encoder_factory_(this), encoder_factory_(this),
bitrate_allocator_factory_(
CreateBuiltinVideoBitrateAllocatorFactory()),
bitrate_kbps_(0) {} bitrate_kbps_(0) {}
void OnVideoStreamsCreated( void OnVideoStreamsCreated(
@ -289,8 +286,6 @@ TEST_F(BandwidthEndToEndTest, ReportsSetEncoderRates) {
std::vector<VideoReceiveStream::Config>* receive_configs, std::vector<VideoReceiveStream::Config>* receive_configs,
VideoEncoderConfig* encoder_config) override { VideoEncoderConfig* encoder_config) override {
send_config->encoder_settings.encoder_factory = &encoder_factory_; send_config->encoder_settings.encoder_factory = &encoder_factory_;
send_config->encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
RTC_DCHECK_EQ(1, encoder_config->number_of_streams); RTC_DCHECK_EQ(1, encoder_config->number_of_streams);
} }
@ -349,7 +344,6 @@ TEST_F(BandwidthEndToEndTest, ReportsSetEncoderRates) {
rtc::CriticalSection crit_; rtc::CriticalSection crit_;
VideoSendStream* send_stream_; VideoSendStream* send_stream_;
test::VideoEncoderProxyFactory encoder_factory_; test::VideoEncoderProxyFactory encoder_factory_;
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
uint32_t bitrate_kbps_ RTC_GUARDED_BY(crit_); uint32_t bitrate_kbps_ RTC_GUARDED_BY(crit_);
} test(&task_queue_); } test(&task_queue_);

View File

@ -16,7 +16,6 @@
#include "api/test/simulated_network.h" #include "api/test/simulated_network.h"
#include "api/test/video/function_video_encoder_factory.h" #include "api/test/video/function_video_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h" #include "call/fake_network_pipe.h"
#include "call/simulated_network.h" #include "call/simulated_network.h"
#include "logging/rtc_event_log/rtc_event_log.h" #include "logging/rtc_event_log/rtc_event_log.h"
@ -55,8 +54,6 @@ void MultiStreamTester::RunTest() {
test::FrameGeneratorCapturer* frame_generators[kNumStreams]; test::FrameGeneratorCapturer* frame_generators[kNumStreams];
test::FunctionVideoEncoderFactory encoder_factory( test::FunctionVideoEncoderFactory encoder_factory(
[]() { return VP8Encoder::Create(); }); []() { return VP8Encoder::Create(); });
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory =
CreateBuiltinVideoBitrateAllocatorFactory();
InternalDecoderFactory decoder_factory; InternalDecoderFactory decoder_factory;
task_queue_->SendTask([&]() { task_queue_->SendTask([&]() {
@ -78,8 +75,6 @@ void MultiStreamTester::RunTest() {
VideoSendStream::Config send_config(sender_transport.get()); VideoSendStream::Config send_config(sender_transport.get());
send_config.rtp.ssrcs.push_back(ssrc); send_config.rtp.ssrcs.push_back(ssrc);
send_config.encoder_settings.encoder_factory = &encoder_factory; send_config.encoder_settings.encoder_factory = &encoder_factory;
send_config.encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory.get();
send_config.rtp.payload_name = "VP8"; send_config.rtp.payload_name = "VP8";
send_config.rtp.payload_type = kVideoPayloadType; send_config.rtp.payload_type = kVideoPayloadType;
VideoEncoderConfig encoder_config; VideoEncoderConfig encoder_config;

View File

@ -16,7 +16,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h" #include "call/fake_network_pipe.h"
#include "call/simulated_network.h" #include "call/simulated_network.h"
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h" #include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
@ -284,8 +283,6 @@ VideoQualityTest::VideoQualityTest(
[this](const SdpVideoFormat& format) { [this](const SdpVideoFormat& format) {
return this->CreateVideoEncoder(format, analyzer_.get()); return this->CreateVideoEncoder(format, analyzer_.get());
}), }),
video_bitrate_allocator_factory_(
CreateBuiltinVideoBitrateAllocatorFactory()),
receive_logs_(0), receive_logs_(0),
send_logs_(0), send_logs_(0),
injection_components_(std::move(injection_components)) { injection_components_(std::move(injection_components)) {
@ -616,8 +613,6 @@ void VideoQualityTest::SetupVideo(Transport* send_transport,
video_send_configs_[video_idx].encoder_settings.encoder_factory = video_send_configs_[video_idx].encoder_settings.encoder_factory =
(video_idx == 0) ? &video_encoder_factory_with_analyzer_ (video_idx == 0) ? &video_encoder_factory_with_analyzer_
: &video_encoder_factory_; : &video_encoder_factory_;
video_send_configs_[video_idx].encoder_settings.bitrate_allocator_factory =
video_bitrate_allocator_factory_.get();
video_send_configs_[video_idx].rtp.payload_name = video_send_configs_[video_idx].rtp.payload_name =
params_.video[video_idx].codec; params_.video[video_idx].codec;
@ -806,8 +801,6 @@ void VideoQualityTest::SetupThumbnails(Transport* send_transport,
// TODO(nisse): Could use a simpler VP8-only encoder factory. // TODO(nisse): Could use a simpler VP8-only encoder factory.
thumbnail_send_config.encoder_settings.encoder_factory = thumbnail_send_config.encoder_settings.encoder_factory =
&video_encoder_factory_; &video_encoder_factory_;
thumbnail_send_config.encoder_settings.bitrate_allocator_factory =
video_bitrate_allocator_factory_.get();
thumbnail_send_config.rtp.payload_name = params_.video[0].codec; thumbnail_send_config.rtp.payload_name = params_.video[0].codec;
thumbnail_send_config.rtp.payload_type = kPayloadTypeVP8; thumbnail_send_config.rtp.payload_type = kPayloadTypeVP8;
thumbnail_send_config.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; thumbnail_send_config.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;

View File

@ -17,7 +17,6 @@
#include "api/fec_controller.h" #include "api/fec_controller.h"
#include "api/test/video_quality_test_fixture.h" #include "api/test/video_quality_test_fixture.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h" #include "call/fake_network_pipe.h"
#include "media/engine/internaldecoderfactory.h" #include "media/engine/internaldecoderfactory.h"
#include "media/engine/internalencoderfactory.h" #include "media/engine/internalencoderfactory.h"
@ -106,8 +105,6 @@ class VideoQualityTest :
InternalDecoderFactory internal_decoder_factory_; InternalDecoderFactory internal_decoder_factory_;
test::FunctionVideoEncoderFactory video_encoder_factory_; test::FunctionVideoEncoderFactory video_encoder_factory_;
test::FunctionVideoEncoderFactory video_encoder_factory_with_analyzer_; test::FunctionVideoEncoderFactory video_encoder_factory_with_analyzer_;
std::unique_ptr<VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory_;
InternalEncoderFactory internal_encoder_factory_; InternalEncoderFactory internal_encoder_factory_;
std::vector<VideoSendStream::Config> thumbnail_send_configs_; std::vector<VideoSendStream::Config> thumbnail_send_configs_;
std::vector<VideoEncoderConfig> thumbnail_encoder_configs_; std::vector<VideoEncoderConfig> thumbnail_encoder_configs_;

View File

@ -78,7 +78,6 @@ VideoSendStream::VideoSendStream(
config_(std::move(config)), config_(std::move(config)),
content_type_(encoder_config.content_type) { content_type_(encoder_config.content_type) {
RTC_DCHECK(config_.encoder_settings.encoder_factory); RTC_DCHECK(config_.encoder_settings.encoder_factory);
RTC_DCHECK(config_.encoder_settings.bitrate_allocator_factory);
video_stream_encoder_ = CreateVideoStreamEncoder(num_cpu_cores, &stats_proxy_, video_stream_encoder_ = CreateVideoStreamEncoder(num_cpu_cores, &stats_proxy_,
config_.encoder_settings, config_.encoder_settings,

View File

@ -17,8 +17,6 @@
#include "api/video/encoded_image.h" #include "api/video/encoded_image.h"
#include "api/video/i420_buffer.h" #include "api/video/i420_buffer.h"
#include "api/video/video_bitrate_allocator_factory.h"
#include "common_video/include/video_frame.h"
#include "modules/video_coding/include/video_codec_initializer.h" #include "modules/video_coding/include/video_codec_initializer.h"
#include "modules/video_coding/include/video_coding.h" #include "modules/video_coding/include/video_coding.h"
#include "rtc_base/arraysize.h" #include "rtc_base/arraysize.h"
@ -536,14 +534,11 @@ void VideoStreamEncoder::ReconfigureEncoder() {
crop_height_ = last_frame_info_->height - highest_stream_height; crop_height_ = last_frame_info_->height - highest_stream_height;
VideoCodec codec; VideoCodec codec;
if (!VideoCodecInitializer::SetupCodec(encoder_config_, streams, &codec)) { if (!VideoCodecInitializer::SetupCodec(encoder_config_, streams, &codec,
&rate_allocator_)) {
RTC_LOG(LS_ERROR) << "Failed to create encoder configuration."; RTC_LOG(LS_ERROR) << "Failed to create encoder configuration.";
} }
rate_allocator_ =
settings_.bitrate_allocator_factory->CreateVideoBitrateAllocator(codec);
RTC_CHECK(rate_allocator_) << "Failed to create bitrate allocator.";
// Set min_bitrate_bps, max_bitrate_bps, and max padding bit rate for VP9. // Set min_bitrate_bps, max_bitrate_bps, and max padding bit rate for VP9.
if (encoder_config_.codec_type == kVideoCodecVP9) { if (encoder_config_.codec_type == kVideoCodecVP9) {
RTC_DCHECK_EQ(1U, streams.size()); RTC_DCHECK_EQ(1U, streams.size());

View File

@ -14,7 +14,6 @@
#include <limits> #include <limits>
#include <utility> #include <utility>
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/i420_buffer.h" #include "api/video/i420_buffer.h"
#include "api/video_codecs/create_vp8_temporal_layers.h" #include "api/video_codecs/create_vp8_temporal_layers.h"
#include "api/video_codecs/vp8_temporal_layers.h" #include "api/video_codecs/vp8_temporal_layers.h"
@ -280,7 +279,6 @@ class VideoStreamEncoderTest : public ::testing::Test {
max_framerate_(kDefaultFramerate), max_framerate_(kDefaultFramerate),
fake_encoder_(), fake_encoder_(),
encoder_factory_(&fake_encoder_), encoder_factory_(&fake_encoder_),
bitrate_allocator_factory_(CreateBuiltinVideoBitrateAllocatorFactory()),
stats_proxy_(new MockableSendStatisticsProxy( stats_proxy_(new MockableSendStatisticsProxy(
Clock::GetRealTimeClock(), Clock::GetRealTimeClock(),
video_send_config_, video_send_config_,
@ -291,8 +289,6 @@ class VideoStreamEncoderTest : public ::testing::Test {
metrics::Reset(); metrics::Reset();
video_send_config_ = VideoSendStream::Config(nullptr); video_send_config_ = VideoSendStream::Config(nullptr);
video_send_config_.encoder_settings.encoder_factory = &encoder_factory_; video_send_config_.encoder_settings.encoder_factory = &encoder_factory_;
video_send_config_.encoder_settings.bitrate_allocator_factory =
bitrate_allocator_factory_.get();
video_send_config_.rtp.payload_name = "FAKE"; video_send_config_.rtp.payload_name = "FAKE";
video_send_config_.rtp.payload_type = 125; video_send_config_.rtp.payload_type = 125;
@ -699,7 +695,6 @@ class VideoStreamEncoderTest : public ::testing::Test {
int max_framerate_; int max_framerate_;
TestEncoder fake_encoder_; TestEncoder fake_encoder_;
test::VideoEncoderProxyFactory encoder_factory_; test::VideoEncoderProxyFactory encoder_factory_;
std::unique_ptr<VideoBitrateAllocatorFactory> bitrate_allocator_factory_;
std::unique_ptr<MockableSendStatisticsProxy> stats_proxy_; std::unique_ptr<MockableSendStatisticsProxy> stats_proxy_;
TestSink sink_; TestSink sink_;
AdaptingFrameForwarder video_source_; AdaptingFrameForwarder video_source_;