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