blob: 1bd315648a0e4f7f35762a2763bf31bf1efd8ff8 [file] [log] [blame]
Pawin Vongmasa120c4da2016-12-19 14:49:56 +07001/*
2 * Copyright (C) 2016 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
17package android.hardware.media.omx@1.0;
18
19import android.hardware.graphics.common@1.0::Dataspace;
20import android.hardware.graphics.common@1.0::PixelFormat;
21
22import android.hardware.media@1.0::types;
23import IOmxProducerListener;
24
25/**
26 * Ref: frameworks/native/include/gui/IGraphicBufferProducer.h:
27 * IGraphicBufferProducer
28 * This is a wrapper/wrapped HAL interface for the actual binder interface.
29 */
30interface IOmxBufferProducer {
31
32 /**
33 * Ref: frameworks/native/include/ui/FenceTime.h: FenceTime::Snapshot
34 *
35 * An atomic snapshot of the FenceTime that is flattenable.
36 */
37 struct FenceTimeSnapshot {
38 enum State : int32_t {
39 EMPTY,
40 FENCE,
41 SIGNAL_TIME,
42 };
43 State state;
44 Fence fence;
45 int64_t signalTimeNs;
46 };
47
48 /**
49 * Ref: frameworks/native/include/gui/FrameTimestamp.h: FrameEventsDelta
50 *
51 * A single frame update from the consumer to producer that can be sent
52 * through a HIDL interface. Although this may be sent multiple times for
53 * the same frame as new timestamps are set, Fences only need to be sent
54 * once.
55 */
56 struct FrameEventsDelta {
57 uint32_t index;
58 uint64_t frameNumber;
59 bool addPostCompositeCalled;
60 bool addRetireCalled;
61 bool addReleaseCalled;
62 int64_t postedTimeNs;
63 int64_t requestedPresentTimeNs;
64 int64_t latchTimeNs;
65 int64_t firstRefreshStartTimeNs;
66 int64_t lastRefreshStartTimeNs;
67 int64_t dequeueReadyTime;
68 FenceTimeSnapshot gpuCompositionDoneFence;
69 FenceTimeSnapshot displayPresentFence;
70 FenceTimeSnapshot displayRetireFence;
71 FenceTimeSnapshot releaseFence;
72 };
73
74 /**
Brian Anderson68214ec2017-02-13 15:26:13 -080075 * Ref: frameworks/native/include/gui/FrameTimestamp.h: CompositorTiming
76 *
77 * The most recent compositor timing info sent from consumer to producer
78 * through a HIDL interface.
79 */
80 struct CompositorTiming {
81 int64_t deadlineNs;
82 int64_t intervalNs;
83 int64_t presentLatencyNs;
84 };
85
86 /**
Pawin Vongmasa120c4da2016-12-19 14:49:56 +070087 * Ref: frameworks/native/include/gui/FrameTimestamp.h: FrameEventHistoryDelta
88 *
89 * A collection of updates from consumer to producer that can be sent
90 * through a HIDL interface.
91 */
Brian Anderson68214ec2017-02-13 15:26:13 -080092 struct FrameEventHistoryDelta {
93 vec<FrameEventsDelta> deltas;
94 CompositorTiming compositorTiming;
95 };
Pawin Vongmasa120c4da2016-12-19 14:49:56 +070096
97 /**
98 * Modes for disconnection.
99 */
100 enum DisconnectMode : int32_t {
101 /** Disconnect only the specified API. */
102 API,
103 /** Disconnect any API originally connected from the process calling
104 * disconnect. */
105 ALL_LOCAL
106 };
107
108 struct QueueBufferInput {
109 /** A monotonically increasing value in nanoseconds. */
110 int64_t timestamp;
111 /** Whether the timestamp was synthesized at queue time. */
112 int32_t isAutoTimestamp;
113 /** Description of the contents, interpretation depends on format. */
114 Dataspace dataSpace;
115 /** A crop rectangle that's used as a hint to the consumer. */
116 Rect crop;
117 /** A set of flags from NATIVE_WINDOW_SCALING_* in <window.h>. */
118 int32_t scalingMode;
119 /** A set of flags from NATIVE_WINDOW_TRANSFORM_* in <window.h>. */
120 uint32_t transform;
121 /** The sticky transform set in Surface (only used by the LEGACY camera
122 * mode). */
123 uint32_t stickyTransform;
124 /** A fence that the consumer must wait on before reading the buffer;
125 * set this to Fence::NO_FENCE if the buffer is ready immediately. */
126 Fence fence;
127 Region surfaceDamage;
128 /** Whether or not the latest frame timestamps should be retrieved from
129 * the consumer. */
130 bool getFrameTimestamps;
131 };
132
133 struct QueueBufferOutput {
134 uint32_t width;
135 uint32_t height;
136 uint32_t transformHint;
137 uint32_t numPendingBuffers;
138 uint64_t nextFrameNumber;
139 FrameEventHistoryDelta frameTimestamps;
140 };
141
142 /**
143 * requestBuffer requests a new buffer for the given index. The server (i.e.
144 * the IOmxBufferProducer implementation) assigns the newly created
145 * buffer to the given slot index, and the client is expected to mirror the
146 * slot->buffer mapping so that it's not necessary to transfer an
147 * AnwBuffer for every dequeue operation.
148 *
149 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
150 *
151 * Return of a value other than NO_ERROR means an error has occurred:
152 * * NO_INIT - the buffer queue has been abandoned or the producer is not
153 * connected.
154 * * BAD_VALUE - one of the two conditions occurred:
155 * * slot was out of range (see above)
156 * * buffer specified by the slot is not dequeued
157 */
158 requestBuffer(
159 int32_t slot
160 ) generates (
161 Status status,
162 AnwBuffer buffer
163 );
164
165 /**
166 * setMaxDequeuedBufferCount sets the maximum number of buffers that can be
167 * dequeued by the producer at one time. If this method succeeds, any new
168 * buffer slots will be both unallocated and owned by the BufferQueue object
169 * (i.e. they are not owned by the producer or consumer). Calling this may
170 * also cause some buffer slots to be emptied. If the caller is caching the
171 * contents of the buffer slots, it should empty that cache after calling
172 * this method.
173 *
174 * This function should not be called with a value of maxDequeuedBuffers
175 * that is less than the number of currently dequeued buffer slots. Doing so
176 * will result in a BAD_VALUE error.
177 *
178 * The buffer count should be at least 1 (inclusive), but at most
179 * (NUM_BUFFER_SLOTS - the minimum undequeued buffer count) (exclusive). The
180 * minimum undequeued buffer count can be obtained by calling
181 * query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS).
182 *
183 * Return of a value other than NO_ERROR means an error has occurred:
184 * * NO_INIT - the buffer queue has been abandoned.
185 * * BAD_VALUE - one of the below conditions occurred:
186 * * bufferCount was out of range (see above).
187 * * client would have more than the requested number of dequeued
188 * buffers after this call.
189 * * this call would cause the maxBufferCount value to be exceeded.
190 * * failure to adjust the number of available slots.
191 */
192 setMaxDequeuedBufferCount(
193 int32_t maxDequeuedBuffers
194 ) generates (
195 Status status
196 );
197
198 /**
199 * Set the async flag if the producer intends to asynchronously queue
200 * buffers without blocking. Typically this is used for triple-buffering
201 * and/or when the swap interval is set to zero.
202 *
203 * Enabling async mode will internally allocate an additional buffer to
204 * allow for the asynchronous behavior. If it is not enabled queue/dequeue
205 * calls may block.
206 *
207 * Return of a value other than NO_ERROR means an error has occurred:
208 * * NO_INIT - the buffer queue has been abandoned.
209 * * BAD_VALUE - one of the following has occurred:
210 * * this call would cause the maxBufferCount value to be
211 * exceeded
212 * * failure to adjust the number of available slots.
213 */
214 setAsyncMode(
215 bool async
216 ) generates (
217 Status status
218 );
219
220 /**
221 * dequeueBuffer requests a new buffer slot for the client to use. Ownership
222 * of the slot is transfered to the client, meaning that the server will not
223 * use the contents of the buffer associated with that slot.
224 *
225 * The slot index returned may or may not contain a buffer (client-side).
226 * If the slot is empty the client should call requestBuffer to assign a new
227 * buffer to that slot.
228 *
229 * Once the client is done filling this buffer, it is expected to transfer
230 * buffer ownership back to the server with either cancelBuffer on
231 * the dequeued slot or to fill in the contents of its associated buffer
232 * contents and call queueBuffer.
233 *
234 * If dequeueBuffer returns the BUFFER_NEEDS_REALLOCATION flag, the client is
235 * expected to call requestBuffer immediately.
236 *
237 * If dequeueBuffer returns the RELEASE_ALL_BUFFERS flag, the client is
238 * expected to release all of the mirrored slot->buffer mappings.
239 *
240 * The fence parameter will be updated to hold the fence associated with
241 * the buffer. The contents of the buffer must not be overwritten until the
242 * fence signals. If the fence is Fence::NO_FENCE, the buffer may be written
243 * immediately.
244 *
245 * The width and height parameters must be no greater than the minimum of
246 * GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
247 * An error due to invalid dimensions might not be reported until
248 * updateTexImage() is called. If width and height are both zero, the
249 * default values specified by setDefaultBufferSize() are used instead.
250 *
251 * If the format is 0, the default format will be used.
252 *
253 * The usage argument specifies gralloc buffer usage flags. The values
254 * are enumerated in <gralloc.h>, e.g. GRALLOC_USAGE_HW_RENDER. These
255 * will be merged with the usage flags specified by
256 * IGraphicBufferConsumer::setConsumerUsageBits.
257 *
258 * This call will block until a buffer is available to be dequeued. If
259 * both the producer and consumer are controlled by the app, then this call
260 * can never block and will return WOULD_BLOCK if no buffer is available.
261 *
262 * A non-negative value with flags set (see above) will be returned upon
263 * success as status.
264 *
265 * Return of a negative means an error has occurred:
266 * * NO_INIT - the buffer queue has been abandoned or the producer is not
267 * connected.
268 * * BAD_VALUE - both in async mode and buffer count was less than the
269 * max numbers of buffers that can be allocated at once.
270 * * INVALID_OPERATION - cannot attach the buffer because it would cause
271 * too many buffers to be dequeued, either because
272 * the producer already has a single buffer dequeued
273 * and did not set a buffer count, or because a
274 * buffer count was set and this call would cause
275 * it to be exceeded.
276 * * WOULD_BLOCK - no buffer is currently available, and blocking is disabled
277 * since both the producer/consumer are controlled by app
278 * * NO_MEMORY - out of memory, cannot allocate the graphics buffer.
279 * * TIMED_OUT - the timeout set by setDequeueTimeout was exceeded while
280 * waiting for a buffer to become available.
281 *
282 * All other negative values are an unknown error returned downstream
283 * from the graphics allocator (typically errno).
284 */
285 dequeueBuffer(
286 uint32_t width,
287 uint32_t height,
288 PixelFormat format,
289 uint32_t usage,
290 bool getFrameTimestamps
291 ) generates (
292 Status status,
293 int32_t slot,
294 Fence fence,
295 FrameEventHistoryDelta outTimestamps
296 );
297
298 /**
299 * detachBuffer attempts to remove all ownership of the buffer in the given
300 * slot from the buffer queue. If this call succeeds, the slot will be
301 * freed, and there will be no way to obtain the buffer from this interface.
302 * The freed slot will remain unallocated until either it is selected to
303 * hold a freshly allocated buffer in dequeueBuffer or a buffer is attached
304 * to the slot. The buffer must have already been dequeued, and the caller
305 * must already possesses the sp<AnwBuffer> (i.e., must have called
306 * requestBuffer).
307 *
308 * Return of a value other than NO_ERROR means an error has occurred:
309 * * NO_INIT - the buffer queue has been abandoned or the producer is not
310 * connected.
311 * * BAD_VALUE - the given slot number is invalid, either because it is
312 * out of the range [0, NUM_BUFFER_SLOTS), or because the slot
313 * it refers to is not currently dequeued and requested.
314 */
315 detachBuffer(
316 int32_t slot
317 ) generates (
318 Status status
319 );
320
321 /**
322 * detachNextBuffer is equivalent to calling dequeueBuffer, requestBuffer,
323 * and detachBuffer in sequence, except for two things:
324 *
325 * 1) It is unnecessary to know the dimensions, format, or usage of the
326 * next buffer.
327 * 2) It will not block, since if it cannot find an appropriate buffer to
328 * return, it will return an error instead.
329 *
330 * Only slots that are free but still contain an AnwBuffer will be
331 * considered, and the oldest of those will be returned. buffer is
332 * equivalent to buffer from the requestBuffer call, and fence is
333 * equivalent to fence from the dequeueBuffer call.
334 *
335 * Return of a value other than NO_ERROR means an error has occurred:
336 * * NO_INIT - the buffer queue has been abandoned or the producer is not
337 * connected.
338 * * BAD_VALUE - either outBuffer or outFence were NULL.
339 * * NO_MEMORY - no slots were found that were both free and contained a
340 * AnwBuffer.
341 */
342 detachNextBuffer(
343 ) generates (
344 Status status,
345 AnwBuffer buffer,
346 Fence fence
347 );
348
349 /**
350 * attachBuffer attempts to transfer ownership of a buffer to the buffer
351 * queue. If this call succeeds, it will be as if this buffer was dequeued
352 * from the returned slot number. As such, this call will fail if attaching
353 * this buffer would cause too many buffers to be simultaneously dequeued.
354 *
355 * If attachBuffer returns the RELEASE_ALL_BUFFERS flag, the caller is
356 * expected to release all of the mirrored slot->buffer mappings.
357 *
358 * A non-negative value with flags set (see above) will be returned upon
359 * success.
360 *
361 * Return of a negative value means an error has occurred:
362 * * NO_INIT - the buffer queue has been abandoned or the producer is not
363 * connected.
364 * * BAD_VALUE - outSlot or buffer were NULL, invalid combination of
365 * async mode and buffer count override, or the generation
366 * number of the buffer did not match the buffer queue.
367 * * INVALID_OPERATION - cannot attach the buffer because it would cause
368 * too many buffers to be dequeued, either because
369 * the producer already has a single buffer dequeued
370 * and did not set a buffer count, or because a
371 * buffer count was set and this call would cause
372 * it to be exceeded.
373 * * WOULD_BLOCK - no buffer slot is currently available, and blocking is
374 * disabled since both the producer/consumer are
375 * controlled by the app.
376 * * TIMED_OUT - the timeout set by setDequeueTimeout was exceeded while
377 * waiting for a slot to become available.
378 */
379 attachBuffer(
380 AnwBuffer buffer
381 ) generates (
382 Status status,
383 int32_t slot
384 );
385
386 /**
387 * queueBuffer indicates that the client has finished filling in the
388 * contents of the buffer associated with slot and transfers ownership of
389 * that slot back to the server.
390 *
391 * It is not valid to call queueBuffer on a slot that is not owned
392 * by the client or one for which a buffer associated via requestBuffer
393 * (an attempt to do so will fail with a return value of BAD_VALUE).
394 *
395 * In addition, the input must be described by the client (as documented
396 * below). Any other properties (zero point, etc)
397 * are client-dependent, and should be documented by the client.
398 *
399 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
400 *
401 * Upon success, the output will be filled with meaningful values
402 * (refer to the documentation below).
403 *
404 * Return of a value other than NO_ERROR means an error has occurred:
405 * * NO_INIT - the buffer queue has been abandoned or the producer is not
406 * connected.
407 * * BAD_VALUE - one of the below conditions occurred:
408 * * fence was NULL
409 * * scaling mode was unknown
410 * * both in async mode and buffer count was less than the
411 * max numbers of buffers that can be allocated at once
412 * * slot index was out of range (see above).
413 * * the slot was not in the dequeued state
414 * * the slot was enqueued without requesting a buffer
415 * * crop rect is out of bounds of the buffer dimensions
416 */
417 queueBuffer(
418 int32_t slot,
419 QueueBufferInput input
420 ) generates (
421 Status status,
422 QueueBufferOutput output
423 );
424
425 /**
426 * cancelBuffer indicates that the client does not wish to fill in the
427 * buffer associated with slot and transfers ownership of the slot back to
428 * the server.
429 *
430 * The buffer is not queued for use by the consumer.
431 *
432 * The slot must be in the range of [0, NUM_BUFFER_SLOTS).
433 *
434 * The buffer will not be overwritten until the fence signals. The fence
435 * will usually be the one obtained from dequeueBuffer.
436 *
437 * Return of a value other than NO_ERROR means an error has occurred:
438 * * NO_INIT - the buffer queue has been abandoned or the producer is not
439 * connected.
440 * * BAD_VALUE - one of the below conditions occurred:
441 * * fence was NULL
442 * * slot index was out of range (see above).
443 * * the slot was not in the dequeued state
444 */
445 cancelBuffer(
446 int32_t slot,
447 Fence fence
448 ) generates (
449 Status status
450 );
451
452 /**
453 * query retrieves some information for this surface
454 * 'what' tokens allowed are that of NATIVE_WINDOW_* in <window.h>
455 *
456 * Return of a value other than NO_ERROR means an error has occurred:
457 * * NO_INIT - the buffer queue has been abandoned.
458 * * BAD_VALUE - what was out of range
459 */
460 query(
461 int32_t what
462 ) generates (
463 int32_t result,
464 int32_t value
465 );
466
467 /**
468 * connect attempts to connect a client API to the IOmxBufferProducer.
469 * This must be called before any other IOmxBufferProducer methods are
470 * called except for getAllocator. A consumer must be already connected.
471 *
472 * This method will fail if the connect was previously called on the
473 * IOmxBufferProducer and no corresponding disconnect call was made.
474 *
475 * The listener is an optional binder callback object that can be used if
476 * the producer wants to be notified when the consumer releases a buffer
477 * back to the BufferQueue. It is also used to detect the death of the
478 * producer. If only the latter functionality is desired, there is a
479 * DummyProducerListener class in IProducerListener.h that can be used.
480 *
481 * The api should be one of the NATIVE_WINDOW_API_* values in <window.h>
482 *
483 * The producerControlledByApp should be set to true if the producer is hosted
484 * by an untrusted process (typically app_process-forked processes). If both
485 * the producer and the consumer are app-controlled then all buffer queues
486 * will operate in async mode regardless of the async flag.
487 *
488 * Upon success, the output will be filled with meaningful data
489 * (refer to QueueBufferOutput documentation above).
490 *
491 * Return of a value other than NO_ERROR means an error has occurred:
492 * * NO_INIT - one of the following occurred:
493 * * the buffer queue was abandoned
494 * * no consumer has yet connected
495 * * BAD_VALUE - one of the following has occurred:
496 * * the producer is already connected
497 * * api was out of range (see above).
498 * * output was NULL.
499 * * Failure to adjust the number of available slots. This can
500 * happen because of trying to allocate/deallocate the async
501 * buffer in response to the value of producerControlledByApp.
502 * * DEAD_OBJECT - the token is hosted by an already-dead process
503 *
504 * Additional negative errors may be returned by the internals, they
505 * should be treated as opaque fatal unrecoverable errors.
506 */
507 connect(
508 IOmxProducerListener listener,
509 int32_t api,
510 bool producerControlledByApp
511 ) generates (
512 Status status,
513 QueueBufferOutput output
514 );
515
516 /**
517 * disconnect attempts to disconnect a client API from the
518 * IOmxBufferProducer. Calling this method will cause any subsequent
519 * calls to other IOmxBufferProducer methods to fail except for
520 * getAllocator and connect. Successfully calling connect after this will
521 * allow the other methods to succeed again.
522 *
523 * The api should be one of the NATIVE_WINDOW_API_* values in <window.h>
524 *
525 * Alternatively if mode is AllLocal, then the API value is ignored, and any API
526 * connected from the same PID calling disconnect will be disconnected.
527 *
528 * Disconnecting from an abandoned IOmxBufferProducer is legal and
529 * is considered a no-op.
530 *
531 * Return of a value other than NO_ERROR means an error has occurred:
532 * * BAD_VALUE - one of the following has occurred:
533 * * the api specified does not match the one that was connected
534 * * api was out of range (see above).
535 * * DEAD_OBJECT - the token is hosted by an already-dead process
536 */
537 disconnect(
538 int32_t api,
539 DisconnectMode mode /* = DisconnectMode::API */
540 ) generates (
541 Status status
542 );
543
544 /**
545 * Attaches a sideband buffer stream to the IOmxBufferProducer.
546 *
547 * A sideband stream is a device-specific mechanism for passing buffers
548 * from the producer to the consumer without using dequeueBuffer/
549 * queueBuffer. If a sideband stream is present, the consumer can choose
550 * whether to acquire buffers from the sideband stream or from the queued
551 * buffers.
552 *
553 * Passing NULL or a different stream handle will detach the previous
554 * handle if any.
555 */
556 setSidebandStream(
557 handle stream
558 ) generates (
559 Status status
560 );
561
562 /**
563 * Allocates buffers based on the given dimensions/format.
564 *
565 * This function will allocate up to the maximum number of buffers
566 * permitted by the current BufferQueue configuration. It will use the
567 * given format, dimensions, and usage bits, which are interpreted in the
568 * same way as for dequeueBuffer, and the async flag must be set the same
569 * way as for dequeueBuffer to ensure that the correct number of buffers are
570 * allocated. This is most useful to avoid an allocation delay during
571 * dequeueBuffer. If there are already the maximum number of buffers
572 * allocated, this function has no effect.
573 */
574 allocateBuffers(
575 uint32_t width,
576 uint32_t height,
577 PixelFormat format,
578 uint32_t usage
579 );
580
581 /**
582 * Sets whether dequeueBuffer is allowed to allocate new buffers.
583 *
584 * Normally dequeueBuffer does not discriminate between free slots which
585 * already have an allocated buffer and those which do not, and will
586 * allocate a new buffer if the slot doesn't have a buffer or if the slot's
587 * buffer doesn't match the requested size, format, or usage. This method
588 * allows the producer to restrict the eligible slots to those which already
589 * have an allocated buffer of the correct size, format, and usage. If no
590 * eligible slot is available, dequeueBuffer will block or return an error
591 * as usual.
592 */
593 allowAllocation(
594 bool allow
595 ) generates (
596 Status status
597 );
598
599 /**
600 * Sets the current generation number of the BufferQueue.
601 *
602 * This generation number will be inserted into any buffers allocated by the
603 * BufferQueue, and any attempts to attach a buffer with a different
604 * generation number will fail. Buffers already in the queue are not
605 * affected and will retain their current generation number. The generation
606 * number defaults to 0.
607 */
608 setGenerationNumber(
609 uint32_t generationNumber
610 ) generates (
611 Status status
612 );
613
614 /**
615 * Returns the name of the connected consumer.
616 */
617 getConsumerName(
618 ) generates (
619 string name
620 );
621
622 /**
623 * Used to enable/disable shared buffer mode.
624 *
625 * When shared buffer mode is enabled the first buffer that is queued or
626 * dequeued will be cached and returned to all subsequent calls to
627 * dequeueBuffer and acquireBuffer. This allows the producer and consumer to
628 * simultaneously access the same buffer.
629 */
630 setSharedBufferMode(
631 bool sharedBufferMode
632 ) generates (
633 Status status
634 );
635
636 /**
637 * Used to enable/disable auto-refresh.
638 *
639 * Auto refresh has no effect outside of shared buffer mode. In shared
640 * buffer mode, when enabled, it indicates to the consumer that it should
641 * attempt to acquire buffers even if it is not aware of any being
642 * available.
643 */
644 setAutoRefresh(
645 bool autoRefresh
646 ) generates (
647 Status status
648 );
649
650 /**
651 * Sets how long dequeueBuffer will wait for a buffer to become available
652 * before returning an error (TIMED_OUT).
653 *
654 * This timeout also affects the attachBuffer call, which will block if
655 * there is not a free slot available into which the attached buffer can be
656 * placed.
657 *
658 * By default, the BufferQueue will wait forever, which is indicated by a
659 * timeout of -1. If set (to a value other than -1), this will disable
660 * non-blocking mode and its corresponding spare buffer (which is used to
661 * ensure a buffer is always available).
662 *
663 * Return of a value other than NO_ERROR means an error has occurred:
664 * * BAD_VALUE - Failure to adjust the number of available slots. This can
665 * happen because of trying to allocate/deallocate the async
666 * buffer.
667 */
668 setDequeueTimeout(
669 int64_t timeoutNs
670 ) generates (
671 Status status
672 );
673
674 /**
675 * Returns the last queued buffer along with a fence which must signal
676 * before the contents of the buffer are read. If there are no buffers in
677 * the queue, buffer.nativeHandle and fence will be null handles.
678 *
679 * transformMatrix is meaningless if buffer.nativeHandle is null.
680 */
681 getLastQueuedBuffer(
682 ) generates (
683 Status status,
684 AnwBuffer buffer,
685 Fence fence,
686 float[16] transformMatrix
687 );
688
689 /**
690 * Gets the frame events that haven't already been retrieved.
691 */
692 getFrameTimestamps(
693 ) generates (
694 FrameEventHistoryDelta timeStamps
695 );
696
697 /**
698 * Returns a unique id for this BufferQueue.
699 */
700 getUniqueId(
701 ) generates (
702 Status status,
703 uint64_t outId
704 );
705
706};
707
708