xref: /aosp_15_r20/frameworks/av/camera/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1// Copyright 2010 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
15package {
16    default_team: "trendy_team_camera_framework",
17    default_applicable_licenses: ["frameworks_av_camera_license"],
18}
19
20// Added automatically by a large-scale-change that took the approach of
21// 'apply every license found to every target'. While this makes sure we respect
22// every license restriction, it may not be entirely correct.
23//
24// e.g. GPL in an MIT project might only apply to the contrib/ directory.
25//
26// Please consider splitting the single license below into multiple licenses,
27// taking care not to lose any license_kind information, and overriding the
28// default license using the 'licenses: [...]' property on targets as needed.
29//
30// For unused files, consider creating a 'fileGroup' with "//visibility:private"
31// to attach the license to, and including a comment whether the files may be
32// used in the current project.
33// See: http://go/android-license-faq
34license {
35    name: "frameworks_av_camera_license",
36    visibility: [":__subpackages__"],
37    license_kinds: [
38        "SPDX-license-identifier-Apache-2.0",
39        "SPDX-license-identifier-MIT",
40        "SPDX-license-identifier-Unicode-DFS",
41    ],
42    license_text: [
43        "NOTICE",
44    ],
45}
46
47aconfig_declarations {
48    name: "camera_platform_flags",
49    package: "com.android.internal.camera.flags",
50    container: "system",
51    srcs: ["camera_platform.aconfig"],
52}
53
54cc_aconfig_library {
55    name: "camera_platform_flags_c_lib",
56    aconfig_declarations: "camera_platform_flags",
57}
58
59cc_aconfig_library {
60    name: "camera_platform_flags_c_lib_for_test",
61    aconfig_declarations: "camera_platform_flags",
62    host_supported: true,
63    mode: "test",
64}
65
66java_aconfig_library {
67    name: "camera_platform_flags_java_lib",
68    aconfig_declarations: "camera_platform_flags",
69}
70
71cc_library_headers {
72    name: "camera_headers",
73    export_include_dirs: ["include"],
74}
75
76cc_library {
77    name: "libcamera_client",
78
79    aidl: {
80        export_aidl_headers: true,
81        local_include_dirs: ["aidl"],
82        include_dirs: [
83            "frameworks/native/aidl/gui",
84            "frameworks/native/libs/permission/aidl",
85            "hardware/interfaces/common/fmq/aidl",
86            "hardware/interfaces/common/aidl",
87        ],
88    },
89
90    srcs: [
91        // AIDL files for camera interfaces
92        // The headers for these interfaces will be available to any modules that
93        // include libcamera_client, at the path "aidl/package/path/BnFoo.h"
94        ":libcamera_client_aidl",
95
96        // Source for camera interface parcelables, and manually-written interfaces
97        "Camera.cpp",
98        "CameraBase.cpp",
99        "CameraMetadata.cpp",
100        "CameraParameters.cpp",
101        "CameraParameters2.cpp",
102        "CameraSessionStats.cpp",
103        "CameraUtils.cpp",
104        "CaptureResult.cpp",
105        "ICamera.cpp",
106        "ICameraClient.cpp",
107        "ICameraRecordingProxy.cpp",
108        "VendorTagDescriptor.cpp",
109        "camera2/CaptureRequest.cpp",
110        "camera2/ConcurrentCamera.cpp",
111        "camera2/OutputConfiguration.cpp",
112        "camera2/SessionConfiguration.cpp",
113        "camera2/SubmitInfo.cpp",
114    ],
115
116    shared_libs: [
117        "android.hardware.common.fmq-V1-cpp",
118        "android.hardware.common-V2-cpp",
119        "camera_platform_flags_c_lib",
120        "framework-permission-aidl-cpp",
121        "lib-platform-compat-native-api",
122        "libbase",
123        "libbinder",
124        "libcamera_metadata",
125        "libcutils",
126        "libgui",
127        "liblog",
128        "libnativewindow",
129        "libpermission",
130        "libutils",
131    ],
132
133    include_dirs: [
134        "frameworks/native/include/media/openmax",
135        "system/media/private/camera/include",
136    ],
137    export_include_dirs: [
138        "include",
139        "include/camera",
140    ],
141    export_shared_lib_headers: [
142        "framework-permission-aidl-cpp",
143        "android.hardware.common.fmq-V1-cpp",
144        "android.hardware.common-V2-cpp",
145        "libcamera_metadata",
146        "libgui",
147        "libnativewindow",
148    ],
149
150    cflags: [
151        "-Wall",
152        "-Werror",
153        "-Wextra",
154    ],
155
156}
157
158cc_library_host_static {
159    name: "libcamera_client_host",
160
161    srcs: [
162        "CameraMetadata.cpp",
163        "VendorTagDescriptor.cpp",
164    ],
165
166    shared_libs: [
167        "libbase",
168        "libcamera_metadata",
169    ],
170
171    include_dirs: [
172        "frameworks/native/include/media/openmax",
173        "system/media/private/camera/include",
174    ],
175
176    export_include_dirs: [
177        "include",
178        "include/camera",
179    ],
180}
181
182// AIDL interface between camera clients and the camera service.
183filegroup {
184    name: "libcamera_client_aidl",
185    srcs: [
186        "aidl/android/hardware/CameraExtensionSessionStats.aidl",
187        "aidl/android/hardware/CameraFeatureCombinationStats.aidl",
188        "aidl/android/hardware/ICameraService.aidl",
189        "aidl/android/hardware/ICameraServiceListener.aidl",
190        "aidl/android/hardware/ICameraServiceProxy.aidl",
191        "aidl/android/hardware/camera2/ICameraDeviceCallbacks.aidl",
192        "aidl/android/hardware/camera2/ICameraDeviceUser.aidl",
193        "aidl/android/hardware/camera2/ICameraInjectionCallback.aidl",
194        "aidl/android/hardware/camera2/ICameraInjectionSession.aidl",
195        "aidl/android/hardware/camera2/ICameraOfflineSession.aidl",
196        "aidl/android/hardware/camera2/CameraMetadataInfo.aidl",
197    ],
198    path: "aidl",
199}
200
201// Extra AIDL files that are used by framework.jar but not libcamera_client
202// because they have hand-written native implementations.
203filegroup {
204    name: "libcamera_client_framework_aidl",
205    srcs: [
206        "aidl/android/hardware/ICamera.aidl",
207        "aidl/android/hardware/ICameraClient.aidl",
208    ],
209    path: "aidl",
210}
211