Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: third_party/openh264/BUILD.gn

Issue 1446453004: Adding third_party/openh264 build files for encoding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed torbjorng's comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/openh264/BUILD.gn
diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..fd5418570bd78b44f8a1d77663fbda5decd41275
--- /dev/null
+++ b/third_party/openh264/BUILD.gn
@@ -0,0 +1,146 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//third_party/openh264/openh264.gni")
+import("//third_party/openh264/openh264_args.gni")
+
+if (use_openh264) {
+ # Config shared by all openh264 targets.
+ config("openh264_config") {
+ cflags = []
+ defines = []
+
+ # Compiler warnings to ignore.
+ if (!is_win) {
+ # GCC flags
+ cflags += [
+ "-Wno-header-hygiene",
+ "-Wno-unused-value",
+ ]
+ }
+
+ # Platform-specific defines.
+ if (is_android) {
+ defines += [ "ANDROID_NDK" ]
+ }
+
+ # Workaround relating to the VERSION_NUMBER macro in version.h.
+ # TODO(hbos): Fix cause of the issue instead of this workaround.
+ if (!is_android) {
+ # On some builds VERSION_NUMBER is not defined when including version.h
+ # (probably another file is included named version.h, I have not been able
+ # to reproduce the problem on a local machine). Since the macro is only
+ # used for debug printing in wels[En/De]coderExt.cpp we can get around the
+ # undeclared identifier error by giving it a default value ourselves.
+ defines += [ "VERSION_NUMBER=\"openh264 v.?.?\"" ]
+
+ # For other builds we end up with a macro redefinition and have to
+ # suppress the macro redefined warning. Suppressing it does not work on
+ # android, but that's OK because we do not have the version.h problem on
+ # android, thus the if (!is_android) above.
+ if (!is_win) {
+ # GCC flags
+ cflags += [ "-Wno-macro-redefined" ]
+ } else {
+ # MSVC flags
+ cflags += [ "/wd4005" ] # macro redefinition
+ }
+ }
+ }
+
+ static_library("openh264_common") {
Dirk Pranke 2015/11/19 02:46:56 why is this (and the others) a static_library and
hbos_chromium 2015/11/19 13:00:43 source_set makes more sense, changing.
+ deps = []
+ if (is_android) {
+ deps += [
+ # Defines "android_get/setCpu..." functions. The original OpenH264 build
+ # files replaces these using macros for "wels_..." versions of the same
+ # functions. We do not have access to these and use the <cpu-features.h>
+ # ones instead.
+ "//third_party/android_tools:cpu_features",
+ ]
+ }
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":openh264_config" ]
+ include_dirs = [
+ "src/codec/api/svc",
+ "src/codec/common/inc",
+ "src/codec/common/src",
+ ]
+ sources = openh264_common_sources
Dirk Pranke 2015/11/19 02:46:56 Per https://chromium.googlesource.com/chromium/src
hbos_chromium 2015/11/19 13:00:43 Oh! Thanks for the link, updating.
+ }
+
+ static_library("openh264_processing") {
+ deps = [
+ ":openh264_common",
+ ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":openh264_config" ]
+ include_dirs = [
+ "src/codec/api/svc",
+ "src/codec/common/inc",
+ "src/codec/common/src",
+ "src/codec/processing/interface",
+ "src/codec/processing/interface/",
+ "src/codec/processing/src/adaptivequantization",
+ "src/codec/processing/src/backgrounddetection",
+ "src/codec/processing/src/common",
+ "src/codec/processing/src/complexityanalysis",
+ "src/codec/processing/src/denoise",
+ "src/codec/processing/src/downsample",
+ "src/codec/processing/src/imagerotate",
+ "src/codec/processing/src/scenechangedetection",
+ "src/codec/processing/src/scrolldetection",
+ "src/codec/processing/src/vaacalc",
Dirk Pranke 2015/11/19 02:46:56 wow, you really need to list every directory indiv
hbos_chromium 2015/11/19 13:00:43 Yeah it's silly, they include by filename only. Th
+ ]
+ sources = openh264_processing_sources
+ }
+
+ static_library("openh264_encoder") {
+ deps = [
+ ":openh264_common",
+ ":openh264_processing",
+ ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":openh264_config" ]
+ include_dirs = [
+ "src/codec/api/svc",
+ "src/codec/common/inc",
+ "src/codec/common/src",
+ "src/codec/encoder/core/inc",
+ "src/codec/encoder/core/src",
+ "src/codec/encoder/plus/inc",
+ "src/codec/encoder/plus/src",
+ "src/codec/processing/interface/",
+ ]
+ sources = openh264_encoder_sources
+ }
+
+ static_library("openh264_decoder") {
+ deps = [
+ ":openh264_common",
+ ":openh264_processing",
+ ]
+ defines = [
+ # Disables decoder_core.cpp debug prints.
+ "CODEC_FOR_TESTBED",
+ ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":openh264_config" ]
+ include_dirs = [
+ "src/codec/api/svc",
+ "src/codec/common/inc",
+ "src/codec/common/src",
+ "src/codec/decoder/core/inc",
+ "src/codec/decoder/core/src",
+ "src/codec/decoder/plus/inc",
+ "src/codec/decoder/plus/src",
+ "src/codec/processing/interface/",
+ ]
+ sources = openh264_decoder_sources
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698