blob: 57b9f8a33fedda8f4d437dd012ac07328f87fd68 [file] [log] [blame]
Daniel Lam6b091c52012-01-22 15:26:27 -08001/*
2 * Copyright (C) 2012 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 ANDROID_GUI_BUFFERQUEUE_H
18#define ANDROID_GUI_BUFFERQUEUE_H
19
20#include <EGL/egl.h>
Daniel Lamf71c4ae2012-03-23 18:12:04 -070021#include <EGL/eglext.h>
Daniel Lam6b091c52012-01-22 15:26:27 -080022
Mathias Agopian90ac7992012-02-25 18:48:35 -080023#include <gui/IGraphicBufferAlloc.h>
Daniel Lam6b091c52012-01-22 15:26:27 -080024#include <gui/ISurfaceTexture.h>
25
Daniel Lam6b091c52012-01-22 15:26:27 -080026#include <ui/GraphicBuffer.h>
27
28#include <utils/String8.h>
29#include <utils/Vector.h>
30#include <utils/threads.h>
31
32namespace android {
33// ----------------------------------------------------------------------------
34
35class BufferQueue : public BnSurfaceTexture {
36public:
37 enum { MIN_UNDEQUEUED_BUFFERS = 2 };
38 enum {
39 MIN_ASYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + 1,
40 MIN_SYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS
41 };
42 enum { NUM_BUFFER_SLOTS = 32 };
43 enum { NO_CONNECTED_API = 0 };
Daniel Lameae59d22012-01-22 15:26:27 -080044 enum { INVALID_BUFFER_SLOT = -1 };
Daniel Lam9abe1eb2012-03-26 20:37:15 -070045 enum { STALE_BUFFER_SLOT = 1 };
Daniel Lam6b091c52012-01-22 15:26:27 -080046
Jamie Gennisfa5b40e2012-03-15 14:01:24 -070047 // ConsumerListener is the interface through which the BufferQueue notifies
48 // the consumer of events that the consumer may wish to react to. Because
49 // the consumer will generally have a mutex that is locked during calls from
50 // teh consumer to the BufferQueue, these calls from the BufferQueue to the
51 // consumer *MUST* be called only when the BufferQueue mutex is NOT locked.
52 struct ConsumerListener : public virtual RefBase {
53 // onFrameAvailable is called from queueBuffer each time an additional
54 // frame becomes available for consumption. This means that frames that
55 // are queued while in asynchronous mode only trigger the callback if no
56 // previous frames are pending. Frames queued while in synchronous mode
57 // always trigger the callback.
Daniel Lam6b091c52012-01-22 15:26:27 -080058 //
59 // This is called without any lock held and can be called concurrently
60 // by multiple threads.
61 virtual void onFrameAvailable() = 0;
Jamie Gennisfa5b40e2012-03-15 14:01:24 -070062
63 // onBuffersReleased is called to notify the buffer consumer that the
64 // BufferQueue has released its references to one or more GraphicBuffers
65 // contained in its slots. The buffer consumer should then call
66 // BufferQueue::getReleasedBuffers to retrieve the list of buffers
67 //
68 // This is called without any lock held and can be called concurrently
69 // by multiple threads.
70 virtual void onBuffersReleased() = 0;
Daniel Lam6b091c52012-01-22 15:26:27 -080071 };
72
Jamie Gennisfa5b40e2012-03-15 14:01:24 -070073 // ProxyConsumerListener is a ConsumerListener implementation that keeps a weak
74 // reference to the actual consumer object. It forwards all calls to that
75 // consumer object so long as it exists.
76 //
77 // This class exists to avoid having a circular reference between the
78 // BufferQueue object and the consumer object. The reason this can't be a weak
79 // reference in the BufferQueue class is because we're planning to expose the
80 // consumer side of a BufferQueue as a binder interface, which doesn't support
81 // weak references.
82 class ProxyConsumerListener : public BufferQueue::ConsumerListener {
83 public:
84
85 ProxyConsumerListener(const wp<BufferQueue::ConsumerListener>& consumerListener);
86 virtual ~ProxyConsumerListener();
87 virtual void onFrameAvailable();
88 virtual void onBuffersReleased();
89
90 private:
91
92 // mConsumerListener is a weak reference to the ConsumerListener. This is
93 // the raison d'etre of ProxyConsumerListener.
94 wp<BufferQueue::ConsumerListener> mConsumerListener;
95 };
96
97
Daniel Lam6b091c52012-01-22 15:26:27 -080098 // BufferQueue manages a pool of gralloc memory slots to be used
99 // by producers and consumers.
100 // allowSynchronousMode specifies whether or not synchronous mode can be
101 // enabled.
102 BufferQueue(bool allowSynchronousMode = true);
103 virtual ~BufferQueue();
104
Daniel Lamb8560522012-01-30 15:51:27 -0800105 virtual int query(int what, int* value);
106
Daniel Lam6b091c52012-01-22 15:26:27 -0800107 // setBufferCount updates the number of available buffer slots. After
108 // calling this all buffer slots are both unallocated and owned by the
109 // BufferQueue object (i.e. they are not owned by the client).
110 virtual status_t setBufferCount(int bufferCount);
111
112 virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf);
113
114 // dequeueBuffer gets the next buffer slot index for the client to use. If a
115 // buffer slot is available then that slot index is written to the location
116 // pointed to by the buf argument and a status of OK is returned. If no
117 // slot is available then a status of -EBUSY is returned and buf is
118 // unmodified.
119 // The width and height parameters must be no greater than the minimum of
120 // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
121 // An error due to invalid dimensions might not be reported until
122 // updateTexImage() is called.
123 virtual status_t dequeueBuffer(int *buf, uint32_t width, uint32_t height,
124 uint32_t format, uint32_t usage);
125
126 // queueBuffer returns a filled buffer to the BufferQueue. In addition, a
127 // timestamp must be provided for the buffer. The timestamp is in
128 // nanoseconds, and must be monotonically increasing. Its other semantics
129 // (zero point, etc) are client-dependent and should be documented by the
130 // client.
131 virtual status_t queueBuffer(int buf, int64_t timestamp,
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700132 const Rect& crop, int scalingMode, uint32_t transform,
Daniel Lam6b091c52012-01-22 15:26:27 -0800133 uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
134 virtual void cancelBuffer(int buf);
Daniel Lam6b091c52012-01-22 15:26:27 -0800135
136 // setSynchronousMode set whether dequeueBuffer is synchronous or
137 // asynchronous. In synchronous mode, dequeueBuffer blocks until
138 // a buffer is available, the currently bound buffer can be dequeued and
139 // queued buffers will be retired in order.
140 // The default mode is asynchronous.
141 virtual status_t setSynchronousMode(bool enabled);
142
143 // connect attempts to connect a producer client API to the BufferQueue.
144 // This must be called before any other ISurfaceTexture methods are called
145 // except for getAllocator.
146 //
147 // This method will fail if the connect was previously called on the
148 // BufferQueue and no corresponding disconnect call was made.
149 virtual status_t connect(int api,
150 uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
151
152 // disconnect attempts to disconnect a producer client API from the
153 // BufferQueue. Calling this method will cause any subsequent calls to other
154 // ISurfaceTexture methods to fail except for getAllocator and connect.
155 // Successfully calling connect after this will allow the other methods to
156 // succeed again.
157 //
158 // This method will fail if the the BufferQueue is not currently
159 // connected to the specified client API.
160 virtual status_t disconnect(int api);
161
Daniel Lameae59d22012-01-22 15:26:27 -0800162 // dump our state in a String
163 virtual void dump(String8& result) const;
164 virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
Daniel Lam6b091c52012-01-22 15:26:27 -0800165
Daniel Lameae59d22012-01-22 15:26:27 -0800166 // public facing structure for BufferSlot
167 struct BufferItem {
168
169 BufferItem()
170 :
171 mTransform(0),
172 mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
173 mTimestamp(0),
174 mFrameNumber(0),
175 mBuf(INVALID_BUFFER_SLOT) {
176 mCrop.makeInvalid();
177 }
178 // mGraphicBuffer points to the buffer allocated for this slot or is NULL
179 // if no buffer has been allocated.
180 sp<GraphicBuffer> mGraphicBuffer;
181
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700182 // mCrop is the current crop rectangle for this buffer slot.
Daniel Lameae59d22012-01-22 15:26:27 -0800183 Rect mCrop;
184
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700185 // mTransform is the current transform flags for this buffer slot.
Daniel Lameae59d22012-01-22 15:26:27 -0800186 uint32_t mTransform;
187
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700188 // mScalingMode is the current scaling mode for this buffer slot.
Daniel Lameae59d22012-01-22 15:26:27 -0800189 uint32_t mScalingMode;
190
191 // mTimestamp is the current timestamp for this buffer slot. This gets
192 // to set by queueBuffer each time this slot is queued.
193 int64_t mTimestamp;
194
195 // mFrameNumber is the number of the queued frame for this slot.
196 uint64_t mFrameNumber;
197
198 // buf is the slot index of this buffer
199 int mBuf;
200
201 };
202
203 // The following public functions is the consumer facing interface
204
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700205 // acquireBuffer attempts to acquire ownership of the next pending buffer in
206 // the BufferQueue. If no buffer is pending then it returns -EINVAL. If a
207 // buffer is successfully acquired, the information about the buffer is
208 // returned in BufferItem. If the buffer returned had previously been
209 // acquired then the BufferItem::mGraphicBuffer field of buffer is set to
210 // NULL and it is assumed that the consumer still holds a reference to the
211 // buffer.
212 status_t acquireBuffer(BufferItem *buffer);
Daniel Lameae59d22012-01-22 15:26:27 -0800213
214 // releaseBuffer releases a buffer slot from the consumer back to the
215 // BufferQueue pending a fence sync.
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700216 //
217 // Note that the dependencies on EGL will be removed once we switch to using
218 // the Android HW Sync HAL.
Daniel Lameae59d22012-01-22 15:26:27 -0800219 status_t releaseBuffer(int buf, EGLDisplay display, EGLSyncKHR fence);
220
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700221 // consumerConnect connects a consumer to the BufferQueue. Only one
222 // consumer may be connected, and when that consumer disconnects the
223 // BufferQueue is placed into the "abandoned" state, causing most
224 // interactions with the BufferQueue by the producer to fail.
225 status_t consumerConnect(const sp<ConsumerListener>& consumer);
226
Daniel Lameae59d22012-01-22 15:26:27 -0800227 // consumerDisconnect disconnects a consumer from the BufferQueue. All
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700228 // buffers will be freed and the BufferQueue is placed in the "abandoned"
229 // state, causing most interactions with the BufferQueue by the producer to
230 // fail.
Daniel Lameae59d22012-01-22 15:26:27 -0800231 status_t consumerDisconnect();
232
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700233 // getReleasedBuffers sets the value pointed to by slotMask to a bit mask
234 // indicating which buffer slots the have been released by the BufferQueue
235 // but have not yet been released by the consumer.
236 status_t getReleasedBuffers(uint32_t* slotMask);
237
Daniel Lameae59d22012-01-22 15:26:27 -0800238 // setDefaultBufferSize is used to set the size of buffers returned by
239 // requestBuffers when a with and height of zero is requested.
240 status_t setDefaultBufferSize(uint32_t w, uint32_t h);
241
242 // setBufferCountServer set the buffer count. If the client has requested
243 // a buffer count using setBufferCount, the server-buffer count will
244 // take effect once the client sets the count back to zero.
245 status_t setBufferCountServer(int bufferCount);
246
247 // isSynchronousMode returns whether the SurfaceTexture is currently in
248 // synchronous mode.
249 bool isSynchronousMode() const;
250
251 // setConsumerName sets the name used in logging
252 void setConsumerName(const String8& name);
253
Daniel Lamb2675792012-02-23 14:35:13 -0800254 // setDefaultBufferFormat allows the BufferQueue to create
255 // GraphicBuffers of a defaultFormat if no format is specified
256 // in dequeueBuffer
257 status_t setDefaultBufferFormat(uint32_t defaultFormat);
258
259 // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer
260 status_t setConsumerUsageBits(uint32_t usage);
261
262 // setTransformHint bakes in rotation to buffers so overlays can be used
263 status_t setTransformHint(uint32_t hint);
Daniel Lameae59d22012-01-22 15:26:27 -0800264
265private:
Daniel Lam6b091c52012-01-22 15:26:27 -0800266 // freeBufferLocked frees the resources (both GraphicBuffer and EGLImage)
267 // for the given slot.
268 void freeBufferLocked(int index);
269
270 // freeAllBuffersLocked frees the resources (both GraphicBuffer and
271 // EGLImage) for all slots.
272 void freeAllBuffersLocked();
273
274 // freeAllBuffersExceptHeadLocked frees the resources (both GraphicBuffer
275 // and EGLImage) for all slots except the head of mQueue
276 void freeAllBuffersExceptHeadLocked();
277
278 // drainQueueLocked drains the buffer queue if we're in synchronous mode
279 // returns immediately otherwise. It returns NO_INIT if the BufferQueue
280 // became abandoned or disconnected during this call.
281 status_t drainQueueLocked();
282
283 // drainQueueAndFreeBuffersLocked drains the buffer queue if we're in
284 // synchronous mode and free all buffers. In asynchronous mode, all buffers
285 // are freed except the current buffer.
286 status_t drainQueueAndFreeBuffersLocked();
287
288 status_t setBufferCountServerLocked(int bufferCount);
289
Daniel Lam6b091c52012-01-22 15:26:27 -0800290 struct BufferSlot {
291
292 BufferSlot()
Daniel Lameae59d22012-01-22 15:26:27 -0800293 : mEglDisplay(EGL_NO_DISPLAY),
Daniel Lam6b091c52012-01-22 15:26:27 -0800294 mBufferState(BufferSlot::FREE),
295 mRequestBufferCalled(false),
296 mTransform(0),
297 mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
298 mTimestamp(0),
299 mFrameNumber(0),
Daniel Lameae59d22012-01-22 15:26:27 -0800300 mFence(EGL_NO_SYNC_KHR),
Daniel Lam9abe1eb2012-03-26 20:37:15 -0700301 mAcquireCalled(false),
302 mNeedsCleanupOnRelease(false) {
Daniel Lam6b091c52012-01-22 15:26:27 -0800303 mCrop.makeInvalid();
304 }
305
306 // mGraphicBuffer points to the buffer allocated for this slot or is NULL
307 // if no buffer has been allocated.
308 sp<GraphicBuffer> mGraphicBuffer;
309
Daniel Lam6b091c52012-01-22 15:26:27 -0800310 // mEglDisplay is the EGLDisplay used to create mEglImage.
311 EGLDisplay mEglDisplay;
312
313 // BufferState represents the different states in which a buffer slot
314 // can be.
315 enum BufferState {
316 // FREE indicates that the buffer is not currently being used and
317 // will not be used in the future until it gets dequeued and
318 // subsequently queued by the client.
Daniel Lameae59d22012-01-22 15:26:27 -0800319 // aka "owned by BufferQueue, ready to be dequeued"
Daniel Lam6b091c52012-01-22 15:26:27 -0800320 FREE = 0,
321
322 // DEQUEUED indicates that the buffer has been dequeued by the
323 // client, but has not yet been queued or canceled. The buffer is
324 // considered 'owned' by the client, and the server should not use
325 // it for anything.
326 //
327 // Note that when in synchronous-mode (mSynchronousMode == true),
328 // the buffer that's currently attached to the texture may be
329 // dequeued by the client. That means that the current buffer can
330 // be in either the DEQUEUED or QUEUED state. In asynchronous mode,
331 // however, the current buffer is always in the QUEUED state.
Daniel Lameae59d22012-01-22 15:26:27 -0800332 // aka "owned by producer, ready to be queued"
Daniel Lam6b091c52012-01-22 15:26:27 -0800333 DEQUEUED = 1,
334
335 // QUEUED indicates that the buffer has been queued by the client,
336 // and has not since been made available for the client to dequeue.
337 // Attaching the buffer to the texture does NOT transition the
338 // buffer away from the QUEUED state. However, in Synchronous mode
339 // the current buffer may be dequeued by the client under some
340 // circumstances. See the note about the current buffer in the
341 // documentation for DEQUEUED.
Daniel Lameae59d22012-01-22 15:26:27 -0800342 // aka "owned by BufferQueue, ready to be acquired"
Daniel Lam6b091c52012-01-22 15:26:27 -0800343 QUEUED = 2,
Daniel Lameae59d22012-01-22 15:26:27 -0800344
345 // aka "owned by consumer, ready to be released"
346 ACQUIRED = 3
Daniel Lam6b091c52012-01-22 15:26:27 -0800347 };
348
349 // mBufferState is the current state of this buffer slot.
350 BufferState mBufferState;
351
352 // mRequestBufferCalled is used for validating that the client did
353 // call requestBuffer() when told to do so. Technically this is not
354 // needed but useful for debugging and catching client bugs.
355 bool mRequestBufferCalled;
356
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700357 // mCrop is the current crop rectangle for this buffer slot.
Daniel Lam6b091c52012-01-22 15:26:27 -0800358 Rect mCrop;
359
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700360 // mTransform is the current transform flags for this buffer slot.
Daniel Lam6b091c52012-01-22 15:26:27 -0800361 uint32_t mTransform;
362
Mathias Agopian851ef8f2012-03-29 17:10:08 -0700363 // mScalingMode is the current scaling mode for this buffer slot.
Daniel Lam6b091c52012-01-22 15:26:27 -0800364 uint32_t mScalingMode;
365
366 // mTimestamp is the current timestamp for this buffer slot. This gets
367 // to set by queueBuffer each time this slot is queued.
368 int64_t mTimestamp;
369
370 // mFrameNumber is the number of the queued frame for this slot.
371 uint64_t mFrameNumber;
372
373 // mFence is the EGL sync object that must signal before the buffer
374 // associated with this buffer slot may be dequeued. It is initialized
375 // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based
376 // on a compile-time option) set to a new sync object in updateTexImage.
377 EGLSyncKHR mFence;
Daniel Lameae59d22012-01-22 15:26:27 -0800378
379 // Indicates whether this buffer has been seen by a consumer yet
380 bool mAcquireCalled;
Daniel Lam9abe1eb2012-03-26 20:37:15 -0700381
382 // Indicates whether this buffer needs to be cleaned up by consumer
383 bool mNeedsCleanupOnRelease;
Daniel Lam6b091c52012-01-22 15:26:27 -0800384 };
385
386 // mSlots is the array of buffer slots that must be mirrored on the client
387 // side. This allows buffer ownership to be transferred between the client
388 // and server without sending a GraphicBuffer over binder. The entire array
389 // is initialized to NULL at construction time, and buffers are allocated
390 // for a slot when requestBuffer is called with that slot's index.
391 BufferSlot mSlots[NUM_BUFFER_SLOTS];
392
Daniel Lam6b091c52012-01-22 15:26:27 -0800393 // mDefaultWidth holds the default width of allocated buffers. It is used
394 // in requestBuffers() if a width and height of zero is specified.
395 uint32_t mDefaultWidth;
396
397 // mDefaultHeight holds the default height of allocated buffers. It is used
398 // in requestBuffers() if a width and height of zero is specified.
399 uint32_t mDefaultHeight;
400
401 // mPixelFormat holds the pixel format of allocated buffers. It is used
402 // in requestBuffers() if a format of zero is specified.
403 uint32_t mPixelFormat;
404
405 // mBufferCount is the number of buffer slots that the client and server
406 // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed
407 // by calling setBufferCount or setBufferCountServer
408 int mBufferCount;
409
410 // mClientBufferCount is the number of buffer slots requested by the client.
411 // The default is zero, which means the client doesn't care how many buffers
412 // there is.
413 int mClientBufferCount;
414
415 // mServerBufferCount buffer count requested by the server-side
416 int mServerBufferCount;
417
Daniel Lam6b091c52012-01-22 15:26:27 -0800418 // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to
419 // allocate new GraphicBuffer objects.
420 sp<IGraphicBufferAlloc> mGraphicBufferAlloc;
421
Jamie Gennisfa5b40e2012-03-15 14:01:24 -0700422 // mConsumerListener is used to notify the connected consumer of
423 // asynchronous events that it may wish to react to. It is initially set
424 // to NULL and is written by consumerConnect and consumerDisconnect.
425 sp<ConsumerListener> mConsumerListener;
Daniel Lam6b091c52012-01-22 15:26:27 -0800426
427 // mSynchronousMode whether we're in synchronous mode or not
428 bool mSynchronousMode;
429
430 // mAllowSynchronousMode whether we allow synchronous mode or not
431 const bool mAllowSynchronousMode;
432
433 // mConnectedApi indicates the API that is currently connected to this
434 // BufferQueue. It defaults to NO_CONNECTED_API (= 0), and gets updated
435 // by the connect and disconnect methods.
436 int mConnectedApi;
437
438 // mDequeueCondition condition used for dequeueBuffer in synchronous mode
439 mutable Condition mDequeueCondition;
440
441 // mQueue is a FIFO of queued buffers used in synchronous mode
442 typedef Vector<int> Fifo;
443 Fifo mQueue;
444
445 // mAbandoned indicates that the BufferQueue will no longer be used to
446 // consume images buffers pushed to it using the ISurfaceTexture interface.
447 // It is initialized to false, and set to true in the abandon method. A
448 // BufferQueue that has been abandoned will return the NO_INIT error from
449 // all ISurfaceTexture methods capable of returning an error.
450 bool mAbandoned;
451
452 // mName is a string used to identify the BufferQueue in log messages.
453 // It is set by the setName method.
Daniel Lameae59d22012-01-22 15:26:27 -0800454 String8 mConsumerName;
Daniel Lam6b091c52012-01-22 15:26:27 -0800455
456 // mMutex is the mutex used to prevent concurrent access to the member
457 // variables of BufferQueue objects. It must be locked whenever the
458 // member variables are accessed.
459 mutable Mutex mMutex;
460
461 // mFrameCounter is the free running counter, incremented for every buffer queued
462 // with the surface Texture.
463 uint64_t mFrameCounter;
Daniel Lameae59d22012-01-22 15:26:27 -0800464
Daniel Lamb2675792012-02-23 14:35:13 -0800465 // mBufferHasBeenQueued is true once a buffer has been queued. It is reset
466 // by changing the buffer count.
Daniel Lameae59d22012-01-22 15:26:27 -0800467 bool mBufferHasBeenQueued;
Daniel Lamb2675792012-02-23 14:35:13 -0800468
469 // mDefaultBufferFormat can be set so it will override
470 // the buffer format when it isn't specified in dequeueBuffer
471 uint32_t mDefaultBufferFormat;
472
473 // mConsumerUsageBits contains flags the consumer wants for GraphicBuffers
474 uint32_t mConsumerUsageBits;
475
476 // mTransformHint is used to optimize for screen rotations
477 uint32_t mTransformHint;
Daniel Lam6b091c52012-01-22 15:26:27 -0800478};
479
480// ----------------------------------------------------------------------------
481}; // namespace android
482
483#endif // ANDROID_GUI_BUFFERQUEUE_H