Dan Albert | 2975a24 | 2016-09-23 16:17:45 -0700 | [diff] [blame] | 1 | // 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 Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 19 | package { |
| 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 |
| 37 | license { |
| 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 Albert | 2975a24 | 2016-09-23 16:17:45 -0700 | [diff] [blame] | 50 | ndk_library { |
Dan Willemsen | 2c88559 | 2017-04-07 15:48:32 -0700 | [diff] [blame] | 51 | name: "libmediandk", |
Dan Albert | 2975a24 | 2016-09-23 16:17:45 -0700 | [diff] [blame] | 52 | symbol_file: "libmediandk.map.txt", |
| 53 | first_version: "21", |
Dan Albert | 1714f2e | 2017-01-05 16:00:15 -0800 | [diff] [blame] | 54 | unversioned_until: "current", |
Dan Albert | 2975a24 | 2016-09-23 16:17:45 -0700 | [diff] [blame] | 55 | } |
Colin Cross | 7e8d4ba | 2017-05-04 16:17:42 -0700 | [diff] [blame] | 56 | |
| 57 | ndk_headers { |
| 58 | name: "libmediandk_headers", |
| 59 | from: "include/media", |
| 60 | to: "media", |
| 61 | srcs: ["include/media/**/*.h"], |
| 62 | license: "NOTICE", |
| 63 | } |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 64 | |
Marco Nelissen | 5dcf85a | 2018-10-11 09:49:02 -0700 | [diff] [blame] | 65 | // for use with header_libs |
| 66 | cc_library_headers { |
| 67 | name: "media_ndk_headers", |
| 68 | vendor_available: true, |
Victor Khimenko | 0987929 | 2020-07-02 23:49:09 +0200 | [diff] [blame] | 69 | // TODO(b/153609531): remove when no longer needed. |
| 70 | native_bridge_supported: true, |
Jooyung Han | 5e8fecc | 2020-05-22 00:42:12 +0900 | [diff] [blame] | 71 | apex_available: [ |
| 72 | "//apex_available:platform", |
| 73 | "com.android.media", |
| 74 | "com.android.media.swcodec", |
| 75 | ], |
| 76 | min_sdk_version: "29", |
S Vasudev Prasad | ebbc323 | 2020-03-13 15:59:32 +0530 | [diff] [blame] | 77 | export_include_dirs: ["include"], |
| 78 | host_supported: true, |
| 79 | target: { |
| 80 | darwin: { |
| 81 | enabled: false, |
| 82 | }, |
| 83 | }, |
Marco Nelissen | 5dcf85a | 2018-10-11 09:49:02 -0700 | [diff] [blame] | 84 | } |
| 85 | |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 86 | cc_library_shared { |
| 87 | name: "libmediandk", |
Colin Cross | fd3c485 | 2021-04-22 16:42:11 -0700 | [diff] [blame] | 88 | llndk: { |
| 89 | symbol_file: "libmediandk.map.txt", |
| 90 | }, |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 91 | |
| 92 | srcs: [ |
Dichen Zhang | 52a243e | 2019-11-08 11:02:03 -0800 | [diff] [blame] | 93 | "NdkJavaVMHelper.cpp", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 94 | "NdkMediaCodec.cpp", |
| 95 | "NdkMediaCrypto.cpp", |
Robert Shih | 0df451b | 2017-12-08 14:16:50 -0800 | [diff] [blame] | 96 | "NdkMediaDataSource.cpp", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 97 | "NdkMediaExtractor.cpp", |
| 98 | "NdkMediaFormat.cpp", |
| 99 | "NdkMediaMuxer.cpp", |
| 100 | "NdkMediaDrm.cpp", |
| 101 | "NdkImage.cpp", |
| 102 | "NdkImageReader.cpp", |
| 103 | ], |
| 104 | |
| 105 | include_dirs: [ |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 106 | "frameworks/base/core/jni", |
| 107 | "frameworks/native/include/media/openmax", |
| 108 | "system/media/camera/include", |
| 109 | ], |
| 110 | |
| 111 | cflags: [ |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 112 | "-DEXPORT=__attribute__((visibility(\"default\")))", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 113 | "-Werror", |
| 114 | "-Wall", |
| 115 | ], |
| 116 | |
| 117 | static_libs: [ |
| 118 | "libgrallocusage", |
Orion Hodson | 23a214b | 2021-02-08 16:12:37 +0000 | [diff] [blame] | 119 | "libnativehelper_lazy", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 120 | ], |
| 121 | |
Marco Nelissen | 55b259c | 2019-09-27 10:21:55 -0700 | [diff] [blame] | 122 | header_libs: [ |
Orion Hodson | d3fd1ae | 2020-04-03 09:42:02 +0100 | [diff] [blame] | 123 | "jni_headers", |
Marco Nelissen | 55b259c | 2019-09-27 10:21:55 -0700 | [diff] [blame] | 124 | "libmediadrm_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 125 | "libmediametrics_headers", |
Marco Nelissen | 55b259c | 2019-09-27 10:21:55 -0700 | [diff] [blame] | 126 | ], |
| 127 | |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 128 | shared_libs: [ |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 129 | "android.hardware.graphics.bufferqueue@1.0", |
| 130 | "android.hidl.token@1.0-utils", |
Jooyung Han | f92acc7 | 2019-03-07 17:43:25 +0900 | [diff] [blame] | 131 | "libandroid_runtime_lazy", |
John W. Bruce | 9c4e0fa | 2019-05-03 17:12:44 -0700 | [diff] [blame] | 132 | "libbase", |
Marco Nelissen | fa8be7d | 2019-09-23 12:15:57 -0700 | [diff] [blame] | 133 | "libdatasource", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 134 | "libmedia", |
Marco Nelissen | 55b259c | 2019-09-27 10:21:55 -0700 | [diff] [blame] | 135 | "libmediadrm", |
Jae Shin | 8568cb9 | 2017-10-30 11:13:36 +0900 | [diff] [blame] | 136 | "libmedia_omx", |
Jooyung Han | 92f6462 | 2019-02-22 16:19:46 +0900 | [diff] [blame] | 137 | "libmedia_jni_utils", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 138 | "libstagefright", |
| 139 | "libstagefright_foundation", |
| 140 | "liblog", |
| 141 | "libutils", |
| 142 | "libcutils", |
Jooyung Han | c34e453 | 2019-02-21 11:34:07 +0900 | [diff] [blame] | 143 | "libnativewindow", |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 144 | "libhidlbase", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 145 | "libgui", |
| 146 | "libui", |
Robert Shih | 2568eb9 | 2018-09-19 10:00:46 -0700 | [diff] [blame] | 147 | "libmediandk_utils", |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 148 | ], |
| 149 | |
Orion Hodson | d3fd1ae | 2020-04-03 09:42:02 +0100 | [diff] [blame] | 150 | export_header_lib_headers: ["jni_headers"], |
| 151 | |
Chong Zhang | efd1c5c | 2020-11-18 10:33:13 -0800 | [diff] [blame] | 152 | export_include_dirs: [ |
| 153 | "include", |
| 154 | "include_platform", |
| 155 | ], |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 156 | |
Pawin Vongmasa | 4861615 | 2019-02-21 06:28:10 -0800 | [diff] [blame] | 157 | export_shared_lib_headers: [ |
| 158 | "libgui", |
| 159 | ], |
| 160 | |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 161 | product_variables: { |
| 162 | pdk: { |
| 163 | enabled: false, |
| 164 | }, |
| 165 | }, |
dimitry | b8aca87 | 2018-12-04 15:58:40 +0100 | [diff] [blame] | 166 | version_script: "libmediandk.map.txt", |
Dongwon Kang | 33d2535 | 2018-12-12 13:36:43 +0000 | [diff] [blame] | 167 | stubs: { |
| 168 | symbol_file: "libmediandk.map.txt", |
| 169 | versions: ["29"], |
| 170 | }, |
Colin Cross | 3f4c0df | 2017-05-04 16:19:06 -0700 | [diff] [blame] | 171 | } |
Jiyong Park | a88ef50 | 2017-08-10 20:12:24 +0900 | [diff] [blame] | 172 | |
Robert Shih | 2568eb9 | 2018-09-19 10:00:46 -0700 | [diff] [blame] | 173 | cc_library { |
| 174 | name: "libmediandk_utils", |
| 175 | |
| 176 | srcs: [ |
| 177 | "NdkMediaDataSourceCallbacks.cpp", |
| 178 | ], |
| 179 | |
| 180 | include_dirs: [ |
| 181 | "frameworks/av/media/libstagefright/include", |
| 182 | "frameworks/av/media/ndk/include", |
| 183 | ], |
| 184 | |
| 185 | export_include_dirs: [ |
| 186 | "include", |
| 187 | ], |
| 188 | |
| 189 | cflags: [ |
| 190 | "-Werror", |
| 191 | "-Wno-error=deprecated-declarations", |
| 192 | "-Wall", |
| 193 | ], |
| 194 | |
Marco Nelissen | 6b28594 | 2019-10-21 14:52:30 -0700 | [diff] [blame] | 195 | header_libs: [ |
| 196 | "libmedia_headers", |
| 197 | ], |
| 198 | |
Robert Shih | 2568eb9 | 2018-09-19 10:00:46 -0700 | [diff] [blame] | 199 | shared_libs: [ |
Robert Shih | 2568eb9 | 2018-09-19 10:00:46 -0700 | [diff] [blame] | 200 | ], |
| 201 | |
| 202 | sanitize: { |
| 203 | misc_undefined: [ |
| 204 | "unsigned-integer-overflow", |
| 205 | "signed-integer-overflow", |
| 206 | ], |
| 207 | cfi: true, |
Robert Shih | 2568eb9 | 2018-09-19 10:00:46 -0700 | [diff] [blame] | 208 | }, |
| 209 | } |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 210 | |
| 211 | cc_test { |
| 212 | name: "AImageReaderWindowHandleTest", |
Ray Essick | f867ca7 | 2020-04-29 19:41:08 -0700 | [diff] [blame] | 213 | test_suites: ["device-tests"], |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 214 | srcs: ["tests/AImageReaderWindowHandleTest.cpp"], |
| 215 | shared_libs: [ |
| 216 | "libbinder", |
| 217 | "libmediandk", |
Jayant Chowdhary | 32b4f49 | 2018-11-14 18:38:21 -0800 | [diff] [blame] | 218 | "libmediautils", |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 219 | "libnativewindow", |
| 220 | "libgui", |
| 221 | "libutils", |
| 222 | "libui", |
| 223 | "libcutils", |
| 224 | "android.hardware.graphics.bufferqueue@1.0", |
| 225 | ], |
Marco Nelissen | a51151a | 2020-01-07 13:37:47 -0800 | [diff] [blame] | 226 | header_libs: [ |
| 227 | "libstagefright_foundation_headers", |
| 228 | ], |
| 229 | |
Jayant Chowdhary | 249e1f2 | 2018-09-24 15:07:45 -0700 | [diff] [blame] | 230 | cflags: [ |
| 231 | "-D__ANDROID_VNDK__", |
| 232 | ], |
| 233 | include_dirs: [ |
| 234 | "frameworks/av/media/ndk/", |
| 235 | ], |
| 236 | } |
S Vasudev Prasad | af62b86 | 2020-04-22 16:10:05 +0530 | [diff] [blame] | 237 | |
| 238 | cc_library_static { |
| 239 | name: "libmediandk_format", |
| 240 | |
| 241 | host_supported: true, |
| 242 | |
| 243 | srcs: [ |
| 244 | "NdkMediaFormat.cpp", |
| 245 | ], |
| 246 | |
| 247 | header_libs: [ |
| 248 | "libstagefright_foundation_headers", |
| 249 | ], |
| 250 | |
| 251 | cflags: [ |
| 252 | "-DEXPORT=__attribute__((visibility(\"default\")))", |
| 253 | "-Werror", |
| 254 | "-Wall", |
| 255 | ], |
| 256 | |
| 257 | export_include_dirs: ["include"], |
| 258 | |
| 259 | sanitize: { |
| 260 | misc_undefined: [ |
| 261 | "unsigned-integer-overflow", |
| 262 | "signed-integer-overflow", |
| 263 | ], |
| 264 | cfi: true, |
| 265 | }, |
| 266 | |
| 267 | target: { |
| 268 | darwin: { |
| 269 | enabled: false, |
| 270 | }, |
| 271 | }, |
| 272 | |
Ray Essick | 19042f1 | 2021-02-12 14:45:16 -0800 | [diff] [blame] | 273 | apex_available: [ |
| 274 | "//apex_available:platform", |
| 275 | "com.android.media", |
| 276 | "com.android.media.swcodec", |
| 277 | ], |
S Vasudev Prasad | af62b86 | 2020-04-22 16:10:05 +0530 | [diff] [blame] | 278 | } |