Video encoding: allow to use system OpenH264

OpenH264 cannot be usually used everywhere as it's proprietary and for
that reason it's usually disabled or apps using it are not allowed to be
available in default installations. Using system OpenH264  option allows
us to use e.g. noopenH264, that can be present in default installations
and later replaced by OpenH264 installed from 3rd party repository.

Bug: webrtc:14717
Change-Id: I015aacdb48c0636935f611459f0c9a6aa74a8f94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349301
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Jan Grulich <grulja@gmail.com>
Cr-Commit-Position: refs/heads/main@{#42509}
This commit is contained in:
Jan Grulich 2024-04-29 16:16:28 +02:00 committed by WebRTC LUCI CQ
parent 578905e7ca
commit 0f862520dc
2 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,7 @@
# in the file PATENTS. All contributing project authors may # in the file PATENTS. All contributing project authors may
# 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.
import("//build/config/linux/pkg_config.gni")
import("//third_party/libaom/options.gni") import("//third_party/libaom/options.gni")
import("../../webrtc.gni") import("../../webrtc.gni")
@ -366,6 +367,12 @@ rtc_source_set("codec_globals_headers") {
deps = [ "../../rtc_base:checks" ] deps = [ "../../rtc_base:checks" ]
} }
if (rtc_use_h264 && rtc_system_openh264) {
pkg_config("openh264") {
packages = [ "openh264" ]
}
}
rtc_library("video_coding_utility") { rtc_library("video_coding_utility") {
visibility = [ "*" ] visibility = [ "*" ]
sources = [ sources = [
@ -488,10 +495,12 @@ rtc_library("webrtc_h264") {
] ]
if (rtc_use_h264) { if (rtc_use_h264) {
deps += [ deps += [ "//third_party/ffmpeg" ]
"//third_party/ffmpeg", if (rtc_system_openh264) {
"//third_party/openh264:encoder", configs += [ ":openh264" ]
] } else {
deps += [ "//third_party/openh264:encoder" ]
}
if (!build_with_mozilla) { if (!build_with_mozilla) {
deps += [ "../../media:rtc_media_base" ] deps += [ "../../media:rtc_media_base" ]
} }

View File

@ -190,6 +190,9 @@ declare_args() {
rtc_use_h264 = rtc_use_h264 =
proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang) proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang)
# Use system OpenH264
rtc_system_openh264 = false
# Enable to use H265 # Enable to use H265
if (build_with_chromium) { if (build_with_chromium) {
rtc_use_h265 = enable_hevc_parser_and_hw_decoder rtc_use_h265 = enable_hevc_parser_and_hw_decoder