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
19ndk_library {
20    name: "libcamera2ndk",
21    symbol_file: "libcamera2ndk.map.txt",
22    first_version: "24",
23    unversioned_until: "current",
24}
25
26ndk_headers {
27    name: "libcamera2ndk_headers",
28    from: "include/camera",
29    to: "camera",
30    srcs: ["include/camera/**/*.h"],
31    license: "NOTICE",
32}
33
34cc_library_shared {
35    name: "libcamera2ndk",
36    srcs: [
37        "NdkCameraManager.cpp",
38        "NdkCameraMetadata.cpp",
39        "NdkCameraDevice.cpp",
40        "NdkCaptureRequest.cpp",
41        "NdkCameraCaptureSession.cpp",
42        "impl/ACameraManager.cpp",
43        "impl/ACameraMetadata.cpp",
44        "impl/ACameraDevice.cpp",
45        "impl/ACameraCaptureSession.cpp",
46    ],
47    shared_libs: [
48        "libbinder",
49        "liblog",
50        "libgui",
51        "libutils",
52        "libandroid_runtime",
53        "libcamera_client",
54        "libstagefright_foundation",
55        "libcutils",
56        "libcamera_metadata",
57        "libmediandk",
58        "libnativewindow",
59    ],
60    cflags: [
61        "-fvisibility=hidden",
62        "-DEXPORT=__attribute__ ((visibility (\"default\")))",
63        "-Wall",
64        "-Wextra",
65        "-Werror",
66    ],
67    // TODO: jchowdhary@, use header_libs instead b/131165718
68    include_dirs: [
69        "system/media/private/camera/include",
70    ],
71    export_include_dirs: ["include"],
72    export_shared_lib_headers: [
73        "libnativewindow",
74    ],
75    version_script: "libcamera2ndk.map.txt",
76}
77
78cc_library_shared {
79    name: "libcamera2ndk_vendor",
80    vendor: true,
81    srcs: [
82        "ndk_vendor/impl/ACameraDevice.cpp",
83        "ndk_vendor/impl/ACameraManager.cpp",
84        "ndk_vendor/impl/utils.cpp",
85        "impl/ACameraMetadata.cpp",
86        "impl/ACameraCaptureSession.cpp",
87        "NdkCameraMetadata.cpp",
88        "NdkCameraCaptureSession.cpp",
89        "NdkCameraManager.cpp",
90        "NdkCameraDevice.cpp",
91        "NdkCaptureRequest.cpp",
92    ],
93
94    export_include_dirs: ["include"],
95    export_shared_lib_headers: [
96        "libcutils",
97    ],
98    local_include_dirs: [
99        ".",
100        "include",
101        "impl",
102    ],
103    cflags: [
104        "-fvisibility=hidden",
105        "-DEXPORT=__attribute__((visibility(\"default\")))",
106        "-D__ANDROID_VNDK__",
107    ],
108
109    shared_libs: [
110        "libhwbinder",
111        "libfmq",
112        "libhidlbase",
113        "libhardware",
114        "libnativewindow",
115        "liblog",
116        "libutils",
117        "libstagefright_foundation",
118        "libcutils",
119        "libcamera_metadata",
120        "libmediandk",
121        "android.frameworks.cameraservice.device@2.0",
122        "android.frameworks.cameraservice.common@2.0",
123        "android.frameworks.cameraservice.service@2.0",
124    ],
125
126    static_libs: [
127        "android.hardware.camera.common@1.0-helper",
128        "libarect",
129    ],
130    // TODO: jchowdhary@, use header_libs instead b/131165718
131    include_dirs: [
132        "system/media/private/camera/include",
133    ],
134    product_variables: {
135        pdk: {
136            enabled: false,
137        },
138    },
139}
140
141cc_test {
142    name: "AImageReaderVendorTest",
143    vendor: true,
144    srcs: ["ndk_vendor/tests/AImageReaderVendorTest.cpp"],
145    shared_libs: [
146        "libhwbinder",
147        "libcamera2ndk_vendor",
148        "libcamera_metadata",
149        "libmediandk",
150        "libnativewindow",
151        "libutils",
152        "libui",
153        "libcutils",
154        "liblog",
155    ],
156    static_libs: [
157        "android.hardware.camera.common@1.0-helper",
158    ],
159    cflags: [
160        "-D__ANDROID_VNDK__",
161    ],
162}
163