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