blob: af0418be81eaca6f05ad0e9aa1a88a0f13739242 [file] [log] [blame]
Iliyan Malchev0ab886b2011-05-01 14:07:43 -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#ifndef SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
18#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
19
Jamie Gennis22aec572012-06-13 16:43:06 -070020#include <cutils/native_handle.h>
Jesse Hallbc930ed2012-10-01 13:48:36 -070021#include <errno.h>
Jamie Gennis22aec572012-06-13 16:43:06 -070022#include <limits.h>
Iliyan Malchev0ab886b2011-05-01 14:07:43 -070023#include <stdint.h>
Mathias Agopianc958a7f2012-02-25 21:13:36 -080024#include <string.h>
Iliyan Malchev0ab886b2011-05-01 14:07:43 -070025#include <sys/cdefs.h>
26#include <system/graphics.h>
Jamie Gennis22aec572012-06-13 16:43:06 -070027#include <unistd.h>
Iliyan Malchev0ab886b2011-05-01 14:07:43 -070028
Ian Rogersde8b9832014-06-27 16:38:01 -070029#ifndef __UNUSED
30#define __UNUSED __attribute__((__unused__))
Mark Salyzyn48878422014-05-22 16:08:52 -070031#endif
Mark Salyzyn289e1112014-05-23 12:31:42 -070032#ifndef __deprecated
33#define __deprecated __attribute__((__deprecated__))
34#endif
Mark Salyzyn48878422014-05-22 16:08:52 -070035
Iliyan Malchev0ab886b2011-05-01 14:07:43 -070036__BEGIN_DECLS
37
38/*****************************************************************************/
39
40#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \
41 (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d))
42
43#define ANDROID_NATIVE_WINDOW_MAGIC \
44 ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d')
45
46#define ANDROID_NATIVE_BUFFER_MAGIC \
47 ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r')
48
49// ---------------------------------------------------------------------------
50
Jamie Gennis22aec572012-06-13 16:43:06 -070051// This #define may be used to conditionally compile device-specific code to
52// support either the prior ANativeWindow interface, which did not pass libsync
53// fences around, or the new interface that does. This #define is only present
54// when the ANativeWindow interface does include libsync support.
55#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1
56
57// ---------------------------------------------------------------------------
58
Iliyan Malchev0ab886b2011-05-01 14:07:43 -070059typedef const native_handle_t* buffer_handle_t;
60
61// ---------------------------------------------------------------------------
62
63typedef struct android_native_rect_t
64{
65 int32_t left;
66 int32_t top;
67 int32_t right;
68 int32_t bottom;
69} android_native_rect_t;
70
71// ---------------------------------------------------------------------------
72
73typedef struct android_native_base_t
74{
75 /* a magic value defined by the actual EGL native type */
76 int magic;
77
78 /* the sizeof() of the actual EGL native type */
79 int version;
80
81 void* reserved[4];
82
83 /* reference-counting interface */
84 void (*incRef)(struct android_native_base_t* base);
85 void (*decRef)(struct android_native_base_t* base);
86} android_native_base_t;
87
88typedef struct ANativeWindowBuffer
89{
90#ifdef __cplusplus
91 ANativeWindowBuffer() {
92 common.magic = ANDROID_NATIVE_BUFFER_MAGIC;
93 common.version = sizeof(ANativeWindowBuffer);
94 memset(common.reserved, 0, sizeof(common.reserved));
95 }
96
97 // Implement the methods that sp<ANativeWindowBuffer> expects so that it
98 // can be used to automatically refcount ANativeWindowBuffer's.
Mark Salyzyn48878422014-05-22 16:08:52 -070099 void incStrong(const void* /*id*/) const {
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700100 common.incRef(const_cast<android_native_base_t*>(&common));
101 }
Mark Salyzyn48878422014-05-22 16:08:52 -0700102 void decStrong(const void* /*id*/) const {
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700103 common.decRef(const_cast<android_native_base_t*>(&common));
104 }
105#endif
106
107 struct android_native_base_t common;
108
109 int width;
110 int height;
111 int stride;
112 int format;
113 int usage;
114
115 void* reserved[2];
116
117 buffer_handle_t handle;
118
119 void* reserved_proc[8];
120} ANativeWindowBuffer_t;
121
122// Old typedef for backwards compatibility.
123typedef ANativeWindowBuffer_t android_native_buffer_t;
124
125// ---------------------------------------------------------------------------
126
127/* attributes queriable with query() */
128enum {
129 NATIVE_WINDOW_WIDTH = 0,
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700130 NATIVE_WINDOW_HEIGHT = 1,
131 NATIVE_WINDOW_FORMAT = 2,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700132
133 /* The minimum number of buffers that must remain un-dequeued after a buffer
134 * has been queued. This value applies only if set_buffer_count was used to
135 * override the number of buffers and if a buffer has since been queued.
136 * Users of the set_buffer_count ANativeWindow method should query this
137 * value before calling set_buffer_count. If it is necessary to have N
138 * buffers simultaneously dequeued as part of the steady-state operation,
139 * and this query returns M then N+M buffers should be requested via
140 * native_window_set_buffer_count.
141 *
142 * Note that this value does NOT apply until a single buffer has been
143 * queued. In particular this means that it is possible to:
144 *
145 * 1. Query M = min undequeued buffers
146 * 2. Set the buffer count to N + M
147 * 3. Dequeue all N + M buffers
148 * 4. Cancel M buffers
149 * 5. Queue, dequeue, queue, dequeue, ad infinitum
150 */
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700151 NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700152
153 /* Check whether queueBuffer operations on the ANativeWindow send the buffer
154 * to the window compositor. The query sets the returned 'value' argument
155 * to 1 if the ANativeWindow DOES send queued buffers directly to the window
156 * compositor and 0 if the buffers do not go directly to the window
157 * compositor.
158 *
159 * This can be used to determine whether protected buffer content should be
160 * sent to the ANativeWindow. Note, however, that a result of 1 does NOT
161 * indicate that queued buffers will be protected from applications or users
162 * capturing their contents. If that behavior is desired then some other
163 * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in
164 * conjunction with this query.
165 */
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700166 NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700167
168 /* Get the concrete type of a ANativeWindow. See below for the list of
169 * possible return values.
170 *
171 * This query should not be used outside the Android framework and will
172 * likely be removed in the near future.
173 */
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700174 NATIVE_WINDOW_CONCRETE_TYPE = 5,
Mathias Agopian51009162011-07-19 15:59:15 -0700175
176
177 /*
Michael I. Goldafcdef62012-04-09 18:21:13 -0700178 * Default width and height of ANativeWindow buffers, these are the
179 * dimensions of the window buffers irrespective of the
180 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window
Jamie Gennisaa3f4c32012-04-17 19:37:48 -0700181 * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS.
Mathias Agopian51009162011-07-19 15:59:15 -0700182 */
183 NATIVE_WINDOW_DEFAULT_WIDTH = 6,
184 NATIVE_WINDOW_DEFAULT_HEIGHT = 7,
185
186 /*
187 * transformation that will most-likely be applied to buffers. This is only
188 * a hint, the actual transformation applied might be different.
189 *
190 * INTENDED USE:
191 *
192 * The transform hint can be used by a producer, for instance the GLES
193 * driver, to pre-rotate the rendering such that the final transformation
194 * in the composer is identity. This can be very useful when used in
195 * conjunction with the h/w composer HAL, in situations where it
196 * cannot handle arbitrary rotations.
197 *
198 * 1. Before dequeuing a buffer, the GL driver (or any other ANW client)
199 * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT.
200 *
201 * 2. The GL driver overrides the width and height of the ANW to
202 * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying
203 * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions
204 * according to NATIVE_WINDOW_TRANSFORM_HINT and calling
205 * native_window_set_buffers_dimensions().
206 *
207 * 3. The GL driver dequeues a buffer of the new pre-rotated size.
208 *
209 * 4. The GL driver renders to the buffer such that the image is
210 * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT
211 * to the rendering.
212 *
213 * 5. The GL driver calls native_window_set_transform to apply
214 * inverse transformation to the buffer it just rendered.
215 * In order to do this, the GL driver needs
216 * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is
217 * done easily:
218 *
219 * int hintTransform, inverseTransform;
220 * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform);
221 * inverseTransform = hintTransform;
222 * if (hintTransform & HAL_TRANSFORM_ROT_90)
223 * inverseTransform ^= HAL_TRANSFORM_ROT_180;
224 *
225 *
226 * 6. The GL driver queues the pre-transformed buffer.
227 *
228 * 7. The composer combines the buffer transform with the display
229 * transform. If the buffer transform happens to cancel out the
230 * display transform then no rotation is needed.
231 *
232 */
233 NATIVE_WINDOW_TRANSFORM_HINT = 8,
Jamie Gennisaa3f4c32012-04-17 19:37:48 -0700234
235 /*
236 * Boolean that indicates whether the consumer is running more than
237 * one buffer behind the producer.
238 */
Eino-Ville Talvalaf88a5b42013-07-30 14:07:08 -0700239 NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9,
240
241 /*
242 * The consumer gralloc usage bits currently set by the consumer.
243 * The values are defined in hardware/libhardware/include/gralloc.h.
244 */
Ruben Brunka5e65d82014-06-27 16:15:18 -0700245 NATIVE_WINDOW_CONSUMER_USAGE_BITS = 10,
246
247 /**
248 * Transformation that will by applied to buffers by the hwcomposer.
249 * This must not be set or checked by producer endpoints, and will
250 * disable the transform hint set in SurfaceFlinger (see
251 * NATIVE_WINDOW_TRANSFORM_HINT).
252 *
253 * INTENDED USE:
254 * Temporary - Please do not use this. This is intended only to be used
255 * by the camera's LEGACY mode.
256 *
257 * In situations where a SurfaceFlinger client wishes to set a transform
258 * that is not visible to the producer, and will always be applied in the
259 * hardware composer, the client can set this flag with
260 * native_window_set_buffers_sticky_transform. This can be used to rotate
261 * and flip buffers consumed by hardware composer without actually changing
262 * the aspect ratio of the buffers produced.
263 */
264 NATIVE_WINDOW_STICKY_TRANSFORM = 11,
Eino-Ville Talvalab93343d2015-02-17 15:34:44 -0800265
266 /**
267 * The default data space for the buffers as set by the consumer.
268 * The values are defined in graphics.h.
269 */
270 NATIVE_WINDOW_DEFAULT_DATASPACE = 12
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700271};
272
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700273/* Valid operations for the (*perform)() hook.
274 *
275 * Values marked as 'deprecated' are supported, but have been superceded by
276 * other functionality.
277 *
278 * Values marked as 'private' should be considered private to the framework.
279 * HAL implementation code with access to an ANativeWindow should not use these,
280 * as it may not interact properly with the framework's use of the
281 * ANativeWindow.
282 */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700283enum {
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700284 NATIVE_WINDOW_SET_USAGE = 0,
Mathias Agopian8ad54522011-07-29 17:52:36 -0700285 NATIVE_WINDOW_CONNECT = 1, /* deprecated */
286 NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700287 NATIVE_WINDOW_SET_CROP = 3, /* private */
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700288 NATIVE_WINDOW_SET_BUFFER_COUNT = 4,
289 NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */
290 NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6,
291 NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7,
292 NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8,
293 NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9,
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700294 NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */
Mathias Agopianae3736a2011-07-13 18:40:38 -0700295 NATIVE_WINDOW_LOCK = 11, /* private */
296 NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */
Mathias Agopian8ad54522011-07-29 17:52:36 -0700297 NATIVE_WINDOW_API_CONNECT = 13, /* private */
298 NATIVE_WINDOW_API_DISCONNECT = 14, /* private */
Michael I. Goldafcdef62012-04-09 18:21:13 -0700299 NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */
Jamie Gennisd21113a2012-05-03 14:21:24 -0700300 NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */
Ruben Brunka5e65d82014-06-27 16:15:18 -0700301 NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM = 17,/* private */
Rachadd6d4c612014-07-29 18:03:21 -0700302 NATIVE_WINDOW_SET_SIDEBAND_STREAM = 18,
Eino-Ville Talvalab93343d2015-02-17 15:34:44 -0800303 NATIVE_WINDOW_SET_BUFFERS_DATASPACE = 19
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700304};
305
Mathias Agopian8ad54522011-07-29 17:52:36 -0700306/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700307enum {
Jamie Gennis5423e9e2011-07-12 13:53:42 -0700308 /* Buffers will be queued by EGL via eglSwapBuffers after being filled using
309 * OpenGL ES.
310 */
311 NATIVE_WINDOW_API_EGL = 1,
312
313 /* Buffers will be queued after being filled using the CPU
314 */
315 NATIVE_WINDOW_API_CPU = 2,
316
317 /* Buffers will be queued by Stagefright after being filled by a video
318 * decoder. The video decoder can either be a software or hardware decoder.
319 */
320 NATIVE_WINDOW_API_MEDIA = 3,
321
322 /* Buffers will be queued by the the camera HAL.
323 */
324 NATIVE_WINDOW_API_CAMERA = 4,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700325};
326
327/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */
328enum {
329 /* flip source image horizontally */
330 NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H ,
331 /* flip source image vertically */
332 NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
Mathias Agopian96675ed2013-09-17 23:48:54 -0700333 /* rotate source image 90 degrees clock-wise, and is applied after TRANSFORM_FLIP_{H|V} */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700334 NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
335 /* rotate source image 180 degrees */
336 NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
337 /* rotate source image 270 degrees clock-wise */
338 NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
Mathias Agopian96675ed2013-09-17 23:48:54 -0700339 /* transforms source by the inverse transform of the screen it is displayed onto. This
340 * transform is applied last */
341 NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY = 0x08
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700342};
343
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700344/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */
345enum {
346 /* the window content is not updated (frozen) until a buffer of
347 * the window size is received (enqueued)
348 */
349 NATIVE_WINDOW_SCALING_MODE_FREEZE = 0,
350 /* the buffer is scaled in both dimensions to match the window size */
351 NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1,
Daniel Lam29392a42012-04-11 18:19:46 -0700352 /* the buffer is scaled uniformly such that the smaller dimension
353 * of the buffer matches the window size (cropping in the process)
354 */
355 NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2,
Jamie Gennisd21113a2012-05-03 14:21:24 -0700356 /* the window is clipped to the size of the buffer's crop rectangle; pixels
357 * outside the crop rectangle are treated as if they are completely
358 * transparent.
359 */
360 NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3,
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700361};
362
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700363/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */
364enum {
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700365 NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */
366 NATIVE_WINDOW_SURFACE = 1, /* Surface */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700367};
368
369/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP
370 *
371 * Special timestamp value to indicate that timestamps should be auto-generated
372 * by the native window when queueBuffer is called. This is equal to INT64_MIN,
373 * defined directly to avoid problems with C99/C++ inclusion of stdint.h.
374 */
375static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1);
376
377struct ANativeWindow
378{
379#ifdef __cplusplus
380 ANativeWindow()
381 : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0)
382 {
383 common.magic = ANDROID_NATIVE_WINDOW_MAGIC;
384 common.version = sizeof(ANativeWindow);
385 memset(common.reserved, 0, sizeof(common.reserved));
386 }
387
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700388 /* Implement the methods that sp<ANativeWindow> expects so that it
389 can be used to automatically refcount ANativeWindow's. */
Mark Salyzyn48878422014-05-22 16:08:52 -0700390 void incStrong(const void* /*id*/) const {
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700391 common.incRef(const_cast<android_native_base_t*>(&common));
392 }
Mark Salyzyn48878422014-05-22 16:08:52 -0700393 void decStrong(const void* /*id*/) const {
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700394 common.decRef(const_cast<android_native_base_t*>(&common));
395 }
396#endif
397
398 struct android_native_base_t common;
399
400 /* flags describing some attributes of this surface or its updater */
401 const uint32_t flags;
402
403 /* min swap interval supported by this updated */
404 const int minSwapInterval;
405
406 /* max swap interval supported by this updated */
407 const int maxSwapInterval;
408
409 /* horizontal and vertical resolution in DPI */
410 const float xdpi;
411 const float ydpi;
412
413 /* Some storage reserved for the OEM's driver. */
414 intptr_t oem[4];
415
416 /*
417 * Set the swap interval for this surface.
418 *
419 * Returns 0 on success or -errno on error.
420 */
421 int (*setSwapInterval)(struct ANativeWindow* window,
422 int interval);
423
424 /*
Jesse Hall7cd3e0a2011-12-12 10:32:55 -0800425 * Hook called by EGL to acquire a buffer. After this call, the buffer
426 * is not locked, so its content cannot be modified. This call may block if
427 * no buffers are available.
428 *
429 * The window holds a reference to the buffer between dequeueBuffer and
430 * either queueBuffer or cancelBuffer, so clients only need their own
431 * reference if they might use the buffer after queueing or canceling it.
432 * Holding a reference to a buffer after queueing or canceling it is only
433 * allowed if a specific buffer count has been set.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700434 *
435 * Returns 0 on success or -errno on error.
Jamie Gennis22aec572012-06-13 16:43:06 -0700436 *
437 * XXX: This function is deprecated. It will continue to work for some
438 * time for binary compatibility, but the new dequeueBuffer function that
439 * outputs a fence file descriptor should be used in its place.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700440 */
Jamie Gennis22aec572012-06-13 16:43:06 -0700441 int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700442 struct ANativeWindowBuffer** buffer);
443
444 /*
445 * hook called by EGL to lock a buffer. This MUST be called before modifying
446 * the content of a buffer. The buffer must have been acquired with
447 * dequeueBuffer first.
448 *
449 * Returns 0 on success or -errno on error.
Jamie Gennis22aec572012-06-13 16:43:06 -0700450 *
451 * XXX: This function is deprecated. It will continue to work for some
452 * time for binary compatibility, but it is essentially a no-op, and calls
453 * to it should be removed.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700454 */
Jamie Gennis22aec572012-06-13 16:43:06 -0700455 int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700456 struct ANativeWindowBuffer* buffer);
Jamie Gennis22aec572012-06-13 16:43:06 -0700457
Jesse Hall7cd3e0a2011-12-12 10:32:55 -0800458 /*
459 * Hook called by EGL when modifications to the render buffer are done.
460 * This unlocks and post the buffer.
461 *
462 * The window holds a reference to the buffer between dequeueBuffer and
463 * either queueBuffer or cancelBuffer, so clients only need their own
464 * reference if they might use the buffer after queueing or canceling it.
465 * Holding a reference to a buffer after queueing or canceling it is only
466 * allowed if a specific buffer count has been set.
467 *
468 * Buffers MUST be queued in the same order than they were dequeued.
469 *
470 * Returns 0 on success or -errno on error.
Jamie Gennis22aec572012-06-13 16:43:06 -0700471 *
472 * XXX: This function is deprecated. It will continue to work for some
473 * time for binary compatibility, but the new queueBuffer function that
474 * takes a fence file descriptor should be used in its place (pass a value
475 * of -1 for the fence file descriptor if there is no valid one to pass).
Jesse Hall7cd3e0a2011-12-12 10:32:55 -0800476 */
Jamie Gennis22aec572012-06-13 16:43:06 -0700477 int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700478 struct ANativeWindowBuffer* buffer);
479
480 /*
481 * hook used to retrieve information about the native window.
482 *
483 * Returns 0 on success or -errno on error.
484 */
485 int (*query)(const struct ANativeWindow* window,
486 int what, int* value);
487
488 /*
489 * hook used to perform various operations on the surface.
490 * (*perform)() is a generic mechanism to add functionality to
491 * ANativeWindow while keeping backward binary compatibility.
492 *
493 * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions
494 * defined below.
495 *
496 * (*perform)() returns -ENOENT if the 'what' parameter is not supported
497 * by the surface's implementation.
498 *
499 * The valid operations are:
500 * NATIVE_WINDOW_SET_USAGE
Mathias Agopian8ad54522011-07-29 17:52:36 -0700501 * NATIVE_WINDOW_CONNECT (deprecated)
502 * NATIVE_WINDOW_DISCONNECT (deprecated)
Jamie Gennis190b6e22012-04-30 16:32:06 -0700503 * NATIVE_WINDOW_SET_CROP (private)
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700504 * NATIVE_WINDOW_SET_BUFFER_COUNT
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700505 * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated)
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700506 * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM
507 * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP
Eino-Ville Talvalab93343d2015-02-17 15:34:44 -0800508 * NATIVE_WINDOW_SET_BUFFERS_DATASPACE
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700509 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS
510 * NATIVE_WINDOW_SET_BUFFERS_FORMAT
Jamie Gennis190b6e22012-04-30 16:32:06 -0700511 * NATIVE_WINDOW_SET_SCALING_MODE (private)
Mathias Agopianae3736a2011-07-13 18:40:38 -0700512 * NATIVE_WINDOW_LOCK (private)
513 * NATIVE_WINDOW_UNLOCK_AND_POST (private)
Mathias Agopian8ad54522011-07-29 17:52:36 -0700514 * NATIVE_WINDOW_API_CONNECT (private)
515 * NATIVE_WINDOW_API_DISCONNECT (private)
Michael I. Goldafcdef62012-04-09 18:21:13 -0700516 * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private)
Jamie Gennisd21113a2012-05-03 14:21:24 -0700517 * NATIVE_WINDOW_SET_POST_TRANSFORM_CROP (private)
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700518 *
519 */
520
521 int (*perform)(struct ANativeWindow* window,
522 int operation, ... );
523
524 /*
Jesse Hall7cd3e0a2011-12-12 10:32:55 -0800525 * Hook used to cancel a buffer that has been dequeued.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700526 * No synchronization is performed between dequeue() and cancel(), so
527 * either external synchronization is needed, or these functions must be
528 * called from the same thread.
Jesse Hall7cd3e0a2011-12-12 10:32:55 -0800529 *
530 * The window holds a reference to the buffer between dequeueBuffer and
531 * either queueBuffer or cancelBuffer, so clients only need their own
532 * reference if they might use the buffer after queueing or canceling it.
533 * Holding a reference to a buffer after queueing or canceling it is only
534 * allowed if a specific buffer count has been set.
Jamie Gennis22aec572012-06-13 16:43:06 -0700535 *
536 * XXX: This function is deprecated. It will continue to work for some
537 * time for binary compatibility, but the new cancelBuffer function that
538 * takes a fence file descriptor should be used in its place (pass a value
539 * of -1 for the fence file descriptor if there is no valid one to pass).
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700540 */
Jamie Gennis22aec572012-06-13 16:43:06 -0700541 int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700542 struct ANativeWindowBuffer* buffer);
543
Jamie Gennis22aec572012-06-13 16:43:06 -0700544 /*
545 * Hook called by EGL to acquire a buffer. This call may block if no
546 * buffers are available.
547 *
548 * The window holds a reference to the buffer between dequeueBuffer and
549 * either queueBuffer or cancelBuffer, so clients only need their own
550 * reference if they might use the buffer after queueing or canceling it.
551 * Holding a reference to a buffer after queueing or canceling it is only
552 * allowed if a specific buffer count has been set.
553 *
554 * The libsync fence file descriptor returned in the int pointed to by the
555 * fenceFd argument will refer to the fence that must signal before the
556 * dequeued buffer may be written to. A value of -1 indicates that the
557 * caller may access the buffer immediately without waiting on a fence. If
558 * a valid file descriptor is returned (i.e. any value except -1) then the
559 * caller is responsible for closing the file descriptor.
560 *
561 * Returns 0 on success or -errno on error.
562 */
563 int (*dequeueBuffer)(struct ANativeWindow* window,
564 struct ANativeWindowBuffer** buffer, int* fenceFd);
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700565
Jamie Gennis22aec572012-06-13 16:43:06 -0700566 /*
567 * Hook called by EGL when modifications to the render buffer are done.
568 * This unlocks and post the buffer.
569 *
570 * The window holds a reference to the buffer between dequeueBuffer and
571 * either queueBuffer or cancelBuffer, so clients only need their own
572 * reference if they might use the buffer after queueing or canceling it.
573 * Holding a reference to a buffer after queueing or canceling it is only
574 * allowed if a specific buffer count has been set.
575 *
576 * The fenceFd argument specifies a libsync fence file descriptor for a
577 * fence that must signal before the buffer can be accessed. If the buffer
578 * can be accessed immediately then a value of -1 should be used. The
579 * caller must not use the file descriptor after it is passed to
580 * queueBuffer, and the ANativeWindow implementation is responsible for
581 * closing it.
582 *
583 * Returns 0 on success or -errno on error.
584 */
585 int (*queueBuffer)(struct ANativeWindow* window,
586 struct ANativeWindowBuffer* buffer, int fenceFd);
587
588 /*
589 * Hook used to cancel a buffer that has been dequeued.
590 * No synchronization is performed between dequeue() and cancel(), so
591 * either external synchronization is needed, or these functions must be
592 * called from the same thread.
593 *
594 * The window holds a reference to the buffer between dequeueBuffer and
595 * either queueBuffer or cancelBuffer, so clients only need their own
596 * reference if they might use the buffer after queueing or canceling it.
597 * Holding a reference to a buffer after queueing or canceling it is only
598 * allowed if a specific buffer count has been set.
599 *
600 * The fenceFd argument specifies a libsync fence file decsriptor for a
601 * fence that must signal before the buffer can be accessed. If the buffer
602 * can be accessed immediately then a value of -1 should be used.
603 *
604 * Note that if the client has not waited on the fence that was returned
605 * from dequeueBuffer, that same fence should be passed to cancelBuffer to
606 * ensure that future uses of the buffer are preceded by a wait on that
607 * fence. The caller must not use the file descriptor after it is passed
608 * to cancelBuffer, and the ANativeWindow implementation is responsible for
609 * closing it.
610 *
611 * Returns 0 on success or -errno on error.
612 */
613 int (*cancelBuffer)(struct ANativeWindow* window,
614 struct ANativeWindowBuffer* buffer, int fenceFd);
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700615};
616
617 /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C).
618 * android_native_window_t is deprecated.
619 */
620typedef struct ANativeWindow ANativeWindow;
Mark Salyzyn289e1112014-05-23 12:31:42 -0700621typedef struct ANativeWindow android_native_window_t __deprecated;
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700622
623/*
624 * native_window_set_usage(..., usage)
625 * Sets the intended usage flags for the next buffers
626 * acquired with (*lockBuffer)() and on.
627 * By default (if this function is never called), a usage of
628 * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE
629 * is assumed.
630 * Calling this function will usually cause following buffers to be
631 * reallocated.
632 */
633
634static inline int native_window_set_usage(
635 struct ANativeWindow* window, int usage)
636{
637 return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage);
638}
639
Mathias Agopian8ad54522011-07-29 17:52:36 -0700640/* deprecated. Always returns 0. Don't call. */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700641static inline int native_window_connect(
Ian Rogersde8b9832014-06-27 16:38:01 -0700642 struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
Mark Salyzyn289e1112014-05-23 12:31:42 -0700643
644static inline int native_window_connect(
Ian Rogersde8b9832014-06-27 16:38:01 -0700645 struct ANativeWindow* window __UNUSED, int api __UNUSED) {
Mathias Agopian319f4e22011-08-03 11:26:38 -0700646 return 0;
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700647}
648
Mathias Agopian8ad54522011-07-29 17:52:36 -0700649/* deprecated. Always returns 0. Don't call. */
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700650static inline int native_window_disconnect(
Ian Rogersde8b9832014-06-27 16:38:01 -0700651 struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
Mark Salyzyn289e1112014-05-23 12:31:42 -0700652
653static inline int native_window_disconnect(
Ian Rogersde8b9832014-06-27 16:38:01 -0700654 struct ANativeWindow* window __UNUSED, int api __UNUSED) {
Mathias Agopian319f4e22011-08-03 11:26:38 -0700655 return 0;
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700656}
657
658/*
659 * native_window_set_crop(..., crop)
660 * Sets which region of the next queued buffers needs to be considered.
Jamie Gennisd21113a2012-05-03 14:21:24 -0700661 * Depending on the scaling mode, a buffer's crop region is scaled and/or
662 * cropped to match the surface's size. This function sets the crop in
663 * pre-transformed buffer pixel coordinates.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700664 *
665 * The specified crop region applies to all buffers queued after it is called.
666 *
Jamie Gennisd21113a2012-05-03 14:21:24 -0700667 * If 'crop' is NULL, subsequently queued buffers won't be cropped.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700668 *
Jamie Gennisd21113a2012-05-03 14:21:24 -0700669 * An error is returned if for instance the crop region is invalid, out of the
670 * buffer's bound or if the window is invalid.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700671 */
672static inline int native_window_set_crop(
673 struct ANativeWindow* window,
674 android_native_rect_t const * crop)
675{
676 return window->perform(window, NATIVE_WINDOW_SET_CROP, crop);
677}
678
679/*
Jamie Gennisd21113a2012-05-03 14:21:24 -0700680 * native_window_set_post_transform_crop(..., crop)
681 * Sets which region of the next queued buffers needs to be considered.
682 * Depending on the scaling mode, a buffer's crop region is scaled and/or
683 * cropped to match the surface's size. This function sets the crop in
684 * post-transformed pixel coordinates.
685 *
686 * The specified crop region applies to all buffers queued after it is called.
687 *
688 * If 'crop' is NULL, subsequently queued buffers won't be cropped.
689 *
690 * An error is returned if for instance the crop region is invalid, out of the
691 * buffer's bound or if the window is invalid.
692 */
693static inline int native_window_set_post_transform_crop(
694 struct ANativeWindow* window,
695 android_native_rect_t const * crop)
696{
697 return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop);
698}
699
700/*
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700701 * native_window_set_active_rect(..., active_rect)
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700702 *
Jamie Gennis22aec572012-06-13 16:43:06 -0700703 * This function is deprecated and will be removed soon. For now it simply
Jamie Gennisd21113a2012-05-03 14:21:24 -0700704 * sets the post-transform crop for compatibility while multi-project commits
705 * get checked.
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700706 */
707static inline int native_window_set_active_rect(
708 struct ANativeWindow* window,
Mark Salyzyn289e1112014-05-23 12:31:42 -0700709 android_native_rect_t const * active_rect) __deprecated;
710
711static inline int native_window_set_active_rect(
712 struct ANativeWindow* window,
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700713 android_native_rect_t const * active_rect)
714{
Jamie Gennisd21113a2012-05-03 14:21:24 -0700715 return native_window_set_post_transform_crop(window, active_rect);
Jamie Gennisfb1ee572012-04-17 19:37:48 -0700716}
717
718/*
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700719 * native_window_set_buffer_count(..., count)
720 * Sets the number of buffers associated with this native window.
721 */
722static inline int native_window_set_buffer_count(
723 struct ANativeWindow* window,
724 size_t bufferCount)
725{
726 return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount);
727}
728
729/*
730 * native_window_set_buffers_geometry(..., int w, int h, int format)
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700731 * All buffers dequeued after this call will have the dimensions and format
732 * specified. A successful call to this function has the same effect as calling
733 * native_window_set_buffers_size and native_window_set_buffers_format.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700734 *
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700735 * XXX: This function is deprecated. The native_window_set_buffers_dimensions
736 * and native_window_set_buffers_format functions should be used instead.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700737 */
738static inline int native_window_set_buffers_geometry(
739 struct ANativeWindow* window,
Mark Salyzyn289e1112014-05-23 12:31:42 -0700740 int w, int h, int format) __deprecated;
741
742static inline int native_window_set_buffers_geometry(
743 struct ANativeWindow* window,
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700744 int w, int h, int format)
745{
746 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY,
747 w, h, format);
748}
749
750/*
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700751 * native_window_set_buffers_dimensions(..., int w, int h)
752 * All buffers dequeued after this call will have the dimensions specified.
Michael I. Goldafcdef62012-04-09 18:21:13 -0700753 * In particular, all buffers will have a fixed-size, independent from the
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700754 * native-window size. They will be scaled according to the scaling mode
755 * (see native_window_set_scaling_mode) upon window composition.
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700756 *
757 * If w and h are 0, the normal behavior is restored. That is, dequeued buffers
758 * following this call will be sized to match the window's size.
759 *
760 * Calling this function will reset the window crop to a NULL value, which
761 * disables cropping of the buffers.
762 */
763static inline int native_window_set_buffers_dimensions(
764 struct ANativeWindow* window,
765 int w, int h)
766{
767 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS,
768 w, h);
769}
770
771/*
Michael I. Goldafcdef62012-04-09 18:21:13 -0700772 * native_window_set_buffers_user_dimensions(..., int w, int h)
773 *
774 * Sets the user buffer size for the window, which overrides the
775 * window's size. All buffers dequeued after this call will have the
776 * dimensions specified unless overridden by
777 * native_window_set_buffers_dimensions. All buffers will have a
778 * fixed-size, independent from the native-window size. They will be
779 * scaled according to the scaling mode (see
780 * native_window_set_scaling_mode) upon window composition.
781 *
782 * If w and h are 0, the normal behavior is restored. That is, the
783 * default buffer size will match the windows's size.
784 *
785 * Calling this function will reset the window crop to a NULL value, which
786 * disables cropping of the buffers.
787 */
788static inline int native_window_set_buffers_user_dimensions(
789 struct ANativeWindow* window,
790 int w, int h)
791{
792 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS,
793 w, h);
794}
795
796/*
Jamie Gennis208ec5e2011-07-07 11:51:48 -0700797 * native_window_set_buffers_format(..., int format)
798 * All buffers dequeued after this call will have the format specified.
799 *
800 * If the specified format is 0, the default buffer format will be used.
801 */
802static inline int native_window_set_buffers_format(
803 struct ANativeWindow* window,
804 int format)
805{
806 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format);
807}
808
809/*
Eino-Ville Talvalab93343d2015-02-17 15:34:44 -0800810 * native_window_set_buffers_data_space(..., int dataSpace)
811 * All buffers queued after this call will be associated with the dataSpace
812 * parameter specified.
813 *
814 * dataSpace specifies additional information about the buffer that's dependent
815 * on the buffer format and the endpoints. For example, it can be used to convey
816 * the color space of the image data in the buffer, or it can be used to
817 * indicate that the buffers contain depth measurement data instead of color
818 * images. The default dataSpace is 0, HAL_DATASPACE_UNKNOWN, unless it has been
819 * overridden by the consumer.
820 */
821static inline int native_window_set_buffers_data_space(
822 struct ANativeWindow* window,
823 android_dataspace_t dataSpace)
824{
825 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DATASPACE,
826 dataSpace);
827}
828
829/*
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700830 * native_window_set_buffers_transform(..., int transform)
831 * All buffers queued after this call will be displayed transformed according
832 * to the transform parameter specified.
833 */
834static inline int native_window_set_buffers_transform(
835 struct ANativeWindow* window,
836 int transform)
837{
838 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM,
839 transform);
840}
841
842/*
Ruben Brunka5e65d82014-06-27 16:15:18 -0700843 * native_window_set_buffers_sticky_transform(..., int transform)
844 * All buffers queued after this call will be displayed transformed according
845 * to the transform parameter specified applied on top of the regular buffer
846 * transform. Setting this transform will disable the transform hint.
847 *
848 * Temporary - This is only intended to be used by the LEGACY camera mode, do
849 * not use this for anything else.
850 */
851static inline int native_window_set_buffers_sticky_transform(
852 struct ANativeWindow* window,
853 int transform)
854{
855 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM,
856 transform);
857}
858
859/*
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700860 * native_window_set_buffers_timestamp(..., int64_t timestamp)
861 * All buffers queued after this call will be associated with the timestamp
862 * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO
863 * (the default), timestamps will be generated automatically when queueBuffer is
Glenn Kastenc322f672011-06-27 10:42:39 -0700864 * called. The timestamp is measured in nanoseconds, and is normally monotonically
865 * increasing. The timestamp should be unaffected by time-of-day adjustments,
866 * and for a camera should be strictly monotonic but for a media player may be
867 * reset when the position is set.
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700868 */
869static inline int native_window_set_buffers_timestamp(
870 struct ANativeWindow* window,
871 int64_t timestamp)
872{
873 return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP,
874 timestamp);
875}
876
Mathias Agopian42cc1ed2011-07-13 15:49:58 -0700877/*
878 * native_window_set_scaling_mode(..., int mode)
879 * All buffers queued after this call will be associated with the scaling mode
880 * specified.
881 */
882static inline int native_window_set_scaling_mode(
883 struct ANativeWindow* window,
884 int mode)
885{
886 return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE,
887 mode);
888}
889
Mathias Agopian8ad54522011-07-29 17:52:36 -0700890/*
891 * native_window_api_connect(..., int api)
892 * connects an API to this window. only one API can be connected at a time.
893 * Returns -EINVAL if for some reason the window cannot be connected, which
894 * can happen if it's connected to some other API.
895 */
896static inline int native_window_api_connect(
897 struct ANativeWindow* window, int api)
898{
Mathias Agopian319f4e22011-08-03 11:26:38 -0700899 return window->perform(window, NATIVE_WINDOW_API_CONNECT, api);
Mathias Agopian8ad54522011-07-29 17:52:36 -0700900}
901
902/*
903 * native_window_api_disconnect(..., int api)
904 * disconnect the API from this window.
905 * An error is returned if for instance the window wasn't connected in the
906 * first place.
907 */
908static inline int native_window_api_disconnect(
909 struct ANativeWindow* window, int api)
910{
Mathias Agopian319f4e22011-08-03 11:26:38 -0700911 return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api);
Mathias Agopian8ad54522011-07-29 17:52:36 -0700912}
913
Jamie Gennis22aec572012-06-13 16:43:06 -0700914/*
915 * native_window_dequeue_buffer_and_wait(...)
916 * Dequeue a buffer and wait on the fence associated with that buffer. The
917 * buffer may safely be accessed immediately upon this function returning. An
918 * error is returned if either of the dequeue or the wait operations fail.
919 */
920static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw,
921 struct ANativeWindowBuffer** anb) {
Jesse Hallbc930ed2012-10-01 13:48:36 -0700922 return anw->dequeueBuffer_DEPRECATED(anw, anb);
Jamie Gennis22aec572012-06-13 16:43:06 -0700923}
924
Rachadd6d4c612014-07-29 18:03:21 -0700925/*
926 * native_window_set_sideband_stream(..., native_handle_t*)
927 * Attach a sideband buffer stream to a native window.
928 */
929static inline int native_window_set_sideband_stream(
930 struct ANativeWindow* window,
931 native_handle_t* sidebandHandle)
932{
933 return window->perform(window, NATIVE_WINDOW_SET_SIDEBAND_STREAM,
934 sidebandHandle);
935}
Mathias Agopian8ad54522011-07-29 17:52:36 -0700936
Iliyan Malchev0ab886b2011-05-01 14:07:43 -0700937__END_DECLS
938
tedbo1ffdb382011-05-24 00:55:33 -0700939#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */