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