• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.hardware.common-V2-cpp",
82        "android.hardware.common.fmq-V1-cpp",
83        "camera_platform_flags_c_lib",
84        "framework-permission-aidl-cpp",
85        "libandroid_runtime",
86        "libbinder",
87        "libcamera_client",
88        "libcamera_metadata",
89        "libcutils",
90        "libfmq",
91        "libgui",
92        "liblog",
93        "libmediandk",
94        "libnativewindow",
95        "libstagefright_foundation",
96        "libutils",
97    ],
98    header_libs: [
99        "jni_headers",
100    ],
101    cflags: [
102        "-DEXPORT=__attribute__((visibility(\"default\")))",
103        "-Wall",
104        "-Werror",
105        "-Wextra",
106        "-fvisibility=hidden",
107    ],
108    // TODO: jchowdhary@, use header_libs instead b/131165718
109    include_dirs: [
110        "system/media/private/camera/include",
111    ],
112    export_include_dirs: ["include"],
113    export_shared_lib_headers: [
114        "libnativewindow",
115    ],
116    version_script: "libcamera2ndk.map.txt",
117}
118
119cc_library_shared {
120    name: "libcamera2ndk_vendor",
121    vendor: true,
122    srcs: [
123        "NdkCameraCaptureSession.cpp",
124        "NdkCameraDevice.cpp",
125        "NdkCameraManager.cpp",
126        "NdkCameraMetadata.cpp",
127        "NdkCaptureRequest.cpp",
128        "impl/ACameraCaptureSession.cpp",
129        "impl/ACameraMetadata.cpp",
130        "ndk_vendor/impl/ACameraDevice.cpp",
131        "ndk_vendor/impl/ACameraManager.cpp",
132        "ndk_vendor/impl/utils.cpp",
133    ],
134
135    export_include_dirs: ["include"],
136    export_shared_lib_headers: [
137        "libcutils",
138    ],
139    local_include_dirs: [
140        ".",
141        "impl",
142        "include",
143    ],
144    cflags: [
145        "-DEXPORT=__attribute__((visibility(\"default\")))",
146        "-D__ANDROID_VNDK__",
147        "-fvisibility=hidden",
148    ],
149
150    shared_libs: [
151        "android.frameworks.cameraservice.common-V1-ndk",
152        "android.frameworks.cameraservice.device-V3-ndk",
153        "android.frameworks.cameraservice.service-V3-ndk",
154        "libbinder_ndk",
155        "libcamera_metadata",
156        "libcutils",
157        "libfmq",
158        "libhardware",
159        "libhidlbase",
160        "liblog",
161        "libmediandk",
162        "libnativewindow",
163        "libstagefright_foundation",
164        "libutils",
165    ],
166    static_libs: [
167        "android.hardware.camera.common@1.0-helper",
168        "libaidlcommonsupport",
169        "libarect",
170    ],
171    // TODO: jchowdhary@, use header_libs instead b/131165718
172    include_dirs: [
173        "system/media/private/camera/include",
174    ],
175}
176
177cc_test {
178    name: "ACameraNdkVendorTest",
179    vendor: true,
180    srcs: [
181        "ndk_vendor/tests/ACameraManagerTest.cpp",
182        "ndk_vendor/tests/AImageReaderVendorTest.cpp",
183    ],
184    shared_libs: [
185        "libcamera2ndk_vendor",
186        "libcamera_metadata",
187        "libcutils",
188        "libhidlbase",
189        "liblog",
190        "libmediandk",
191        "libnativewindow",
192        "libui",
193        "libutils",
194    ],
195    static_libs: [
196        "android.hardware.camera.common@1.0-helper",
197    ],
198    cflags: [
199        "-D__ANDROID_VNDK__",
200    ],
201}
202