blob: 0e28fb84ca8c325c59b0db7fcda566520cbcb565 [file] [log] [blame]
Mathias Agopiana6c0e202017-03-20 15:48:44 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*************************************************************************************************
18 *
19 * IMPORTANT:
20 *
21 * There is an old copy of this file in system/core/include/system/window.h, which exists only
22 * for backward source compatibility.
23 * But there are binaries out there as well, so this version of window.h must stay binary
24 * backward compatible with the one found in system/core.
25 *
26 *
27 * Source compatibility is also required for now, because this is how we're handling the
28 * transition from system/core/include (global include path) to nativewindow/include.
29 *
30 *************************************************************************************************/
31
32#pragma once
33
34#include <cutils/native_handle.h>
35#include <errno.h>
36#include <limits.h>
Steven Thomas3172e202020-01-06 19:25:30 -080037#include <stdbool.h>
Mathias Agopiana6c0e202017-03-20 15:48:44 -070038#include <stdint.h>
39#include <string.h>
40#include <sys/cdefs.h>
41#include <system/graphics.h>
42#include <unistd.h>
Mathias Agopiana6c0e202017-03-20 15:48:44 -070043
Alec Mouri9fa2cb62019-07-15 17:36:26 -070044// system/window.h is a superset of the vndk and apex apis
45#include <apex/window.h>
Mathias Agopiana6c0e202017-03-20 15:48:44 -070046#include <vndk/window.h>
47
48
49#ifndef __UNUSED
50#define __UNUSED __attribute__((__unused__))
51#endif
52#ifndef __deprecated
53#define __deprecated __attribute__((__deprecated__))
54#endif
55
56__BEGIN_DECLS
57
58/*****************************************************************************/
59
Mathias Agopian000879a2017-03-20 18:07:26 -070060#define ANDROID_NATIVE_WINDOW_MAGIC ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d')
Mathias Agopiana6c0e202017-03-20 15:48:44 -070061
62// ---------------------------------------------------------------------------
63
Mathias Agopiana6c0e202017-03-20 15:48:44 -070064/* attributes queriable with query() */
65enum {
Alec Mouri72670c52019-08-31 01:54:33 -070066 NATIVE_WINDOW_WIDTH = 0,
67 NATIVE_WINDOW_HEIGHT = 1,
68 NATIVE_WINDOW_FORMAT = 2,
Mathias Agopiana6c0e202017-03-20 15:48:44 -070069
Mathias Agopian000879a2017-03-20 18:07:26 -070070 /* see ANativeWindowQuery in vndk/window.h */
71 NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = ANATIVEWINDOW_QUERY_MIN_UNDEQUEUED_BUFFERS,
Mathias Agopiana6c0e202017-03-20 15:48:44 -070072
73 /* Check whether queueBuffer operations on the ANativeWindow send the buffer
74 * to the window compositor. The query sets the returned 'value' argument
75 * to 1 if the ANativeWindow DOES send queued buffers directly to the window
76 * compositor and 0 if the buffers do not go directly to the window
77 * compositor.
78 *
79 * This can be used to determine whether protected buffer content should be
80 * sent to the ANativeWindow. Note, however, that a result of 1 does NOT
81 * indicate that queued buffers will be protected from applications or users
82 * capturing their contents. If that behavior is desired then some other
83 * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in
84 * conjunction with this query.
85 */
86 NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4,
87
88 /* Get the concrete type of a ANativeWindow. See below for the list of
89 * possible return values.
90 *
91 * This query should not be used outside the Android framework and will
92 * likely be removed in the near future.
93 */
94 NATIVE_WINDOW_CONCRETE_TYPE = 5,
95
Mathias Agopiana6c0e202017-03-20 15:48:44 -070096 /*
97 * Default width and height of ANativeWindow buffers, these are the
98 * dimensions of the window buffers irrespective of the
99 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window
100 * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS.
101 */
Mathias Agopian000879a2017-03-20 18:07:26 -0700102 NATIVE_WINDOW_DEFAULT_WIDTH = ANATIVEWINDOW_QUERY_DEFAULT_WIDTH,
103 NATIVE_WINDOW_DEFAULT_HEIGHT = ANATIVEWINDOW_QUERY_DEFAULT_HEIGHT,
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700104
Mathias Agopian000879a2017-03-20 18:07:26 -0700105 /* see ANativeWindowQuery in vndk/window.h */
106 NATIVE_WINDOW_TRANSFORM_HINT = ANATIVEWINDOW_QUERY_TRANSFORM_HINT,
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700107
108 /*
109 * Boolean that indicates whether the consumer is running more than
110 * one buffer behind the producer.
111 */
112 NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9,
113
114 /*
115 * The consumer gralloc usage bits currently set by the consumer.
116 * The values are defined in hardware/libhardware/include/gralloc.h.
117 */
Chia-I Wue2786ea2017-08-07 10:36:08 -0700118 NATIVE_WINDOW_CONSUMER_USAGE_BITS = 10, /* deprecated */
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700119
120 /**
121 * Transformation that will by applied to buffers by the hwcomposer.
122 * This must not be set or checked by producer endpoints, and will
123 * disable the transform hint set in SurfaceFlinger (see
124 * NATIVE_WINDOW_TRANSFORM_HINT).
125 *
126 * INTENDED USE:
127 * Temporary - Please do not use this. This is intended only to be used
128 * by the camera's LEGACY mode.
129 *
130 * In situations where a SurfaceFlinger client wishes to set a transform
131 * that is not visible to the producer, and will always be applied in the
132 * hardware composer, the client can set this flag with
133 * native_window_set_buffers_sticky_transform. This can be used to rotate
134 * and flip buffers consumed by hardware composer without actually changing
135 * the aspect ratio of the buffers produced.
136 */
137 NATIVE_WINDOW_STICKY_TRANSFORM = 11,
138
139 /**
140 * The default data space for the buffers as set by the consumer.
141 * The values are defined in graphics.h.
142 */
143 NATIVE_WINDOW_DEFAULT_DATASPACE = 12,
144
Mathias Agopian000879a2017-03-20 18:07:26 -0700145 /* see ANativeWindowQuery in vndk/window.h */
146 NATIVE_WINDOW_BUFFER_AGE = ANATIVEWINDOW_QUERY_BUFFER_AGE,
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700147
148 /*
149 * Returns the duration of the last dequeueBuffer call in microseconds
Alec Mouri72670c52019-08-31 01:54:33 -0700150 * Deprecated: please use NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION in
151 * perform() instead, which supports nanosecond precision.
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700152 */
153 NATIVE_WINDOW_LAST_DEQUEUE_DURATION = 14,
154
155 /*
156 * Returns the duration of the last queueBuffer call in microseconds
Alec Mouri72670c52019-08-31 01:54:33 -0700157 * Deprecated: please use NATIVE_WINDOW_GET_LAST_QUEUE_DURATION in
158 * perform() instead, which supports nanosecond precision.
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700159 */
160 NATIVE_WINDOW_LAST_QUEUE_DURATION = 15,
161
162 /*
163 * Returns the number of image layers that the ANativeWindow buffer
164 * contains. By default this is 1, unless a buffer is explicitly allocated
165 * to contain multiple layers.
166 */
167 NATIVE_WINDOW_LAYER_COUNT = 16,
168
169 /*
170 * Returns 1 if the native window is valid, 0 otherwise. native window is valid
171 * if it is safe (i.e. no crash will occur) to call any method on it.
172 */
173 NATIVE_WINDOW_IS_VALID = 17,
Brian Anderson6b376712017-04-04 10:51:39 -0700174
175 /*
176 * Returns 1 if NATIVE_WINDOW_GET_FRAME_TIMESTAMPS will return display
177 * present info, 0 if it won't.
178 */
179 NATIVE_WINDOW_FRAME_TIMESTAMPS_SUPPORTS_PRESENT = 18,
Jiwen 'Steve' Cai20419132017-04-21 18:49:53 -0700180
181 /*
182 * The consumer end is capable of handling protected buffers, i.e. buffer
183 * with GRALLOC_USAGE_PROTECTED usage bits on.
184 */
185 NATIVE_WINDOW_CONSUMER_IS_PROTECTED = 19,
Peiyong Lin654f87b2018-01-30 14:21:33 -0800186
187 /*
188 * Returns data space for the buffers.
189 */
190 NATIVE_WINDOW_DATASPACE = 20,
Yiwei Zhangdbd96152018-02-08 14:22:53 -0800191
192 /*
193 * Returns maxBufferCount set by BufferQueueConsumer
194 */
195 NATIVE_WINDOW_MAX_BUFFER_COUNT = 21,
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700196};
197
198/* Valid operations for the (*perform)() hook.
199 *
200 * Values marked as 'deprecated' are supported, but have been superceded by
201 * other functionality.
202 *
203 * Values marked as 'private' should be considered private to the framework.
204 * HAL implementation code with access to an ANativeWindow should not use these,
205 * as it may not interact properly with the framework's use of the
206 * ANativeWindow.
207 */
208enum {
Valerie Haua82679d2018-11-21 09:31:43 -0800209 // clang-format off
Alec Mouri09d122a2019-11-25 10:00:53 -0800210 NATIVE_WINDOW_SET_USAGE = ANATIVEWINDOW_PERFORM_SET_USAGE, /* deprecated */
Yiwei Zhang538cedc2019-06-24 19:35:03 -0700211 NATIVE_WINDOW_CONNECT = 1, /* deprecated */
212 NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */
213 NATIVE_WINDOW_SET_CROP = 3, /* private */
214 NATIVE_WINDOW_SET_BUFFER_COUNT = 4,
Alec Mouri09d122a2019-11-25 10:00:53 -0800215 NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = ANATIVEWINDOW_PERFORM_SET_BUFFERS_GEOMETRY, /* deprecated */
Yiwei Zhang538cedc2019-06-24 19:35:03 -0700216 NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6,
217 NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7,
218 NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8,
Alec Mouri09d122a2019-11-25 10:00:53 -0800219 NATIVE_WINDOW_SET_BUFFERS_FORMAT = ANATIVEWINDOW_PERFORM_SET_BUFFERS_FORMAT,
Yiwei Zhang538cedc2019-06-24 19:35:03 -0700220 NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */
221 NATIVE_WINDOW_LOCK = 11, /* private */
222 NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */
223 NATIVE_WINDOW_API_CONNECT = 13, /* private */
224 NATIVE_WINDOW_API_DISCONNECT = 14, /* private */
225 NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */
226 NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* deprecated, unimplemented */
227 NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM = 17, /* private */
228 NATIVE_WINDOW_SET_SIDEBAND_STREAM = 18,
229 NATIVE_WINDOW_SET_BUFFERS_DATASPACE = 19,
230 NATIVE_WINDOW_SET_SURFACE_DAMAGE = 20, /* private */
231 NATIVE_WINDOW_SET_SHARED_BUFFER_MODE = 21,
232 NATIVE_WINDOW_SET_AUTO_REFRESH = 22,
233 NATIVE_WINDOW_GET_REFRESH_CYCLE_DURATION = 23,
234 NATIVE_WINDOW_GET_NEXT_FRAME_ID = 24,
235 NATIVE_WINDOW_ENABLE_FRAME_TIMESTAMPS = 25,
236 NATIVE_WINDOW_GET_COMPOSITOR_TIMING = 26,
237 NATIVE_WINDOW_GET_FRAME_TIMESTAMPS = 27,
238 NATIVE_WINDOW_GET_WIDE_COLOR_SUPPORT = 28,
239 NATIVE_WINDOW_GET_HDR_SUPPORT = 29,
Alec Mouri09d122a2019-11-25 10:00:53 -0800240 NATIVE_WINDOW_SET_USAGE64 = ANATIVEWINDOW_PERFORM_SET_USAGE64,
Yiwei Zhang538cedc2019-06-24 19:35:03 -0700241 NATIVE_WINDOW_GET_CONSUMER_USAGE64 = 31,
242 NATIVE_WINDOW_SET_BUFFERS_SMPTE2086_METADATA = 32,
243 NATIVE_WINDOW_SET_BUFFERS_CTA861_3_METADATA = 33,
Valerie Haua82679d2018-11-21 09:31:43 -0800244 NATIVE_WINDOW_SET_BUFFERS_HDR10_PLUS_METADATA = 34,
Yiwei Zhang538cedc2019-06-24 19:35:03 -0700245 NATIVE_WINDOW_SET_AUTO_PREROTATION = 35,
Alec Mouria1619662019-08-21 19:30:48 -0700246 NATIVE_WINDOW_GET_LAST_DEQUEUE_START = 36, /* private */
Alec Mouri04fdb602019-08-23 19:41:43 -0700247 NATIVE_WINDOW_SET_DEQUEUE_TIMEOUT = 37, /* private */
Alec Mouri72670c52019-08-31 01:54:33 -0700248 NATIVE_WINDOW_GET_LAST_DEQUEUE_DURATION = 38, /* private */
249 NATIVE_WINDOW_GET_LAST_QUEUE_DURATION = 39, /* private */
Steven Thomas3172e202020-01-06 19:25:30 -0800250 NATIVE_WINDOW_SET_FRAME_RATE = 40,
Alec Mouri09d122a2019-11-25 10:00:53 -0800251 NATIVE_WINDOW_SET_CANCEL_INTERCEPTOR = 41, /* private */
252 NATIVE_WINDOW_SET_DEQUEUE_INTERCEPTOR = 42, /* private */
253 NATIVE_WINDOW_SET_PERFORM_INTERCEPTOR = 43, /* private */
254 NATIVE_WINDOW_SET_QUEUE_INTERCEPTOR = 44, /* private */
Alec Mouri74aef6d2019-12-09 17:10:24 -0800255 NATIVE_WINDOW_ALLOCATE_BUFFERS = 45, /* private */
Alec Mourief0b1532019-12-17 09:39:07 -0800256 NATIVE_WINDOW_GET_LAST_QUEUED_BUFFER = 46, /* private */
Valerie Haua82679d2018-11-21 09:31:43 -0800257 // clang-format on
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700258};
259
260/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
261enum {
262 /* Buffers will be queued by EGL via eglSwapBuffers after being filled using
263 * OpenGL ES.
264 */
265 NATIVE_WINDOW_API_EGL = 1,
266
267 /* Buffers will be queued after being filled using the CPU
268 */
269 NATIVE_WINDOW_API_CPU = 2,
270
271 /* Buffers will be queued by Stagefright after being filled by a video
272 * decoder. The video decoder can either be a software or hardware decoder.
273 */
274 NATIVE_WINDOW_API_MEDIA = 3,
275
276 /* Buffers will be queued by the the camera HAL.
277 */
278 NATIVE_WINDOW_API_CAMERA = 4,
279};
280
281/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */
282enum {
283 /* flip source image horizontally */
284 NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H ,
285 /* flip source image vertically */
286 NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
287 /* rotate source image 90 degrees clock-wise, and is applied after TRANSFORM_FLIP_{H|V} */
288 NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
289 /* rotate source image 180 degrees */
290 NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
291 /* rotate source image 270 degrees clock-wise */
292 NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
293 /* transforms source by the inverse transform of the screen it is displayed onto. This
294 * transform is applied last */
295 NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY = 0x08
296};
297
298/* parameter for NATIVE_WINDOW_SET_SCALING_MODE
299 * keep in sync with Surface.java in frameworks/base */
300enum {
301 /* the window content is not updated (frozen) until a buffer of
302 * the window size is received (enqueued)
303 */
304 NATIVE_WINDOW_SCALING_MODE_FREEZE = 0,
305 /* the buffer is scaled in both dimensions to match the window size */
306 NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1,
307 /* the buffer is scaled uniformly such that the smaller dimension
308 * of the buffer matches the window size (cropping in the process)
309 */
310 NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2,
311 /* the window is clipped to the size of the buffer's crop rectangle; pixels
312 * outside the crop rectangle are treated as if they are completely
313 * transparent.
314 */
315 NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3,
316};
317
318/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */
319enum {
320 NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */
321 NATIVE_WINDOW_SURFACE = 1, /* Surface */
322};
323
324/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP
325 *
326 * Special timestamp value to indicate that timestamps should be auto-generated
327 * by the native window when queueBuffer is called. This is equal to INT64_MIN,
328 * defined directly to avoid problems with C99/C++ inclusion of stdint.h.
329 */
330static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1);
331
Brian Andersondc96fdf2017-03-20 16:54:25 -0700332/* parameter for NATIVE_WINDOW_GET_FRAME_TIMESTAMPS
333 *
334 * Special timestamp value to indicate the timestamps aren't yet known or
335 * that they are invalid.
336 */
337static const int64_t NATIVE_WINDOW_TIMESTAMP_PENDING = -2;
338static const int64_t NATIVE_WINDOW_TIMESTAMP_INVALID = -1;
339
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700340struct ANativeWindow
341{
342#ifdef __cplusplus
343 ANativeWindow()
344 : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0)
345 {
346 common.magic = ANDROID_NATIVE_WINDOW_MAGIC;
347 common.version = sizeof(ANativeWindow);
348 memset(common.reserved, 0, sizeof(common.reserved));
349 }
350
351 /* Implement the methods that sp<ANativeWindow> expects so that it
352 can be used to automatically refcount ANativeWindow's. */
353 void incStrong(const void* /*id*/) const {
354 common.incRef(const_cast<android_native_base_t*>(&common));
355 }
356 void decStrong(const void* /*id*/) const {
357 common.decRef(const_cast<android_native_base_t*>(&common));
358 }
359#endif
360
361 struct android_native_base_t common;
362
363 /* flags describing some attributes of this surface or its updater */
364 const uint32_t flags;
365
366 /* min swap interval supported by this updated */
367 const int minSwapInterval;
368
369 /* max swap interval supported by this updated */
370 const int maxSwapInterval;
371
372 /* horizontal and vertical resolution in DPI */
373 const float xdpi;
374 const float ydpi;
375
376 /* Some storage reserved for the OEM's driver. */
377 intptr_t oem[4];
378
379 /*
380 * Set the swap interval for this surface.
381 *
382 * Returns 0 on success or -errno on error.
383 */
384 int (*setSwapInterval)(struct ANativeWindow* window,
385 int interval);
386
387 /*
388 * Hook called by EGL to acquire a buffer. After this call, the buffer
389 * is not locked, so its content cannot be modified. This call may block if
390 * no buffers are available.
391 *
392 * The window holds a reference to the buffer between dequeueBuffer and
393 * either queueBuffer or cancelBuffer, so clients only need their own
394 * reference if they might use the buffer after queueing or canceling it.
395 * Holding a reference to a buffer after queueing or canceling it is only
396 * allowed if a specific buffer count has been set.
397 *
398 * Returns 0 on success or -errno on error.
399 *
400 * XXX: This function is deprecated. It will continue to work for some
401 * time for binary compatibility, but the new dequeueBuffer function that
402 * outputs a fence file descriptor should be used in its place.
403 */
404 int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window,
405 struct ANativeWindowBuffer** buffer);
406
407 /*
408 * hook called by EGL to lock a buffer. This MUST be called before modifying
409 * the content of a buffer. The buffer must have been acquired with
410 * dequeueBuffer first.
411 *
412 * Returns 0 on success or -errno on error.
413 *
414 * XXX: This function is deprecated. It will continue to work for some
415 * time for binary compatibility, but it is essentially a no-op, and calls
416 * to it should be removed.
417 */
418 int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window,
419 struct ANativeWindowBuffer* buffer);
420
421 /*
422 * Hook called by EGL when modifications to the render buffer are done.
423 * This unlocks and post the buffer.
424 *
425 * The window holds a reference to the buffer between dequeueBuffer and
426 * either queueBuffer or cancelBuffer, so clients only need their own
427 * reference if they might use the buffer after queueing or canceling it.
428 * Holding a reference to a buffer after queueing or canceling it is only
429 * allowed if a specific buffer count has been set.
430 *
431 * Buffers MUST be queued in the same order than they were dequeued.
432 *
433 * Returns 0 on success or -errno on error.
434 *
435 * XXX: This function is deprecated. It will continue to work for some
436 * time for binary compatibility, but the new queueBuffer function that
437 * takes a fence file descriptor should be used in its place (pass a value
438 * of -1 for the fence file descriptor if there is no valid one to pass).
439 */
440 int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window,
441 struct ANativeWindowBuffer* buffer);
442
443 /*
444 * hook used to retrieve information about the native window.
445 *
446 * Returns 0 on success or -errno on error.
447 */
448 int (*query)(const struct ANativeWindow* window,
449 int what, int* value);
450
451 /*
452 * hook used to perform various operations on the surface.
453 * (*perform)() is a generic mechanism to add functionality to
454 * ANativeWindow while keeping backward binary compatibility.
455 *
456 * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions
457 * defined below.
458 *
459 * (*perform)() returns -ENOENT if the 'what' parameter is not supported
460 * by the surface's implementation.
461 *
462 * See above for a list of valid operations, such as
463 * NATIVE_WINDOW_SET_USAGE or NATIVE_WINDOW_CONNECT
464 */
465 int (*perform)(struct ANativeWindow* window,
466 int operation, ... );
467
468 /*
469 * Hook used to cancel a buffer that has been dequeued.
470 * No synchronization is performed between dequeue() and cancel(), so
471 * either external synchronization is needed, or these functions must be
472 * called from the same thread.
473 *
474 * The window holds a reference to the buffer between dequeueBuffer and
475 * either queueBuffer or cancelBuffer, so clients only need their own
476 * reference if they might use the buffer after queueing or canceling it.
477 * Holding a reference to a buffer after queueing or canceling it is only
478 * allowed if a specific buffer count has been set.
479 *
480 * XXX: This function is deprecated. It will continue to work for some
481 * time for binary compatibility, but the new cancelBuffer function that
482 * takes a fence file descriptor should be used in its place (pass a value
483 * of -1 for the fence file descriptor if there is no valid one to pass).
484 */
485 int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window,
486 struct ANativeWindowBuffer* buffer);
487
488 /*
489 * Hook called by EGL to acquire a buffer. This call may block if no
490 * buffers are available.
491 *
492 * The window holds a reference to the buffer between dequeueBuffer and
493 * either queueBuffer or cancelBuffer, so clients only need their own
494 * reference if they might use the buffer after queueing or canceling it.
495 * Holding a reference to a buffer after queueing or canceling it is only
496 * allowed if a specific buffer count has been set.
497 *
498 * The libsync fence file descriptor returned in the int pointed to by the
499 * fenceFd argument will refer to the fence that must signal before the
500 * dequeued buffer may be written to. A value of -1 indicates that the
501 * caller may access the buffer immediately without waiting on a fence. If
502 * a valid file descriptor is returned (i.e. any value except -1) then the
503 * caller is responsible for closing the file descriptor.
504 *
505 * Returns 0 on success or -errno on error.
506 */
507 int (*dequeueBuffer)(struct ANativeWindow* window,
508 struct ANativeWindowBuffer** buffer, int* fenceFd);
509
510 /*
511 * Hook called by EGL when modifications to the render buffer are done.
512 * This unlocks and post the buffer.
513 *
514 * The window holds a reference to the buffer between dequeueBuffer and
515 * either queueBuffer or cancelBuffer, so clients only need their own
516 * reference if they might use the buffer after queueing or canceling it.
517 * Holding a reference to a buffer after queueing or canceling it is only
518 * allowed if a specific buffer count has been set.
519 *
520 * The fenceFd argument specifies a libsync fence file descriptor for a
521 * fence that must signal before the buffer can be accessed. If the buffer
522 * can be accessed immediately then a value of -1 should be used. The
523 * caller must not use the file descriptor after it is passed to
524 * queueBuffer, and the ANativeWindow implementation is responsible for
525 * closing it.
526 *
527 * Returns 0 on success or -errno on error.
528 */
529 int (*queueBuffer)(struct ANativeWindow* window,
530 struct ANativeWindowBuffer* buffer, int fenceFd);
531
532 /*
533 * Hook used to cancel a buffer that has been dequeued.
534 * No synchronization is performed between dequeue() and cancel(), so
535 * either external synchronization is needed, or these functions must be
536 * called from the same thread.
537 *
538 * The window holds a reference to the buffer between dequeueBuffer and
539 * either queueBuffer or cancelBuffer, so clients only need their own
540 * reference if they might use the buffer after queueing or canceling it.
541 * Holding a reference to a buffer after queueing or canceling it is only
542 * allowed if a specific buffer count has been set.
543 *
544 * The fenceFd argument specifies a libsync fence file decsriptor for a
545 * fence that must signal before the buffer can be accessed. If the buffer
546 * can be accessed immediately then a value of -1 should be used.
547 *
548 * Note that if the client has not waited on the fence that was returned
549 * from dequeueBuffer, that same fence should be passed to cancelBuffer to
550 * ensure that future uses of the buffer are preceded by a wait on that
551 * fence. The caller must not use the file descriptor after it is passed
552 * to cancelBuffer, and the ANativeWindow implementation is responsible for
553 * closing it.
554 *
555 * Returns 0 on success or -errno on error.
556 */
557 int (*cancelBuffer)(struct ANativeWindow* window,
558 struct ANativeWindowBuffer* buffer, int fenceFd);
559};
560
561 /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C).
562 * android_native_window_t is deprecated.
563 */
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700564typedef struct ANativeWindow android_native_window_t __deprecated;
565
566/*
Mathias Agopiancb496ac2017-05-22 14:21:00 -0700567 * native_window_set_usage64(..., usage)
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700568 * Sets the intended usage flags for the next buffers
569 * acquired with (*lockBuffer)() and on.
Mathias Agopiancb496ac2017-05-22 14:21:00 -0700570 *
571 * Valid usage flags are defined in android/hardware_buffer.h
572 * All AHARDWAREBUFFER_USAGE_* flags can be specified as needed.
573 *
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700574 * Calling this function will usually cause following buffers to be
575 * reallocated.
576 */
Mathias Agopiancb496ac2017-05-22 14:21:00 -0700577static inline int native_window_set_usage(struct ANativeWindow* window, uint64_t usage) {
578 return window->perform(window, NATIVE_WINDOW_SET_USAGE64, usage);
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700579}
580
581/* deprecated. Always returns 0. Don't call. */
582static inline int native_window_connect(
583 struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
584
585static inline int native_window_connect(
586 struct ANativeWindow* window __UNUSED, int api __UNUSED) {
587 return 0;
588}
589
590/* deprecated. Always returns 0. Don't call. */
591static inline int native_window_disconnect(
592 struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
593
594static inline int native_window_disconnect(
595 struct ANativeWindow* window __UNUSED, int api __UNUSED) {
596 return 0;
597}
598
599/*
600 * native_window_set_crop(..., crop)
601 * Sets which region of the next queued buffers needs to be considered.
602 * Depending on the scaling mode, a buffer's crop region is scaled and/or
603 * cropped to match the surface's size. This function sets the crop in
604 * pre-transformed buffer pixel coordinates.
605 *
606 * The specified crop region applies to all buffers queued after it is called.
607 *
608 * If 'crop' is NULL, subsequently queued buffers won't be cropped.
609 *
610 * An error is returned if for instance the crop region is invalid, out of the
611 * buffer's bound or if the window is invalid.
612 */
613static inline int native_window_set_crop(
614 struct ANativeWindow* window,
615 android_native_rect_t const * crop)
616{
617 return window->perform(window, NATIVE_WINDOW_SET_CROP, crop);
618}
619
620/*
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700621 * native_window_set_buffer_count(..., count)
622 * Sets the number of buffers associated with this native window.
623 */
624static inline int native_window_set_buffer_count(
625 struct ANativeWindow* window,
626 size_t bufferCount)
627{
628 return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount);
629}
630
631/*
632 * native_window_set_buffers_geometry(..., int w, int h, int format)
633 * All buffers dequeued after this call will have the dimensions and format
634 * specified. A successful call to this function has the same effect as calling
635 * native_window_set_buffers_size and native_window_set_buffers_format.
636 *
637 * XXX: This function is deprecated. The native_window_set_buffers_dimensions
638 * and native_window_set_buffers_format functions should be used instead.
639 */
640static inline int native_window_set_buffers_geometry(
641 struct ANativeWindow* window,
642 int w, int h, int format) __deprecated;
643
644static inline int native_window_set_buffers_geometry(
645 struct ANativeWindow* window,
646 int w, int h, int format)
647{
648 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY,
649 w, h, format);
650}
651
652/*
653 * native_window_set_buffers_dimensions(..., int w, int h)
654 * All buffers dequeued after this call will have the dimensions specified.
655 * In particular, all buffers will have a fixed-size, independent from the
656 * native-window size. They will be scaled according to the scaling mode
657 * (see native_window_set_scaling_mode) upon window composition.
658 *
659 * If w and h are 0, the normal behavior is restored. That is, dequeued buffers
660 * following this call will be sized to match the window's size.
661 *
662 * Calling this function will reset the window crop to a NULL value, which
663 * disables cropping of the buffers.
664 */
665static inline int native_window_set_buffers_dimensions(
666 struct ANativeWindow* window,
667 int w, int h)
668{
669 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS,
670 w, h);
671}
672
673/*
674 * native_window_set_buffers_user_dimensions(..., int w, int h)
675 *
676 * Sets the user buffer size for the window, which overrides the
677 * window's size. All buffers dequeued after this call will have the
678 * dimensions specified unless overridden by
679 * native_window_set_buffers_dimensions. All buffers will have a
680 * fixed-size, independent from the native-window size. They will be
681 * scaled according to the scaling mode (see
682 * native_window_set_scaling_mode) upon window composition.
683 *
684 * If w and h are 0, the normal behavior is restored. That is, the
685 * default buffer size will match the windows's size.
686 *
687 * Calling this function will reset the window crop to a NULL value, which
688 * disables cropping of the buffers.
689 */
690static inline int native_window_set_buffers_user_dimensions(
691 struct ANativeWindow* window,
692 int w, int h)
693{
694 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS,
695 w, h);
696}
697
698/*
699 * native_window_set_buffers_format(..., int format)
700 * All buffers dequeued after this call will have the format specified.
701 *
702 * If the specified format is 0, the default buffer format will be used.
703 */
704static inline int native_window_set_buffers_format(
705 struct ANativeWindow* window,
706 int format)
707{
708 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format);
709}
710
711/*
712 * native_window_set_buffers_data_space(..., int dataSpace)
713 * All buffers queued after this call will be associated with the dataSpace
714 * parameter specified.
715 *
716 * dataSpace specifies additional information about the buffer that's dependent
717 * on the buffer format and the endpoints. For example, it can be used to convey
718 * the color space of the image data in the buffer, or it can be used to
719 * indicate that the buffers contain depth measurement data instead of color
720 * images. The default dataSpace is 0, HAL_DATASPACE_UNKNOWN, unless it has been
721 * overridden by the consumer.
722 */
723static inline int native_window_set_buffers_data_space(
724 struct ANativeWindow* window,
725 android_dataspace_t dataSpace)
726{
727 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DATASPACE,
728 dataSpace);
729}
730
731/*
Courtney Goeltzenleuchter9bad0d72017-12-19 12:34:34 -0700732 * native_window_set_buffers_smpte2086_metadata(..., metadata)
733 * All buffers queued after this call will be associated with the SMPTE
734 * ST.2086 metadata specified.
735 *
736 * metadata specifies additional information about the contents of the buffer
737 * that may affect how it's displayed. When it is nullptr, it means no such
738 * information is available. No SMPTE ST.2086 metadata is associated with the
739 * buffers by default.
740 */
741static inline int native_window_set_buffers_smpte2086_metadata(
742 struct ANativeWindow* window,
743 const struct android_smpte2086_metadata* metadata)
744{
745 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_SMPTE2086_METADATA,
746 metadata);
747}
748
749/*
750 * native_window_set_buffers_cta861_3_metadata(..., metadata)
751 * All buffers queued after this call will be associated with the CTA-861.3
752 * metadata specified.
753 *
754 * metadata specifies additional information about the contents of the buffer
755 * that may affect how it's displayed. When it is nullptr, it means no such
756 * information is available. No CTA-861.3 metadata is associated with the
757 * buffers by default.
758 */
759static inline int native_window_set_buffers_cta861_3_metadata(
760 struct ANativeWindow* window,
761 const struct android_cta861_3_metadata* metadata)
762{
763 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_CTA861_3_METADATA,
764 metadata);
765}
766
767/*
Valerie Haua82679d2018-11-21 09:31:43 -0800768 * native_window_set_buffers_hdr10_plus_metadata(..., metadata)
769 * All buffers queued after this call will be associated with the
770 * HDR10+ dynamic metadata specified.
771 *
772 * metadata specifies additional dynamic information about the
773 * contents of the buffer that may affect how it is displayed. When
774 * it is nullptr, it means no such information is available. No
775 * HDR10+ dynamic emtadata is associated with the buffers by default.
776 *
777 * Parameter "size" refers to the length of the metadata blob pointed to
778 * by parameter "data". The metadata blob will adhere to the HDR10+ SEI
779 * message standard.
780 */
781static inline int native_window_set_buffers_hdr10_plus_metadata(struct ANativeWindow* window,
782 const size_t size,
783 const uint8_t* metadata) {
784 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_HDR10_PLUS_METADATA, size,
785 metadata);
786}
787
788/*
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700789 * native_window_set_buffers_transform(..., int transform)
790 * All buffers queued after this call will be displayed transformed according
791 * to the transform parameter specified.
792 */
793static inline int native_window_set_buffers_transform(
794 struct ANativeWindow* window,
795 int transform)
796{
797 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM,
798 transform);
799}
800
801/*
802 * native_window_set_buffers_sticky_transform(..., int transform)
803 * All buffers queued after this call will be displayed transformed according
804 * to the transform parameter specified applied on top of the regular buffer
805 * transform. Setting this transform will disable the transform hint.
806 *
807 * Temporary - This is only intended to be used by the LEGACY camera mode, do
808 * not use this for anything else.
809 */
810static inline int native_window_set_buffers_sticky_transform(
811 struct ANativeWindow* window,
812 int transform)
813{
814 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM,
815 transform);
816}
817
818/*
819 * native_window_set_buffers_timestamp(..., int64_t timestamp)
820 * All buffers queued after this call will be associated with the timestamp
821 * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO
822 * (the default), timestamps will be generated automatically when queueBuffer is
823 * called. The timestamp is measured in nanoseconds, and is normally monotonically
824 * increasing. The timestamp should be unaffected by time-of-day adjustments,
825 * and for a camera should be strictly monotonic but for a media player may be
826 * reset when the position is set.
827 */
828static inline int native_window_set_buffers_timestamp(
829 struct ANativeWindow* window,
830 int64_t timestamp)
831{
832 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP,
833 timestamp);
834}
835
836/*
837 * native_window_set_scaling_mode(..., int mode)
838 * All buffers queued after this call will be associated with the scaling mode
839 * specified.
840 */
841static inline int native_window_set_scaling_mode(
842 struct ANativeWindow* window,
843 int mode)
844{
845 return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE,
846 mode);
847}
848
849/*
850 * native_window_api_connect(..., int api)
851 * connects an API to this window. only one API can be connected at a time.
852 * Returns -EINVAL if for some reason the window cannot be connected, which
853 * can happen if it's connected to some other API.
854 */
855static inline int native_window_api_connect(
856 struct ANativeWindow* window, int api)
857{
858 return window->perform(window, NATIVE_WINDOW_API_CONNECT, api);
859}
860
861/*
862 * native_window_api_disconnect(..., int api)
863 * disconnect the API from this window.
864 * An error is returned if for instance the window wasn't connected in the
865 * first place.
866 */
867static inline int native_window_api_disconnect(
868 struct ANativeWindow* window, int api)
869{
870 return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api);
871}
872
873/*
874 * native_window_dequeue_buffer_and_wait(...)
875 * Dequeue a buffer and wait on the fence associated with that buffer. The
876 * buffer may safely be accessed immediately upon this function returning. An
877 * error is returned if either of the dequeue or the wait operations fail.
878 */
879static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw,
880 struct ANativeWindowBuffer** anb) {
881 return anw->dequeueBuffer_DEPRECATED(anw, anb);
882}
883
884/*
885 * native_window_set_sideband_stream(..., native_handle_t*)
886 * Attach a sideband buffer stream to a native window.
887 */
888static inline int native_window_set_sideband_stream(
889 struct ANativeWindow* window,
890 native_handle_t* sidebandHandle)
891{
892 return window->perform(window, NATIVE_WINDOW_SET_SIDEBAND_STREAM,
893 sidebandHandle);
894}
895
896/*
897 * native_window_set_surface_damage(..., android_native_rect_t* rects, int numRects)
898 * Set the surface damage (i.e., the region of the surface that has changed
899 * since the previous frame). The damage set by this call will be reset (to the
900 * default of full-surface damage) after calling queue, so this must be called
901 * prior to every frame with damage that does not cover the whole surface if the
902 * caller desires downstream consumers to use this optimization.
903 *
904 * The damage region is specified as an array of rectangles, with the important
905 * caveat that the origin of the surface is considered to be the bottom-left
906 * corner, as in OpenGL ES.
907 *
908 * If numRects is set to 0, rects may be NULL, and the surface damage will be
909 * set to the full surface (the same as if this function had not been called for
910 * this frame).
911 */
912static inline int native_window_set_surface_damage(
913 struct ANativeWindow* window,
914 const android_native_rect_t* rects, size_t numRects)
915{
916 return window->perform(window, NATIVE_WINDOW_SET_SURFACE_DAMAGE,
917 rects, numRects);
918}
919
920/*
921 * native_window_set_shared_buffer_mode(..., bool sharedBufferMode)
922 * Enable/disable shared buffer mode
923 */
924static inline int native_window_set_shared_buffer_mode(
925 struct ANativeWindow* window,
926 bool sharedBufferMode)
927{
928 return window->perform(window, NATIVE_WINDOW_SET_SHARED_BUFFER_MODE,
929 sharedBufferMode);
930}
931
932/*
933 * native_window_set_auto_refresh(..., autoRefresh)
934 * Enable/disable auto refresh when in shared buffer mode
935 */
936static inline int native_window_set_auto_refresh(
937 struct ANativeWindow* window,
938 bool autoRefresh)
939{
940 return window->perform(window, NATIVE_WINDOW_SET_AUTO_REFRESH, autoRefresh);
941}
942
943static inline int native_window_get_refresh_cycle_duration(
944 struct ANativeWindow* window,
945 int64_t* outRefreshDuration)
946{
947 return window->perform(window, NATIVE_WINDOW_GET_REFRESH_CYCLE_DURATION,
948 outRefreshDuration);
949}
950
951static inline int native_window_get_next_frame_id(
952 struct ANativeWindow* window, uint64_t* frameId)
953{
954 return window->perform(window, NATIVE_WINDOW_GET_NEXT_FRAME_ID, frameId);
955}
956
957static inline int native_window_enable_frame_timestamps(
958 struct ANativeWindow* window, bool enable)
959{
960 return window->perform(window, NATIVE_WINDOW_ENABLE_FRAME_TIMESTAMPS,
961 enable);
962}
963
964static inline int native_window_get_compositor_timing(
965 struct ANativeWindow* window,
966 int64_t* compositeDeadline, int64_t* compositeInterval,
967 int64_t* compositeToPresentLatency)
968{
969 return window->perform(window, NATIVE_WINDOW_GET_COMPOSITOR_TIMING,
970 compositeDeadline, compositeInterval, compositeToPresentLatency);
971}
972
973static inline int native_window_get_frame_timestamps(
974 struct ANativeWindow* window, uint64_t frameId,
975 int64_t* outRequestedPresentTime, int64_t* outAcquireTime,
976 int64_t* outLatchTime, int64_t* outFirstRefreshStartTime,
977 int64_t* outLastRefreshStartTime, int64_t* outGpuCompositionDoneTime,
978 int64_t* outDisplayPresentTime, int64_t* outDequeueReadyTime,
979 int64_t* outReleaseTime)
980{
981 return window->perform(window, NATIVE_WINDOW_GET_FRAME_TIMESTAMPS,
982 frameId, outRequestedPresentTime, outAcquireTime, outLatchTime,
983 outFirstRefreshStartTime, outLastRefreshStartTime,
984 outGpuCompositionDoneTime, outDisplayPresentTime,
985 outDequeueReadyTime, outReleaseTime);
986}
987
988static inline int native_window_get_wide_color_support(
989 struct ANativeWindow* window, bool* outSupport) {
Chia-I Wue2786ea2017-08-07 10:36:08 -0700990 return window->perform(window, NATIVE_WINDOW_GET_WIDE_COLOR_SUPPORT,
991 outSupport);
Mathias Agopiana6c0e202017-03-20 15:48:44 -0700992}
993
994static inline int native_window_get_hdr_support(struct ANativeWindow* window,
995 bool* outSupport) {
Chia-I Wue2786ea2017-08-07 10:36:08 -0700996 return window->perform(window, NATIVE_WINDOW_GET_HDR_SUPPORT, outSupport);
997}
998
999static inline int native_window_get_consumer_usage(struct ANativeWindow* window,
1000 uint64_t* outUsage) {
1001 return window->perform(window, NATIVE_WINDOW_GET_CONSUMER_USAGE64, outUsage);
Mathias Agopiana6c0e202017-03-20 15:48:44 -07001002}
1003
Yiwei Zhang538cedc2019-06-24 19:35:03 -07001004/*
1005 * native_window_set_auto_prerotation(..., autoPrerotation)
1006 * Enable/disable the auto prerotation at buffer allocation when the buffer size
1007 * is driven by the consumer.
1008 *
1009 * When buffer size is driven by the consumer and the transform hint specifies
1010 * a 90 or 270 degree rotation, if auto prerotation is enabled, the width and
1011 * height used for dequeueBuffer will be additionally swapped.
1012 */
1013static inline int native_window_set_auto_prerotation(struct ANativeWindow* window,
1014 bool autoPrerotation) {
1015 return window->perform(window, NATIVE_WINDOW_SET_AUTO_PREROTATION, autoPrerotation);
1016}
1017
Steven Thomas62a4cf82020-01-31 12:04:03 -08001018static inline int native_window_set_frame_rate(struct ANativeWindow* window, float frameRate,
1019 int8_t compatibility) {
1020 return window->perform(window, NATIVE_WINDOW_SET_FRAME_RATE, (double)frameRate,
1021 (int)compatibility);
Steven Thomas3172e202020-01-06 19:25:30 -08001022}
1023
Alec Mourief0b1532019-12-17 09:39:07 -08001024// ------------------------------------------------------------------------------------------------
1025// Candidates for APEX visibility
1026// These functions are planned to be made stable for APEX modules, but have not
1027// yet been stabilized to a specific api version.
1028// ------------------------------------------------------------------------------------------------
1029
1030/**
1031 * Retrieves the last queued buffer for this window, along with the fence that
1032 * fires when the buffer is ready to be read, and the 4x4 coordinate
1033 * transform matrix that should be applied to the buffer's content. The
1034 * transform matrix is represented in column-major order.
1035 *
1036 * If there was no buffer previously queued, then outBuffer will be NULL and
1037 * the value of outFence will be -1.
1038 *
1039 * Note that if outBuffer is not NULL, then the caller will hold a reference
1040 * onto the buffer. Accordingly, the caller must call AHardwareBuffer_release
1041 * when the buffer is no longer needed so that the system may reclaim the
1042 * buffer.
1043 *
1044 * \return NO_ERROR on success.
1045 * \return NO_MEMORY if there was insufficient memory.
1046 */
1047static inline int ANativeWindow_getLastQueuedBuffer(ANativeWindow* window,
1048 AHardwareBuffer** outBuffer, int* outFence,
1049 float outTransformMatrix[16]) {
1050 return window->perform(window, NATIVE_WINDOW_GET_LAST_QUEUED_BUFFER, outBuffer, outFence,
1051 outTransformMatrix);
1052}
1053
Mathias Agopiana6c0e202017-03-20 15:48:44 -07001054__END_DECLS