This change adds some infrastructure for testing the BufferQueue class. It
also includes a test that tests the new check in BufferQueue::acquireBuffer
that prevents the consumer from acquiring more than one buffer beyond the max
acquired buffer count that was set.
Change-Id: I38554ad3f9a53d2ddeba7ef0deee35ec2e2f9775
ISurfaceTexture::dequeueBuffer now returns the buffer's fence for the
client to wait on. For BufferQueue, this means passing it through
Binder so it can be returned to the SurfaceTextureClient. Now
SurfaceTextureClient is responsible for waiting on the fence in
dequeueBuffer instead of BufferQueue: one step closer to the goal.
Change-Id: I677ae758bcd23acee2d784b8cec11b32cccc196d
This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.
Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
This change adds the plumbing to SurfaceTextureClient, BufferQueue, and
SurfaceTexture to get the active rectangle passed to the ANativeWindow to
the buffer consumer.
Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
indeed, connect and queueBuffer return the same data, so it's
easier to have them use the same protocol.
Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
collapse setCrop, setTransform and setScalingMode to queueBuffer()
this ends up simplifying things quite a bit and reducing the numnber
of IPC needed per frame.
Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
the first time a surface was connected, the values returned
by query NATIVE_WINDOW_DEFAULT_{WIDTH|HEIGHT} and
NATIVE_WINDOW_TRANSFORM_HINT were wrong until a call
to queueBuffer was performed.
Bug: 5137366, 5121607
Change-Id: I7ac6b5b0daa876638f6bed7c20f286a6e6d984f6
This change adds the 'abandon' method to the SurfaceTexture C++ class.
This method may be used to put the SurfaceTexture in an abandoned state,
causing all ISurfaceTexture methods to fail.
Change-Id: Ibd261f7b73f44e2bec36a8508bf92113cfb7cf95
This change removes the SurfaceTexture::getAllocator method, as it's no
longer needed. Proper refcounting of the Gralloc buffers is now handled
by the IGraphicBufferAlloc binder marshalling code.
Change-Id: I5cffa6ebfc1bc5828fb7ce0e0a5b2f55cd8479da
This change makes the ANativeWindow connect and disconnect calls result
in an IPC to the SurfaceTexture object. This will allow us to prevent
multiple simultaneous connections from different processes.
Change-Id: Id9aa1003b1335b96ca6bd4a1f5a67aa433d42efb
This change the binder protocol between SurfaceTextureClient
and SurfaceTexture. dequeueBuffer() now takes the requested
parameters for the buffer. SurfaceTexture decides if the
buffer needs to be reallocated and does the allocation
if needed. In that case it returns BUFFER_NEEDS_REALLOCATION
to tell SurfaceTextureClient that it needs to call
requestBuffer (which all parameters have been removed) to
acquire a pointer to the buffer.
dequeueBuffer and requestBuffer could be folded into a single
IPC call, but we chose to optimize the case where buffers are
not created and avoid some complexity in the marshalling code.
Change-Id: I097a7f6f40a3491e10f3f3742eab33999286c304
SurfaceTexture now has the concept of default size a new method,
setDefaultBufferSize() to set it. When the default size is
changed, dequeueBuffer() will return a value telling the
client that it must ask for a new buffer.
The above only applies if the client has not
overriden the buffer size with setGeometry.
Change-Id: I520dc40363054b7e37fdb67d6a2e7bce70326e81
API addition: The timestamps are represented as nanoseconds from some
arbitrary time point. Like the SurfaceTexture transform matrix, the
timestamp retrieved by getTimestamp is for the last frame sent to the
GL texture using updateTexImage().
Camera HAL change: Expect vendors to set these timestamps using
native_window_set_buffers_timestamp(). For now, they are
autogenerated by SurfaceTextureClient if set_buffers_timestamp() is
never called, but such timing is likely not accurate enough to pass a
CTS test.
bug:3300707
Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
This change passes a reference to the IGraphicBufferAlloc binder object
to SurfaceTextureClient objects. When STC objects are created they
query their associated ISurfaceTexture object for the
IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers.
Having the SurfaceTextureClient hold this reference prevents the
GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers
before the SurfaceTextureClient is done with them.
Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c
related-bug: 3362519
This change adds the C++ implementation of SurfaceTexture and related
classes. The goal of this is for a SurfaceTexture to be passed to
camera service or Stagefright in place of a Surface to allow camera
preview or decoded video frames to be streamed to an OpenGL ES texture
that an application can use.
Change-Id: I55c83a7017f1ecb81c9c9e3252cbd118b914296c