Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import("//third_party/openh264/openh264.gni") | |
| 6 import("//third_party/openh264/openh264_args.gni") | |
| 7 | |
| 8 if (use_openh264) { | |
| 9 # Config shared by all openh264 targets. | |
| 10 config("openh264_config") { | |
| 11 cflags = [] | |
| 12 defines = [] | |
| 13 | |
| 14 # Compiler warnings to ignore. | |
| 15 if (!is_win) { | |
| 16 # GCC flags | |
| 17 cflags += [ | |
| 18 "-Wno-header-hygiene", | |
| 19 "-Wno-unused-value", | |
| 20 ] | |
| 21 } | |
| 22 | |
| 23 # Platform-specific defines. | |
| 24 if (is_android) { | |
| 25 defines += [ "ANDROID_NDK" ] | |
| 26 } | |
| 27 | |
| 28 # Workaround relating to the VERSION_NUMBER macro in version.h. | |
| 29 # TODO(hbos): Fix cause of the issue instead of this workaround. | |
| 30 if (!is_android) { | |
| 31 # On some builds VERSION_NUMBER is not defined when including version.h | |
| 32 # (probably another file is included named version.h, I have not been able | |
| 33 # to reproduce the problem on a local machine). Since the macro is only | |
| 34 # used for debug printing in wels[En/De]coderExt.cpp we can get around the | |
| 35 # undeclared identifier error by giving it a default value ourselves. | |
| 36 defines += [ "VERSION_NUMBER=\"openh264 v.?.?\"" ] | |
| 37 | |
| 38 # For other builds we end up with a macro redefinition and have to | |
| 39 # suppress the macro redefined warning. Suppressing it does not work on | |
| 40 # android, but that's OK because we do not have the version.h problem on | |
| 41 # android, thus the if (!is_android) above. | |
| 42 if (!is_win) { | |
| 43 # GCC flags | |
| 44 cflags += [ "-Wno-macro-redefined" ] | |
| 45 } else { | |
| 46 # MSVC flags | |
| 47 cflags += [ "/wd4005" ] # macro redefinition | |
| 48 } | |
| 49 } | |
| 50 } | |
| 51 | |
| 52 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.
| |
| 53 deps = [] | |
| 54 if (is_android) { | |
| 55 deps += [ | |
| 56 # Defines "android_get/setCpu..." functions. The original OpenH264 build | |
| 57 # files replaces these using macros for "wels_..." versions of the same | |
| 58 # functions. We do not have access to these and use the <cpu-features.h> | |
| 59 # ones instead. | |
| 60 "//third_party/android_tools:cpu_features", | |
| 61 ] | |
| 62 } | |
| 63 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 64 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 65 configs += [ ":openh264_config" ] | |
| 66 include_dirs = [ | |
| 67 "src/codec/api/svc", | |
| 68 "src/codec/common/inc", | |
| 69 "src/codec/common/src", | |
| 70 ] | |
| 71 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.
| |
| 72 } | |
| 73 | |
| 74 static_library("openh264_processing") { | |
| 75 deps = [ | |
| 76 ":openh264_common", | |
| 77 ] | |
| 78 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 79 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 80 configs += [ ":openh264_config" ] | |
| 81 include_dirs = [ | |
| 82 "src/codec/api/svc", | |
| 83 "src/codec/common/inc", | |
| 84 "src/codec/common/src", | |
| 85 "src/codec/processing/interface", | |
| 86 "src/codec/processing/interface/", | |
| 87 "src/codec/processing/src/adaptivequantization", | |
| 88 "src/codec/processing/src/backgrounddetection", | |
| 89 "src/codec/processing/src/common", | |
| 90 "src/codec/processing/src/complexityanalysis", | |
| 91 "src/codec/processing/src/denoise", | |
| 92 "src/codec/processing/src/downsample", | |
| 93 "src/codec/processing/src/imagerotate", | |
| 94 "src/codec/processing/src/scenechangedetection", | |
| 95 "src/codec/processing/src/scrolldetection", | |
| 96 "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
| |
| 97 ] | |
| 98 sources = openh264_processing_sources | |
| 99 } | |
| 100 | |
| 101 static_library("openh264_encoder") { | |
| 102 deps = [ | |
| 103 ":openh264_common", | |
| 104 ":openh264_processing", | |
| 105 ] | |
| 106 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 107 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 108 configs += [ ":openh264_config" ] | |
| 109 include_dirs = [ | |
| 110 "src/codec/api/svc", | |
| 111 "src/codec/common/inc", | |
| 112 "src/codec/common/src", | |
| 113 "src/codec/encoder/core/inc", | |
| 114 "src/codec/encoder/core/src", | |
| 115 "src/codec/encoder/plus/inc", | |
| 116 "src/codec/encoder/plus/src", | |
| 117 "src/codec/processing/interface/", | |
| 118 ] | |
| 119 sources = openh264_encoder_sources | |
| 120 } | |
| 121 | |
| 122 static_library("openh264_decoder") { | |
| 123 deps = [ | |
| 124 ":openh264_common", | |
| 125 ":openh264_processing", | |
| 126 ] | |
| 127 defines = [ | |
| 128 # Disables decoder_core.cpp debug prints. | |
| 129 "CODEC_FOR_TESTBED", | |
| 130 ] | |
| 131 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 132 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 133 configs += [ ":openh264_config" ] | |
| 134 include_dirs = [ | |
| 135 "src/codec/api/svc", | |
| 136 "src/codec/common/inc", | |
| 137 "src/codec/common/src", | |
| 138 "src/codec/decoder/core/inc", | |
| 139 "src/codec/decoder/core/src", | |
| 140 "src/codec/decoder/plus/inc", | |
| 141 "src/codec/decoder/plus/src", | |
| 142 "src/codec/processing/interface/", | |
| 143 ] | |
| 144 sources = openh264_decoder_sources | |
| 145 } | |
| 146 } | |
| OLD | NEW |