Enable building WebRTC without built-in software codecs
This CL adds a GN build flag to include builtin software codecs (enabled by default). When setting the flag to false, libvpx can also be excluded. The benefit is that the resulting binary is smaller. Replaces https://webrtc-review.googlesource.com/c/src/+/29203 Bug: webrtc:7925 Change-Id: Id330ea8a43169e449ee139eca18e4557cc932e10 Reviewed-on: https://webrtc-review.googlesource.com/36340 Commit-Queue: Anders Carlsson <andersc@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21818}
This commit is contained in:
committed by
Commit Bot
parent
70294c8eab
commit
dd8c16574e
@ -10,6 +10,8 @@ import("../../webrtc.gni")
|
||||
|
||||
rtc_static_library("video_coding") {
|
||||
visibility = [ "*" ]
|
||||
deps = []
|
||||
|
||||
sources = [
|
||||
"codec_database.cc",
|
||||
"codec_database.h",
|
||||
@ -88,16 +90,20 @@ rtc_static_library("video_coding") {
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
if (rtc_use_builtin_sw_codecs) {
|
||||
deps += [
|
||||
":webrtc_i420",
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp9",
|
||||
]
|
||||
}
|
||||
|
||||
deps += [
|
||||
":codec_globals_headers",
|
||||
":video_codec_interface",
|
||||
":video_coding_utility",
|
||||
":webrtc_h264",
|
||||
":webrtc_i420",
|
||||
":webrtc_multiplex",
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp8_helpers",
|
||||
":webrtc_vp9",
|
||||
"..:module_api",
|
||||
"..:module_api_public",
|
||||
"../..:webrtc_common",
|
||||
@ -320,31 +326,7 @@ rtc_static_library("webrtc_multiplex") {
|
||||
}
|
||||
|
||||
# This target includes VP8 files that may be used for any VP8 codec, internal SW or external HW.
|
||||
rtc_source_set("webrtc_vp8_helpers") {
|
||||
sources = [
|
||||
"codecs/vp8/include/vp8_common_types.h",
|
||||
"codecs/vp8/screenshare_layers.h",
|
||||
"codecs/vp8/simulcast_rate_allocator.h",
|
||||
"codecs/vp8/temporal_layers.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":video_coding_utility",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial_api",
|
||||
"../../system_wrappers:metrics_api",
|
||||
]
|
||||
}
|
||||
|
||||
# This target includes the internal SW codec.
|
||||
rtc_static_library("webrtc_vp8") {
|
||||
rtc_static_library("webrtc_vp8_helpers") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
"codecs/vp8/default_temporal_layers.cc",
|
||||
@ -352,8 +334,47 @@ rtc_static_library("webrtc_vp8") {
|
||||
"codecs/vp8/include/vp8.h",
|
||||
"codecs/vp8/include/vp8_common_types.h",
|
||||
"codecs/vp8/screenshare_layers.cc",
|
||||
"codecs/vp8/screenshare_layers.h",
|
||||
"codecs/vp8/simulcast_rate_allocator.cc",
|
||||
"codecs/vp8/simulcast_rate_allocator.h",
|
||||
"codecs/vp8/temporal_layers.cc",
|
||||
"codecs/vp8/temporal_layers.h",
|
||||
]
|
||||
|
||||
# TODO(jschuh): Bug 1348: fix this warning.
|
||||
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":video_codec_interface",
|
||||
":video_coding_utility",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api:video_frame_api",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_numerics",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial_api",
|
||||
"../../system_wrappers:metrics_api",
|
||||
"//third_party/libyuv",
|
||||
]
|
||||
}
|
||||
|
||||
# This target includes the internal SW codec.
|
||||
rtc_static_library("webrtc_vp8") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
"codecs/vp8/include/vp8.h",
|
||||
"codecs/vp8/include/vp8_common_types.h",
|
||||
"codecs/vp8/vp8_impl.cc",
|
||||
"codecs/vp8/vp8_impl.h",
|
||||
]
|
||||
@ -375,6 +396,7 @@ rtc_static_library("webrtc_vp8") {
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api:video_frame_api",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
@ -468,7 +490,6 @@ if (rtc_include_tests) {
|
||||
":mock_headers",
|
||||
":video_codec_interface",
|
||||
":video_coding",
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp8_helpers",
|
||||
"../../api:video_frame_api",
|
||||
"../../api:video_frame_api_i420",
|
||||
@ -502,7 +523,6 @@ if (rtc_include_tests) {
|
||||
":video_codec_interface",
|
||||
":video_coding",
|
||||
":video_coding_utility",
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp8_helpers",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
@ -510,7 +530,7 @@ if (rtc_include_tests) {
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video:common_video",
|
||||
"../../media:rtc_internal_video_codecs",
|
||||
"../../media:rtc_audio_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_task_queue",
|
||||
@ -562,7 +582,6 @@ if (rtc_include_tests) {
|
||||
":video_coding_utility",
|
||||
":webrtc_h264",
|
||||
":webrtc_multiplex",
|
||||
":webrtc_vp8",
|
||||
":webrtc_vp8_helpers",
|
||||
":webrtc_vp9",
|
||||
"../..:webrtc_common",
|
||||
@ -576,6 +595,7 @@ if (rtc_include_tests) {
|
||||
"../../media:rtc_h264_profile_id",
|
||||
"../../media:rtc_internal_video_codecs",
|
||||
"../../media:rtc_media_base",
|
||||
"../../media:rtc_software_fallback_wrappers",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base",
|
||||
"../../rtc_base:rtc_base_tests_utils",
|
||||
|
||||
@ -10,10 +10,13 @@
|
||||
|
||||
#include "modules/video_coding/codec_database.h"
|
||||
|
||||
#if defined(USE_BUILTIN_SW_CODECS)
|
||||
#include "modules/video_coding/codecs/h264/include/h264.h"
|
||||
#include "modules/video_coding/codecs/i420/include/i420.h"
|
||||
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
||||
#include "modules/video_coding/codecs/vp9/include/vp9.h"
|
||||
#include "modules/video_coding/codecs/i420/include/i420.h" // nogncheck
|
||||
#include "modules/video_coding/codecs/vp8/include/vp8.h" // nogncheck
|
||||
#include "modules/video_coding/codecs/vp9/include/vp9.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#include "modules/video_coding/internal_defines.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -24,6 +27,7 @@ const size_t kDefaultPayloadSize = 1440;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
#if defined(USE_BUILTIN_SW_CODECS)
|
||||
// Create an internal Decoder given a codec type
|
||||
static std::unique_ptr<VCMGenericDecoder> CreateDecoder(VideoCodecType type) {
|
||||
switch (type) {
|
||||
@ -48,6 +52,7 @@ static std::unique_ptr<VCMGenericDecoder> CreateDecoder(VideoCodecType type) {
|
||||
RTC_LOG(LS_WARNING) << "No internal decoder of this type exists.";
|
||||
return std::unique_ptr<VCMGenericDecoder>();
|
||||
}
|
||||
#endif
|
||||
|
||||
VCMDecoderMapItem::VCMDecoderMapItem(VideoCodec* settings,
|
||||
int number_of_cores,
|
||||
@ -413,8 +418,12 @@ std::unique_ptr<VCMGenericDecoder> VCMCodecDataBase::CreateAndInitDecoder(
|
||||
ptr_decoder.reset(new VCMGenericDecoder(
|
||||
external_dec_item->external_decoder_instance, true));
|
||||
} else {
|
||||
#if !defined(USE_BUILTIN_SW_CODECS)
|
||||
RTC_LOG(LS_ERROR) << "No decoder of this type exists.";
|
||||
#else
|
||||
// Create decoder.
|
||||
ptr_decoder = CreateDecoder(decoder_item->settings->codecType);
|
||||
#endif
|
||||
}
|
||||
if (!ptr_decoder)
|
||||
return nullptr;
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include "modules/video_coding/include/video_codec_initializer.h"
|
||||
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "common_video/include/video_bitrate_allocator.h"
|
||||
#include "modules/video_coding/codecs/vp8/screenshare_layers.h"
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "common_video/include/video_bitrate_allocator.h"
|
||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "modules/video_coding/codecs/vp8/temporal_layers.h"
|
||||
#include "modules/video_coding/encoded_frame.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
#include "modules/video_coding/utility/default_video_bitrate_allocator.h"
|
||||
|
||||
Reference in New Issue
Block a user