summaryrefslogtreecommitdiffstats
path: root/libs/gui/CpuConsumer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Within CpuConsumer, use gralloc lockAsync/unlockAsyncRiley Andrews2014-08-191-31/+60
| | | | Change-Id: I6b2cd195e111c3c7bf94c8052af4db92e09649a5
* gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquiredIgor Murashkin2013-08-141-1/+3
| | | | | | | | | | | - Return NOT_ENOUGH_DATA instead of INVALID_OPERATION when too many buffers have already been locked. - INVALID_OPERATION is nominally used when something irrecoverable happens, but in this case the client just needs to call unlockBuffer to go back into a good state. Bug: 10333400 Change-Id: I3a034d77de85741429f832a90eedd670afa1dc94
* All consumers now take an IGraphicBufferConsumer instead of a BufferQueueMathias Agopian2013-08-061-6/+6
| | | | | | | | | | this means they only have access to the consumer end of the interface. we had a lot of code that assumed consumers where holding a BufferQueue (i.e.: both ends), so most of this change is untangling in fix that Bug: 9265647 Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
* BufferQueue improvements and APIs changesMathias Agopian2013-07-181-3/+2
| | | | | | | | | | | | | | | | | | | | this is the first step of a series of improvements to BufferQueue. A few things happen in this change: - setSynchronousMode() goes away as well as the SynchronousModeAllowed flag - BufferQueue now defaults to (what used to be) synchronous mode - a new "controlled by app" flag is passed when creating consumers and producers those flags are used to put the BufferQueue in a mode where it will never block if both flags are set. This is achieved by: - returning an error from dequeueBuffer() if it would block - making sure a buffer is always available by replacing the previous buffer with the new one in queueBuffer() (note: this is similar to what asynchrnous mode used to be) Note: in this change EGL's swap-interval 0 is broken; this will be fixed in another change. Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
* always pass the BufferQueue explicitely to consumersMathias Agopian2013-07-121-2/+3
| | | | Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
* Pay attention to buffer timestampsAndy McFadden2013-07-101-1/+1
| | | | | | | | | | | | | | When acquiring a buffer, SurfaceFlinger now computes the expected presentation time and passes it to the BufferQueue acquireBuffer() method. If it's not yet time to display the buffer, acquireBuffer() returns PRESENT_LATER instead of a buffer. The current implementation of the expected-present-time computation uses approximations and guesswork. Bug 7900302 Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
* CpuConsumer: Add set buffer size and format functions.Zhijun He2013-06-101-0/+12
| | | | | | | | Add setDefaultBufferSize() and setDefaultBufferFormat(). ImageReader JNI need them. Bug: 9254294 Change-Id: I7d2464d43b0ca73fbb834ed22cecbfbb30eef60c
* BufferQueue: track buffer-queue by instance vs. by referenceLajos Molnar2013-05-231-1/+3
| | | | | | | | | | | | | | | | | | | Instead of representing the buffer-queue as a vector of buffer indices, represent them as a vector of BufferItems (copies). This allows modifying the buffer slots independent of the queued buffers. As part of this change, BufferSlot properties that are only been relevant in the buffer-queue have been removed. Also, invalid scalingMode in queueBuffer now returns an error. ConsumerBase has also changed to allow reuse of the same buffer slots by different buffers. Change-Id: If2a698fa142b67c69ad41b8eaca6e127eb3ef75b Signed-off-by: Lajos Molnar <lajos@google.com> Related-to-bug: 7093648
* make the warning timout of Fence::waitForever() implicit and longerMathias Agopian2013-05-161-1/+1
| | | | | | | | | | - timeout is now 3 seconds instead of 1 - simplifies the API a bit - allows us to change/tweak this timeout globaly Bug: 8988871 Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
* Add support for HAL_PIXEL_FORMAT_YCbCr_420_888Eino-Ville Talvala2013-05-061-10/+35
| | | | | | | | | - Add fields to CpuConsumer::LockedBuffer for new information - New lock methods for GraphicBuffer and GraphicBufferMapper for the format Bug: 8734880 Change-Id: If31f82c62d64b6942cf4cc6e5715585c03273f12
* CpuConsumer: Properly track acquired buffersEino-Ville Talvala2013-03-051-29/+47
| | | | | | | | | | | | | | CpuConsumer cannot simply assume a slot's buffer is the same buffer between acquire and release, and therefore it could be possible for the same slot to get used for a second acquired buffer, if there's a producer disconnect in between. This would cause a problem when the first buffer is released by the consumer. Instead, use an independent list of acquired buffers to properly track their state. Bug: 8291751 Change-Id: I0241ad8704e53d47318c7179b13daed8181b1fab
* CpuConsumer: Add optional asynchronous modeEino-Ville Talvala2013-02-281-2/+2
| | | | | | | Bug: 8290146 Bug: 8291751 Change-Id: I9c8ac4bff38b0411e987a204e540d018dba6d0b4
* CpuConsumer: Don't unlock buffers on producer disconnectEino-Ville Talvala2013-02-281-20/+26
| | | | | | Bug: 8291751 Change-Id: I062a3d34b41183d07fb6b9109cdb6bf0c0c75672
* Add Fence::waitForever which logs a warning timeout, and use itJesse Hall2012-10-021-1/+1
| | | | | Bug: 7217641 Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
* libgui: move fence handling into ConsumerBaseJamie Gennis2012-09-061-1/+1
| | | | | | | | This change moves some common fence handling code into the base class for BufferQueue consumer classes. It also makes the ConsumerBase class initialize a buffer slot's fence with the acquire fence every time a buffer is acquired. Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
* BufferQueue: use max acquired buffer countJamie Gennis2012-08-301-1/+2
| | | | | | | | | This change makes BufferQueue derive the min undequeued buffer count from a max acquired buffer count that is set by the consumer. This value may be set at any time that a producer is not connected to the BufferQueue rather than at BufferQueue construction time. Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
* Add BufferItemConsumer, a simple BufferQueue consumer.Eino-Ville Talvala2012-08-211-0/+3
| | | | | | | | | | | | | | BufferItemConsumer allows for acquiring BufferQueue's BufferItems, which contain all the data and metadata the BufferQueue has for a given graphics buffer. This consumer is useful when direct access to the native buffer_handles is needed by the client. Also includes a minor cleanup of CpuConsumer's use of 'virtual'. Bug: 6243944 Change-Id: If7dc4192b15ac499555f1eda42a85140f2434795
* CpuConsumer: inherit from ConsumerBaseEino-Ville Talvala2012-08-201-113/+26
| | | | Change-Id: I55178b1d673ffa0fbc6e63ef47642c64d4d03228
* Return fence from acquireBufferJesse Hall2012-06-301-0/+9
| | | | Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
* Transfer HWC release fences to BufferQueueJesse Hall2012-06-211-2/+4
| | | | | | | | | | | | | | | | | | After a HWC set, each SurfaceFlinger Layer retrieves the release fence HWC returned and gives it to the layer's SurfaceTexture. The SurfaceTexture accumulates the fences into a merged fence until the next updateTexImage, then passes the merged fence to the BufferQueue in releaseBuffer. In a follow-on change, BufferQueue will return the fence along with the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the fence to signal before returning. The releaseFence default value for BufferQueue::releaseBuffer() is temporary to avoid transient build breaks with a multi-project checkin. It'll disappear in the next change. Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
* Add a BufferQueue CPU consumer.Eino-Ville Talvala2012-05-141-0/+231
Aimed for use cases where gralloc buffers need to be consumed by CPU users, such as camera image data streams. The CpuConsumer is a synchronous queue, which exposes raw pointers to the underlying graphics buffers to applications. Multiple buffers may be acquired at once, up to the limit set at time of construction. Change-Id: If1d99f12471438e95a69696e40685948778055fd