blob: debd664aba02308b0da1071970dab5f1c9a23983 [file] [log] [blame]
Dan Willemsen3106c1c2016-10-03 23:56:51 -07001// 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.
Bob Badour2e671852021-02-12 21:26:48 -080014package {
15 // See: http://go/android-license-faq
16 // A large-scale-change added 'default_applicable_licenses' to import
17 // all of the 'license_kinds' from "frameworks_native_license"
18 // to get the below license kinds:
19 // SPDX-license-identifier-Apache-2.0
20 default_applicable_licenses: ["frameworks_native_license"],
21}
22
Jiyong Park172bd722017-06-21 12:14:18 +090023cc_library_headers {
24 name: "libgui_headers",
25 vendor_available: true,
26 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070027
28 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070029 export_shared_lib_headers: [
30 "android.hidl.token@1.0-utils",
31 "android.hardware.graphics.bufferqueue@1.0",
32 "android.hardware.graphics.bufferqueue@2.0",
33 ],
34 shared_libs: [
35 "android.hidl.token@1.0-utils",
36 "android.hardware.graphics.bufferqueue@1.0",
37 "android.hardware.graphics.bufferqueue@2.0",
38 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090039 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090040}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041
Pablo Gamito6ee484d2020-07-30 14:26:28 +000042filegroup {
43 name: "libgui_aidl",
44 srcs: ["aidl/**/*.aidl"],
45 path: "aidl/",
46}
47
Dan Willemsen3106c1c2016-10-03 23:56:51 -070048cc_library_shared {
49 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090050 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090051 vndk: {
52 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090053 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090054 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090055 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070057 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070058
59 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090060 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100061 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000062 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070063 ":libgui_bufferqueue_sources",
64
Dan Willemsen3106c1c2016-10-03 23:56:51 -070065 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070066 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080067 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080068 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070069 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070070 "ConsumerBase.cpp",
71 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070072 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070073 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070074 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100075 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070076 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080077 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070078 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080079 "IGraphicBufferConsumer.cpp",
80 "IGraphicBufferProducer.cpp",
81 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080082 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070083 "ISurfaceComposer.cpp",
84 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070085 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080086 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080087 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070088 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080089 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070090 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -080091 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070092 "Surface.cpp",
93 "SurfaceControl.cpp",
94 "SurfaceComposerClient.cpp",
95 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000096 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080097 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080098 "bufferqueue/1.0/B2HProducerListener.cpp",
99 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
100 "bufferqueue/2.0/B2HProducerListener.cpp",
101 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700102 ],
103
104 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800105 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800106 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700107 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700108 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800109 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800110 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700111 ],
112
Chong Zhang62493092020-01-15 16:04:47 -0800113 export_shared_lib_headers: [
114 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -0700115 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -0800116 ],
117
Jiyong Parka75d3d62018-04-09 12:16:30 +0900118 // bufferhub is not used when building libgui for vendors
119 target: {
120 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800121 cflags: [
122 "-DNO_BUFFERHUB",
123 "-DNO_INPUT",
124 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900125 exclude_srcs: [
126 "BufferHubConsumer.cpp",
127 "BufferHubProducer.cpp",
128 ],
129 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800130 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700131 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900132 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800133 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800134 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900135 ],
136 },
137 },
138
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700139 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800140 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900141 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700142 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900143
144 aidl: {
145 export_aidl_headers: true,
146 }
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700147}
148
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700149// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700150// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700151cc_library_static {
152 name: "libgui_bufferqueue_static",
153 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900154 apex_available: [
155 "//apex_available:platform",
156 "com.android.media.swcodec",
157 ],
158 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700159
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700160 cflags: [
161 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800162 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700163 ],
164
165 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700166
167 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000168 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000169 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700170 ":libgui_bufferqueue_sources",
171 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700172}
173
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700174filegroup {
175 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700176 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700177 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700178 "BufferItem.cpp",
179 "BufferQueue.cpp",
180 "BufferQueueConsumer.cpp",
181 "BufferQueueCore.cpp",
182 "BufferQueueProducer.cpp",
183 "BufferQueueThreadState.cpp",
184 "BufferSlot.cpp",
185 "FrameTimestamps.cpp",
186 "GLConsumerUtils.cpp",
187 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700188 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700189 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700190 "bufferqueue/1.0/H2BProducerListener.cpp",
191 "bufferqueue/1.0/WProducerListener.cpp",
192 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700193 "bufferqueue/2.0/H2BProducerListener.cpp",
194 "bufferqueue/2.0/types.cpp",
195 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700196}
197
198// Common build config shared by libgui and libgui_bufferqueue_static.
199cc_defaults {
200 name: "libgui_bufferqueue-defaults",
201
202 clang: true,
203 cflags: [
204 "-Wall",
205 "-Werror",
206 ],
207
208 cppflags: [
209 "-Wextra",
210 "-DDEBUG_ONLY_CODE=0",
211 ],
212
213 product_variables: {
214 eng: {
215 cppflags: [
216 "-UDEBUG_ONLY_CODE",
217 "-DDEBUG_ONLY_CODE=1",
218 ],
219 },
220 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700221
David Stevens7347f0b2020-01-15 20:19:22 +0900222 whole_static_libs: [
223 "LibGuiProperties",
224 ],
225
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700226 shared_libs: [
227 "android.hardware.graphics.bufferqueue@1.0",
228 "android.hardware.graphics.bufferqueue@2.0",
229 "android.hardware.graphics.common@1.1",
230 "android.hardware.graphics.common@1.2",
231 "android.hidl.token@1.0-utils",
232 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700233 "libcutils",
234 "libEGL",
235 "libGLESv2",
236 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700237 "liblog",
238 "libnativewindow",
239 "libsync",
240 "libui",
241 "libutils",
242 "libvndksupport",
243 ],
244
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800245 static_libs: [
246 "libbinderthreadstateutils",
247 ],
248
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700249 header_libs: [
250 "libgui_headers",
251 "libnativebase_headers",
252 ],
253
Ady Abraham62f216c2020-10-13 19:07:23 -0700254 include_dirs: [
255 "frameworks/native/include",
256 ],
257
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700258 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700259 "libEGL",
260 "libnativewindow",
261 "libui",
262 "android.hardware.graphics.bufferqueue@1.0",
263 "android.hardware.graphics.bufferqueue@2.0",
264 "android.hardware.graphics.common@1.1",
265 "android.hardware.graphics.common@1.2",
266 "android.hidl.token@1.0-utils",
267 ],
268
269 export_header_lib_headers: [
270 "libgui_headers",
271 ],
272
273 export_include_dirs: [
274 "include",
275 ],
276}
277
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700278// GMocks for use by external code
279cc_library_static {
280 name: "libgui_mocks",
281 vendor_available: false,
282
283 defaults: ["libgui_bufferqueue-defaults"],
284 static_libs: [
285 "libgtest",
286 "libgmock",
287 ],
288
289 srcs: [
290 "mock/GraphicBufferConsumer.cpp",
291 "mock/GraphicBufferProducer.cpp",
292 ],
293}
294
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700295subdirs = ["tests"]