diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-08-11 16:59:55 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-05 17:04:16 +0100 |
commit | d5f10e7a24c7350cf9df4627c459947c27e472a2 (patch) | |
tree | 9a20c0fd59e0310c72624b1d1b63edcf7ad42359 | |
parent | c21aaef3997d242fa6c9d6a5a9ab46469beed245 (diff) | |
download | qtwebengine-chromium-d5f10e7a24c7350cf9df4627c459947c27e472a2.tar.gz |
Optionally unbundle OpenH264
Adds GN logic to use system OpenH264 on Linux.
Change-Id: I2904a45c34e86325e0f6fc77a67c1a204e832556
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | chromium/third_party/openh264/BUILD.gn | 58 | ||||
-rw-r--r-- | chromium/third_party/openh264/openh264_args.gni | 1 |
2 files changed, 53 insertions, 6 deletions
diff --git a/chromium/third_party/openh264/BUILD.gn b/chromium/third_party/openh264/BUILD.gn index 7b9d4588b80..e33b5233b5b 100644 --- a/chromium/third_party/openh264/BUILD.gn +++ b/chromium/third_party/openh264/BUILD.gn @@ -2,7 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/linux/pkg_config.gni") import("//build/config/sanitizers/sanitizers.gni") +import("//build/shim_headers.gni") import("//third_party/openh264/openh264_args.gni") import("//third_party/openh264/openh264_sources.gni") import("//third_party/yasm/yasm_assemble.gni") @@ -101,7 +103,7 @@ if (use_assembler) { } } # if (is_win || is_linux) -source_set("common") { +source_set("bundled_common") { sources = openh264_common_sources include_dirs = openh264_common_include_dirs @@ -124,7 +126,7 @@ source_set("common") { } } -source_set("processing") { +source_set("bundled_processing") { sources = openh264_processing_sources include_dirs = openh264_processing_include_dirs @@ -132,7 +134,7 @@ source_set("processing") { configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ ":config" ] deps = [ - ":common", + ":bundled_common", ] if (use_assembler) { defines = [ "X86_ASM" ] @@ -140,7 +142,7 @@ source_set("processing") { } } -source_set("encoder") { +source_set("bundled_encoder") { sources = openh264_encoder_sources include_dirs = openh264_encoder_include_dirs @@ -154,11 +156,55 @@ source_set("encoder") { configs -= [ "//build/config/clang:extra_warnings" ] } deps = [ - ":common", - ":processing", + ":bundled_common", + ":bundled_processing", ] if (use_assembler) { defines = [ "X86_ASM" ] deps += [ ":openh264_encoder_yasm" ] } } + +if (use_system_openh264) { + pkg_config("system_openh264") { + packages = [ "openh264" ] + } +} + +shim_headers("openh264_shim") { + prefix = "wels/" + root_path = "src/codec/api/svc" + headers = [ + "codec_api.h", + "codec_app_def.h", + "codec_def.h", + "codec_ver.h", + ] +} + +group("common") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_common" ] + } +} + +group("processing") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_processing" ] + } +} + +group("encoder") { + if (use_system_openh264) { + deps = [ ":openh264_shim" ] + public_configs = [ ":system_openh264" ] + } else { + public_deps = [ ":bundled_encoder" ] + } +} diff --git a/chromium/third_party/openh264/openh264_args.gni b/chromium/third_party/openh264/openh264_args.gni index b7558fbd5bf..a1d20380fc3 100644 --- a/chromium/third_party/openh264/openh264_args.gni +++ b/chromium/third_party/openh264/openh264_args.gni @@ -9,4 +9,5 @@ declare_args() { # CHECK THE OPENH264 LICENSE/PATENT BEFORE BUILDING, see # http://www.openh264.org/. use_openh264 = false + use_system_openh264 = false } |