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

Side by Side Diff: third_party/openh264/BUILD.gn

Issue 1403893007: Adding third_party/openh264/src, build files and unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename var to 'use_openh264', add OpenH264 to 'all' target of GN 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 unified diff | Download patch
OLDNEW
(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("//build/config/features.gni")
6 import("//third_party/openh264/openh264.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 "-fvisibility=default",
hbos_chromium 2015/11/16 16:56:29 I should check if this (-fvisiblity=default) is re
19 "-Wno-header-hygiene",
20 "-Wno-unused-value",
21 ]
22 }
23
24 # Platform-specific defines.
25 if (is_android) {
26 defines += [ "ANDROID_NDK" ]
27 }
28
29 # Workaround relating to the VERSION_NUMBER macro in version.h.
torbjorng 2015/11/12 11:02:02 I am not too excited about these workarounds. If i
hbos_chromium 2015/11/16 16:56:29 OpenH264's version.h has include guards, it redefi
30 # TODO(hbos): Fix cause of the issue instead of this workaround.
31 if (!is_android) {
32 # On some builds VERSION_NUMBER is not defined when including version.h
33 # (probably another file is included named version.h, I have not been able
34 # to reproduce the problem on a local machine). Since the macro is only
35 # used for debug printing in wels[En/De]coderExt.cpp we can get around the
36 # undeclared identifier error by giving it a default value ourselves.
37 defines += [ "VERSION_NUMBER=\"openh264 v.?.?\"" ]
38
39 # For other builds we end up with a macro redefinition and have to
40 # suppress the macro redefined warning. Suppressing it does not work on
41 # android, but that's OK because we do not have the version.h problem on
42 # android, thus the if (!is_android) above.
43 if (!is_win) {
44 # GCC flags
45 cflags += [ "-Wno-macro-redefined" ]
46 } else {
47 # MSVC flags
48 cflags += [ "/wd4005" ] # macro redefinition
49 }
50 }
51 }
52
53 static_library("openh264_common") {
54 deps = []
55 if (is_android) {
56 deps += [
57 # Defines "android_get/setCpu..." functions. The original OpenH264 build
58 # files replaces these using macros for "wels_..." versions of the same
59 # functions. We do not have access to these and use the <cpu-features.h>
60 # ones instead.
61 "//third_party/android_tools:cpu_features",
62 ]
63 }
64 configs -= [ "//build/config/compiler:chromium_code" ]
65 configs += [ "//build/config/compiler:no_chromium_code" ]
66 configs += [ ":openh264_config" ]
67 include_dirs = [
68 "src/codec/api/svc",
69 "src/codec/common/inc",
70 "src/codec/common/src",
71 ]
72 sources = openh264_common_sources
73 }
74
75 static_library("openh264_processing") {
76 deps = [
77 ":openh264_common",
78 ]
79 configs -= [ "//build/config/compiler:chromium_code" ]
torbjorng 2015/11/12 11:02:02 I am not good at gn, but perhaps the "configs" man
hbos_chromium 2015/11/16 16:56:29 I don't think that's possible, openh264_common is
80 configs += [ "//build/config/compiler:no_chromium_code" ]
81 configs += [ ":openh264_config" ]
82 include_dirs = [
83 "src/codec/api/svc",
84 "src/codec/common/inc",
85 "src/codec/common/src",
86 "src/codec/processing/interface",
87 "src/codec/processing/interface/",
88 "src/codec/processing/src/adaptivequantization",
89 "src/codec/processing/src/backgrounddetection",
90 "src/codec/processing/src/common",
91 "src/codec/processing/src/complexityanalysis",
92 "src/codec/processing/src/denoise",
93 "src/codec/processing/src/downsample",
94 "src/codec/processing/src/imagerotate",
95 "src/codec/processing/src/scenechangedetection",
96 "src/codec/processing/src/scrolldetection",
97 "src/codec/processing/src/vaacalc",
98 ]
99 sources = openh264_processing_sources
100 }
101
102 static_library("openh264_encoder") {
103 deps = [
104 ":openh264_common",
105 ":openh264_processing",
106 ]
107 configs -= [ "//build/config/compiler:chromium_code" ]
108 configs += [ "//build/config/compiler:no_chromium_code" ]
109 configs += [ ":openh264_config" ]
110 include_dirs = [
111 "src/codec/api/svc",
112 "src/codec/common/inc",
113 "src/codec/common/src",
114 "src/codec/encoder/core/inc",
115 "src/codec/encoder/core/src",
116 "src/codec/encoder/plus/inc",
117 "src/codec/encoder/plus/src",
118 "src/codec/processing/interface/",
119 ]
120 sources = openh264_encoder_sources
121 }
122
123 static_library("openh264_decoder") {
124 deps = [
125 ":openh264_common",
126 ":openh264_processing",
127 ]
128 defines = [
129 # Disables decoder_core.cpp debug prints.
130 "CODEC_FOR_TESTBED",
131 ]
132 configs -= [ "//build/config/compiler:chromium_code" ]
133 configs += [ "//build/config/compiler:no_chromium_code" ]
134 configs += [ ":openh264_config" ]
135 include_dirs = [
136 "src/codec/api/svc",
137 "src/codec/common/inc",
138 "src/codec/common/src",
139 "src/codec/decoder/core/inc",
140 "src/codec/decoder/core/src",
141 "src/codec/decoder/plus/inc",
142 "src/codec/decoder/plus/src",
143 "src/codec/processing/interface/",
144 ]
145 sources = openh264_decoder_sources
146 }
147 }
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | third_party/openh264/DEPS » ('j') | third_party/openh264/buildnotes.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698