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 19package { 20 default_team: "trendy_team_camera_framework", 21 default_applicable_licenses: ["frameworks_av_camera_ndk_license"], 22} 23 24// Added automatically by a large-scale-change that took the approach of 25// 'apply every license found to every target'. While this makes sure we respect 26// every license restriction, it may not be entirely correct. 27// 28// e.g. GPL in an MIT project might only apply to the contrib/ directory. 29// 30// Please consider splitting the single license below into multiple licenses, 31// taking care not to lose any license_kind information, and overriding the 32// default license using the 'licenses: [...]' property on targets as needed. 33// 34// For unused files, consider creating a 'fileGroup' with "//visibility:private" 35// to attach the license to, and including a comment whether the files may be 36// used in the current project. 37// See: http://go/android-license-faq 38license { 39 name: "frameworks_av_camera_ndk_license", 40 visibility: [":__subpackages__"], 41 license_kinds: [ 42 "SPDX-license-identifier-Apache-2.0", 43 "SPDX-license-identifier-MIT", 44 "SPDX-license-identifier-Unicode-DFS", 45 ], 46 license_text: [ 47 "NOTICE", 48 ], 49} 50 51ndk_library { 52 name: "libcamera2ndk", 53 symbol_file: "libcamera2ndk.map.txt", 54 first_version: "24", 55 unversioned_until: "current", 56} 57 58ndk_headers { 59 name: "libcamera2ndk_headers", 60 from: "include/camera", 61 to: "camera", 62 srcs: ["include/camera/**/*.h"], 63 license: "NOTICE", 64} 65 66cc_library_shared { 67 name: "libcamera2ndk", 68 srcs: [ 69 "NdkCameraCaptureSession.cpp", 70 "NdkCameraDevice.cpp", 71 "NdkCameraManager.cpp", 72 "NdkCameraMetadata.cpp", 73 "NdkCaptureRequest.cpp", 74 "impl/ACameraCaptureSession.cpp", 75 "impl/ACameraDevice.cpp", 76 "impl/ACameraManager.cpp", 77 "impl/ACameraMetadata.cpp", 78 ], 79 shared_libs: [ 80 "android.companion.virtual.virtualdevice_aidl-cpp", 81 "android.companion.virtualdevice.flags-aconfig-cc", 82 "android.hardware.common-V2-cpp", 83 "android.hardware.common.fmq-V1-cpp", 84 "camera_platform_flags_c_lib", 85 "framework-permission-aidl-cpp", 86 "libandroid_runtime", 87 "libbinder", 88 "libcamera_client", 89 "libcamera_metadata", 90 "libcutils", 91 "libfmq", 92 "libgui", 93 "liblog", 94 "libmediandk", 95 "libnativewindow", 96 "libstagefright_foundation", 97 "libutils", 98 ], 99 header_libs: [ 100 "jni_headers", 101 ], 102 cflags: [ 103 "-DEXPORT=__attribute__((visibility(\"default\")))", 104 "-Wall", 105 "-Werror", 106 "-Wextra", 107 "-fvisibility=hidden", 108 ], 109 // TODO: jchowdhary@, use header_libs instead b/131165718 110 include_dirs: [ 111 "system/media/private/camera/include", 112 ], 113 export_include_dirs: ["include"], 114 export_shared_lib_headers: [ 115 "libnativewindow", 116 ], 117 version_script: "libcamera2ndk.map.txt", 118} 119 120cc_library_shared { 121 name: "libcamera2ndk_vendor", 122 cpp_std: "gnu++17", 123 vendor: true, 124 srcs: [ 125 "NdkCameraCaptureSession.cpp", 126 "NdkCameraDevice.cpp", 127 "NdkCameraManager.cpp", 128 "NdkCameraMetadata.cpp", 129 "NdkCaptureRequest.cpp", 130 "impl/ACameraCaptureSession.cpp", 131 "impl/ACameraMetadata.cpp", 132 "ndk_vendor/impl/ACameraDevice.cpp", 133 "ndk_vendor/impl/ACameraManager.cpp", 134 "ndk_vendor/impl/utils.cpp", 135 ], 136 137 export_include_dirs: ["include"], 138 export_shared_lib_headers: [ 139 "libcutils", 140 ], 141 local_include_dirs: [ 142 ".", 143 "impl", 144 "include", 145 ], 146 cflags: [ 147 "-DEXPORT=__attribute__((visibility(\"default\")))", 148 "-D__ANDROID_VNDK__", 149 "-fvisibility=hidden", 150 ], 151 152 shared_libs: [ 153 "android.frameworks.cameraservice.common-V1-ndk", 154 "android.frameworks.cameraservice.device-V3-ndk", 155 "android.frameworks.cameraservice.service-V3-ndk", 156 "libbinder_ndk", 157 "libcamera_metadata", 158 "libcutils", 159 "libfmq", 160 "libhardware", 161 "libhidlbase", 162 "liblog", 163 "libmediandk", 164 "libnativewindow", 165 "libstagefright_foundation", 166 "libutils", 167 ], 168 static_libs: [ 169 "[email protected]", 170 "libaidlcommonsupport", 171 "libarect", 172 ], 173 // TODO: jchowdhary@, use header_libs instead b/131165718 174 include_dirs: [ 175 "system/media/private/camera/include", 176 ], 177} 178 179cc_test { 180 name: "ACameraNdkVendorTest", 181 vendor: true, 182 srcs: [ 183 "ndk_vendor/tests/ACameraManagerTest.cpp", 184 "ndk_vendor/tests/AImageReaderVendorTest.cpp", 185 ], 186 shared_libs: [ 187 "libcamera2ndk_vendor", 188 "libcamera_metadata", 189 "libcutils", 190 "libhidlbase", 191 "liblog", 192 "libmediandk", 193 "libnativewindow", 194 "libui", 195 "libutils", 196 ], 197 static_libs: [ 198 "[email protected]", 199 ], 200 cflags: [ 201 "-D__ANDROID_VNDK__", 202 ], 203} 204