blob: 3007574e3eb93e101d885e798b95a71c61f323ca [file] [log] [blame]
Dan Albert2975a242016-09-23 16:17:45 -07001// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Headers module is in frameworks/av/Android.bp because modules are not allowed
16// to refer to headers in parent directories and the headers live in
17// frameworks/av/include.
18
Bob Badour56786ac2021-02-25 15:24:36 -080019package {
20 default_applicable_licenses: ["frameworks_av_media_ndk_license"],
21}
22
23// Added automatically by a large-scale-change that took the approach of
24// 'apply every license found to every target'. While this makes sure we respect
25// every license restriction, it may not be entirely correct.
26//
27// e.g. GPL in an MIT project might only apply to the contrib/ directory.
28//
29// Please consider splitting the single license below into multiple licenses,
30// taking care not to lose any license_kind information, and overriding the
31// default license using the 'licenses: [...]' property on targets as needed.
32//
33// For unused files, consider creating a 'fileGroup' with "//visibility:private"
34// to attach the license to, and including a comment whether the files may be
35// used in the current project.
36// See: http://go/android-license-faq
37license {
38 name: "frameworks_av_media_ndk_license",
39 visibility: [":__subpackages__"],
40 license_kinds: [
41 "SPDX-license-identifier-Apache-2.0",
42 "SPDX-license-identifier-MIT",
43 "SPDX-license-identifier-Unicode-DFS",
44 ],
45 license_text: [
46 "NOTICE",
47 ],
48}
49
Dan Albert2975a242016-09-23 16:17:45 -070050ndk_library {
Dan Willemsen2c885592017-04-07 15:48:32 -070051 name: "libmediandk",
Dan Albert2975a242016-09-23 16:17:45 -070052 symbol_file: "libmediandk.map.txt",
53 first_version: "21",
Dan Albert1714f2e2017-01-05 16:00:15 -080054 unversioned_until: "current",
Dan Albert2975a242016-09-23 16:17:45 -070055}
Colin Cross7e8d4ba2017-05-04 16:17:42 -070056
57ndk_headers {
58 name: "libmediandk_headers",
59 from: "include/media",
60 to: "media",
61 srcs: ["include/media/**/*.h"],
62 license: "NOTICE",
63}
Colin Cross3f4c0df2017-05-04 16:19:06 -070064
Marco Nelissen5dcf85a2018-10-11 09:49:02 -070065// for use with header_libs
66cc_library_headers {
67 name: "media_ndk_headers",
68 vendor_available: true,
Victor Khimenko09879292020-07-02 23:49:09 +020069 // TODO(b/153609531): remove when no longer needed.
70 native_bridge_supported: true,
Jooyung Han5e8fecc2020-05-22 00:42:12 +090071 apex_available: [
72 "//apex_available:platform",
73 "com.android.media",
74 "com.android.media.swcodec",
75 ],
76 min_sdk_version: "29",
S Vasudev Prasadebbc3232020-03-13 15:59:32 +053077 export_include_dirs: ["include"],
78 host_supported: true,
79 target: {
80 darwin: {
81 enabled: false,
82 },
83 },
Marco Nelissen5dcf85a2018-10-11 09:49:02 -070084}
85
Colin Cross3f4c0df2017-05-04 16:19:06 -070086cc_library_shared {
87 name: "libmediandk",
Colin Cross9b0f94a2020-10-19 13:37:55 -070088 llndk_stubs: "libmediandk.llndk",
Colin Cross3f4c0df2017-05-04 16:19:06 -070089
90 srcs: [
Dichen Zhang52a243e2019-11-08 11:02:03 -080091 "NdkJavaVMHelper.cpp",
Colin Cross3f4c0df2017-05-04 16:19:06 -070092 "NdkMediaCodec.cpp",
93 "NdkMediaCrypto.cpp",
Robert Shih0df451b2017-12-08 14:16:50 -080094 "NdkMediaDataSource.cpp",
Colin Cross3f4c0df2017-05-04 16:19:06 -070095 "NdkMediaExtractor.cpp",
96 "NdkMediaFormat.cpp",
97 "NdkMediaMuxer.cpp",
98 "NdkMediaDrm.cpp",
99 "NdkImage.cpp",
100 "NdkImageReader.cpp",
101 ],
102
103 include_dirs: [
Colin Cross3f4c0df2017-05-04 16:19:06 -0700104 "frameworks/base/core/jni",
105 "frameworks/native/include/media/openmax",
106 "system/media/camera/include",
107 ],
108
109 cflags: [
Colin Cross3f4c0df2017-05-04 16:19:06 -0700110 "-DEXPORT=__attribute__((visibility(\"default\")))",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700111 "-Werror",
112 "-Wall",
113 ],
114
115 static_libs: [
116 "libgrallocusage",
Orion Hodson23a214b2021-02-08 16:12:37 +0000117 "libnativehelper_lazy",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700118 ],
119
Marco Nelissen55b259c2019-09-27 10:21:55 -0700120 header_libs: [
Orion Hodsond3fd1ae2020-04-03 09:42:02 +0100121 "jni_headers",
Marco Nelissen55b259c2019-09-27 10:21:55 -0700122 "libmediadrm_headers",
Marco Nelissen7c96ea72020-01-10 15:46:22 -0800123 "libmediametrics_headers",
Marco Nelissen55b259c2019-09-27 10:21:55 -0700124 ],
125
Colin Cross3f4c0df2017-05-04 16:19:06 -0700126 shared_libs: [
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700127 "android.hardware.graphics.bufferqueue@1.0",
128 "android.hidl.token@1.0-utils",
Jooyung Hanf92acc72019-03-07 17:43:25 +0900129 "libandroid_runtime_lazy",
John W. Bruce9c4e0fa2019-05-03 17:12:44 -0700130 "libbase",
Marco Nelissenfa8be7d2019-09-23 12:15:57 -0700131 "libdatasource",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700132 "libmedia",
Marco Nelissen55b259c2019-09-27 10:21:55 -0700133 "libmediadrm",
Jae Shin8568cb92017-10-30 11:13:36 +0900134 "libmedia_omx",
Jooyung Han92f64622019-02-22 16:19:46 +0900135 "libmedia_jni_utils",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700136 "libstagefright",
137 "libstagefright_foundation",
138 "liblog",
139 "libutils",
140 "libcutils",
Jooyung Hanc34e4532019-02-21 11:34:07 +0900141 "libnativewindow",
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700142 "libhidlbase",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700143 "libgui",
144 "libui",
Robert Shih2568eb92018-09-19 10:00:46 -0700145 "libmediandk_utils",
Colin Cross3f4c0df2017-05-04 16:19:06 -0700146 ],
147
Orion Hodsond3fd1ae2020-04-03 09:42:02 +0100148 export_header_lib_headers: ["jni_headers"],
149
Chong Zhangefd1c5c2020-11-18 10:33:13 -0800150 export_include_dirs: [
151 "include",
152 "include_platform",
153 ],
Colin Cross3f4c0df2017-05-04 16:19:06 -0700154
Pawin Vongmasa48616152019-02-21 06:28:10 -0800155 export_shared_lib_headers: [
156 "libgui",
157 ],
158
Colin Cross3f4c0df2017-05-04 16:19:06 -0700159 product_variables: {
160 pdk: {
161 enabled: false,
162 },
163 },
dimitryb8aca872018-12-04 15:58:40 +0100164 version_script: "libmediandk.map.txt",
Dongwon Kang33d25352018-12-12 13:36:43 +0000165 stubs: {
166 symbol_file: "libmediandk.map.txt",
167 versions: ["29"],
168 },
Colin Cross3f4c0df2017-05-04 16:19:06 -0700169}
Jiyong Parka88ef502017-08-10 20:12:24 +0900170
171llndk_library {
Colin Cross9b0f94a2020-10-19 13:37:55 -0700172 name: "libmediandk.llndk",
Jiyong Parka88ef502017-08-10 20:12:24 +0900173 symbol_file: "libmediandk.map.txt",
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700174 export_include_dirs: [
175 "include",
176 ],
Jiyong Parka88ef502017-08-10 20:12:24 +0900177}
Robert Shih2568eb92018-09-19 10:00:46 -0700178
179cc_library {
180 name: "libmediandk_utils",
181
182 srcs: [
183 "NdkMediaDataSourceCallbacks.cpp",
184 ],
185
186 include_dirs: [
187 "frameworks/av/media/libstagefright/include",
188 "frameworks/av/media/ndk/include",
189 ],
190
191 export_include_dirs: [
192 "include",
193 ],
194
195 cflags: [
196 "-Werror",
197 "-Wno-error=deprecated-declarations",
198 "-Wall",
199 ],
200
Marco Nelissen6b285942019-10-21 14:52:30 -0700201 header_libs: [
202 "libmedia_headers",
203 ],
204
Robert Shih2568eb92018-09-19 10:00:46 -0700205 shared_libs: [
Robert Shih2568eb92018-09-19 10:00:46 -0700206 ],
207
208 sanitize: {
209 misc_undefined: [
210 "unsigned-integer-overflow",
211 "signed-integer-overflow",
212 ],
213 cfi: true,
Robert Shih2568eb92018-09-19 10:00:46 -0700214 },
215}
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700216
217cc_test {
218 name: "AImageReaderWindowHandleTest",
Ray Essickf867ca72020-04-29 19:41:08 -0700219 test_suites: ["device-tests"],
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700220 srcs: ["tests/AImageReaderWindowHandleTest.cpp"],
221 shared_libs: [
222 "libbinder",
223 "libmediandk",
Jayant Chowdhary32b4f492018-11-14 18:38:21 -0800224 "libmediautils",
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700225 "libnativewindow",
226 "libgui",
227 "libutils",
228 "libui",
229 "libcutils",
230 "android.hardware.graphics.bufferqueue@1.0",
231 ],
Marco Nelissena51151a2020-01-07 13:37:47 -0800232 header_libs: [
233 "libstagefright_foundation_headers",
234 ],
235
Jayant Chowdhary249e1f22018-09-24 15:07:45 -0700236 cflags: [
237 "-D__ANDROID_VNDK__",
238 ],
239 include_dirs: [
240 "frameworks/av/media/ndk/",
241 ],
242}
S Vasudev Prasadaf62b862020-04-22 16:10:05 +0530243
244cc_library_static {
245 name: "libmediandk_format",
246
247 host_supported: true,
248
249 srcs: [
250 "NdkMediaFormat.cpp",
251 ],
252
253 header_libs: [
254 "libstagefright_foundation_headers",
255 ],
256
257 cflags: [
258 "-DEXPORT=__attribute__((visibility(\"default\")))",
259 "-Werror",
260 "-Wall",
261 ],
262
263 export_include_dirs: ["include"],
264
265 sanitize: {
266 misc_undefined: [
267 "unsigned-integer-overflow",
268 "signed-integer-overflow",
269 ],
270 cfi: true,
271 },
272
273 target: {
274 darwin: {
275 enabled: false,
276 },
277 },
278
Ray Essick19042f12021-02-12 14:45:16 -0800279 apex_available: [
280 "//apex_available:platform",
281 "com.android.media",
282 "com.android.media.swcodec",
283 ],
S Vasudev Prasadaf62b862020-04-22 16:10:05 +0530284}