xref: /aosp_15_r20/frameworks/av/media/codec2/vndk/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_av_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_av_license"],
8}
9
10cc_library_headers {
11    name: "libcodec2_internal",
12
13    export_include_dirs: [
14        "internal",
15    ],
16
17    // TODO: Remove this when this module is moved back to frameworks/av.
18    vendor_available: true,
19
20    min_sdk_version: "29",
21    apex_available: [
22        "//apex_available:platform",
23        "com.android.media.swcodec",
24    ],
25
26}
27
28cc_library_headers {
29    name: "libcodec2_vndk_headers",
30    vendor_available: true,
31    min_sdk_version: "29",
32
33    export_include_dirs: [
34        "include",
35    ],
36    apex_available: [
37        "//apex_available:platform",
38        "com.android.media.swcodec",
39    ],
40}
41
42// !!!DO NOT DEPEND ON THIS SHARED LIBRARY DIRECTLY!!!
43// use libcodec2-impl-defaults instead
44cc_library {
45    name: "libcodec2_vndk",
46    vendor_available: true,
47    min_sdk_version: "29",
48    // TODO: b/147147883
49    double_loadable: true,
50    apex_available: [
51        "//apex_available:platform",
52        "com.android.media.swcodec",
53    ],
54
55    defaults: [
56        "aconfig_lib_cc_static_link.defaults",
57        "libcodec2_hal_selection",
58    ],
59
60    srcs: [
61        "C2AllocatorBlob.cpp",
62        "C2AllocatorIon.cpp",
63        "C2AllocatorGralloc.cpp",
64        "C2Buffer.cpp",
65        "C2Config.cpp",
66        "C2DmaBufAllocator.cpp",
67        "C2Fence.cpp",
68        "C2PlatformStorePluginLoader.cpp",
69        "C2Store.cpp",
70        "platform/C2BqBuffer.cpp",
71        "platform/C2BqPoolInvalidator.cpp",
72        "platform/C2SurfaceSyncObj.cpp",
73        "platform/C2IgbaBuffer.cpp",
74        "types.cpp",
75        "util/C2Debug.cpp",
76        "util/C2InterfaceHelper.cpp",
77        "util/C2InterfaceUtils.cpp",
78        "util/C2ParamUtils.cpp",
79    ],
80
81    export_include_dirs: [
82        "include",
83    ],
84
85    export_shared_lib_headers: [
86        "libbase",
87        "libdmabufheap",
88        "[email protected]",
89        "android.hardware.media.bufferpool2-V2-ndk",
90    ],
91
92    local_include_dirs: [
93        "internal",
94    ],
95
96    header_libs: [
97        "media_plugin_headers",
98        "libcodec2_headers",
99    ],
100
101    shared_libs: [
102        "[email protected]",
103        "[email protected]",
104        "android.hardware.common-V2-ndk",
105        "android.hardware.common.fmq-V1-ndk",
106        "[email protected]",
107        "android.hardware.media.bufferpool2-V2-ndk",
108        "android.hardware.media.c2-V1-ndk",
109        "libbase",
110        "libbinder_ndk",
111        "libcutils",
112        "libdl",
113        "libdmabufheap",
114        "libfmq",
115        "libgralloctypes",
116        "libhidlbase",
117        "libion",
118        "liblog",
119        "libnativewindow",
120        "libstagefright_foundation",
121        "[email protected]",
122        "libstagefright_aidl_bufferpool2",
123        "libui",
124        "libutils",
125    ],
126
127    cflags: [
128        "-Werror",
129        "-Wall",
130    ],
131}
132
133// public dependency for statically linking to libcodec2_vndk for unit tests
134cc_defaults {
135    name: "libcodec2-static-defaults",
136
137    defaults: [
138        "libcodec2_hal_selection",
139    ],
140
141    static_libs: [
142        "liblog",
143        "libion",
144        "libfmq",
145        "libbase",
146        "libutils",
147        "libcutils",
148        "libcodec2",
149        "libhidlbase",
150        "libdmabufheap",
151        "libcodec2_vndk",
152        "libnativewindow",
153        "libcodec2_soft_common",
154        "libsfplugin_ccodec_utils",
155        "libstagefright_aidl_bufferpool2",
156        "libstagefright_foundation",
157        "[email protected]",
158        "libgralloctypes",
159        "[email protected]",
160        "[email protected]",
161        "[email protected]",
162        "[email protected]",
163        "[email protected]",
164        "[email protected]",
165        "android.hardware.common-V2-ndk",
166        "android.hardware.common.fmq-V1-ndk",
167        "android.hardware.media.bufferpool2-V2-ndk",
168        "android.hardware.media.c2-V1-ndk",
169    ],
170
171    shared_libs: [
172        "libbinder",
173        "libbinder_ndk",
174        "libui",
175        "libdl",
176        "libvndksupport",
177        "libprocessgroup",
178    ],
179}
180
181// public dependency for implementing Codec 2 components
182cc_defaults {
183    name: "libcodec2-impl-defaults",
184    cpp_std: "gnu++17",
185
186    defaults: [
187        "libcodec2_hal_selection",
188    ],
189
190    shared_libs: [
191        "libbase", // for C2_LOG
192        "liblog", // for ALOG
193        "libcodec2",
194        "libcodec2_hal_common",
195        "libcodec2_vndk",
196        "libutils",
197    ],
198
199    min_sdk_version: "29",
200}
201
202// public dependency for implementing Codec 2 framework utilities
203// THIS IS ONLY FOR FRAMEWORK USE ONLY
204cc_defaults {
205    name: "libcodec2-internal-defaults",
206    defaults: ["libcodec2-impl-defaults"],
207
208    header_libs: [
209        "libcodec2_internal",
210    ],
211
212    shared_libs: [
213        "libcutils", // for properties
214    ],
215
216    // TODO: separate internal headers so they can be exposed here
217}
218