Commit Graph

34 Commits

Author SHA1 Message Date
Andy McFadden 2adaf04fab Rename ISurfaceTexture and SurfaceTexture
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
2012-12-18 13:10:48 -08:00
Andy McFadden 0273adbf0b Added some comments
Added a quick intro section at the top of the class.  Also noted
the proposed new name for the class.

Change-Id: I3f79663527544aa4e910db0e5a1374b54d16ba2f
2012-12-17 12:40:50 -08:00
Jamie Gennis 4def860030 SurfaceTextureClient: remove a deprecated ctor
Change-Id: Ibf2746fdca26851677cd90199c60eab80f6d0c73
2012-12-12 12:13:54 -08:00
Jamie Gennis d8e812ce6f Update ANativeWindow clients for sync
This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.

Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6
2012-06-20 15:48:30 -07:00
Jamie Gennis b7a6b96301 libgui: remove setPostTransformCrop
This change removes the setPostTransformCrop function from
SurfaceTextureClient.  It also includes a small logging fix in BufferQueue.

Bug: 6299171
Change-Id: Ifd0ed05b95dad6085e7a8267fda4d69b76ea3bad
2012-05-14 15:41:22 -07:00
Jamie Gennis d72f233ffa libgui: Add support for post-xform crops.
This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.

Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
2012-05-08 17:08:33 -07:00
Jamie Gennis efc7ab6dce libgui: Add plumbing for active rectangle
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
2012-04-24 17:34:38 -07:00
Mathias Agopian 2488b20aec add a way to query whether an ANativeWindow consumer is running ahead of the producer
Change-Id: Ibccfa1feb56db2ab11f0c0934ce2d570a2b65ae2
2012-04-23 20:06:02 -07:00
Mathias Agopian ac6035a12a s/w rendered apps can now use n-buffering (n>2)
Bug: 6311881
Change-Id: I6e52e281e8d432430aad011f6d9dcf35d7b4ac7d
2012-04-13 16:04:44 -07:00
Michael I. Gold 55a701459d SurfaceTextureClient: support for application buffer dimensions
Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.

Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
2012-04-11 18:37:54 -07:00
Daniel Lam abe61bfda4 BufferQueue no longer hardcodes buffer counts
BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.

Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
2012-04-06 21:02:13 -07:00
Mathias Agopian 851ef8f1bf reduce IPC with BufferQueue
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
2012-03-30 15:16:30 -07:00
Mathias Agopian b0e76f456a remove dependency of EGL on ndk header
Change-Id: Ia6e489b5b4f028864bdf54923e81f604710dd8ad
2012-03-23 14:15:44 -07:00
Daniel Lam b267579ba8 SurfaceTexture: Fully refactored from BufferQueue
SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
2012-03-13 14:39:07 -07:00
Mathias Agopian 5f2165f945 remove dependency on android_native{s_priv|buffer}.h
Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
2012-02-24 18:26:01 -08:00
Mathias Agopian a36bcd53ac attempt to fix bug 5313580
the working theory here is that a Surface object has become non-promotable
because it lost its last reference; later Surface::readFromParcel is called
the previous surface is found in the cache, but can't be promoted. this causes
a new Surface object to be created which will promptly try to connect to the
CPU_API -- this in turn will fail because the previous (now dead) surface is
still connected.

To fix this, we make sure to disconnect from the SurfaceTexture when
Surface[TextureClient] is destroyed.

Change-Id: I422234868a05d7b7d283e9d5a85f7ab79e65d8a9
2011-11-17 18:46:09 -08:00
Mathias Agopian 3fbce7c560 remove dead code and member variables.
also fix some comments and improve debugging logs.

Change-Id: I83e55309f306332b59e1ec46104c4a7fffbf3c97
2011-07-25 20:03:43 -07:00
Jamie Gennis 976f494d53 SurfaceTexture: remove getAllocator
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
2011-07-21 14:32:56 -07:00
Mathias Agopian 97c602c5af implement: "Add an ANativeWindow API for SurfaceFlinger to suggest an optimal buffer orientation"
Bug: 4487161
Change-Id: I883f34efe542c2a566d04966f873374f40c50092
2011-07-19 15:24:46 -07:00
Mathias Agopian 7734ebfe47 Add set_scaling_mode() to ANativeWindow.
This allows to specify the scaling mode independently from
the buffer size.

Change-Id: Iaa2baa660445531a97d3fac192e580f4929c5d3b
2011-07-19 13:05:11 -07:00
Mathias Agopian 8f9dbf9e13 move lock/unlock implementaion outside of Surface into SurfaceTextureClient
This makes ANativeWindow_lock/ANativeWindow_unlockAndPost work
with ANativeWindows implemented by Surface and SurfaceTextureClient.

Also, Surface now inherits directly from SurfaceTextureClient.

Bug: 5003724
Change-Id: I9f285877c7bae9a262e9a7af91c2bae78804b2ef
2011-07-15 17:47:08 -07:00
Jamie Gennis 677517ae3f Merge changes Id9aa1003,I8c154189
* changes:
  SurfaceTexture: make (dis)connect into an IPC
  SurfaceTexture: add support for new connect values
2011-07-14 17:54:27 -07:00
Jamie Gennis fe0a87b546 SurfaceTexture: make (dis)connect into an IPC
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
2011-07-14 17:48:32 -07:00
Jamie Gennis bee205fd58 EGL: fix the ANativeWindow size/fmt override
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface.  The new behavior
is to leave the size untouched when overriding the format.  The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.

It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.

Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.

Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
2011-07-11 12:31:45 -07:00
Jamie Gennis 1c4414091c SurfaceTexture: fix a NULL ptr dereference.
This change adds a NULL check when searching the slot list in
SurfaceTextureClient for the slot corresponding to a buffer being
queued or canceled.

Bug: 4645023
Change-Id: I806cbc1e34da118ea33a83c4f25ce8193ba1c3ad
2011-06-20 14:16:49 -07:00
Mathias Agopian 8072711307 Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Change-Id: I8382e346ddaa2c4c8ff56ac3ffd7f0109572f188
2011-05-11 18:01:51 -07:00
Iliyan Malchev 697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
Iliyan Malchev 41abd67302 frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method

Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:40 -07:00
Mathias Agopian 7a042bf324 changes to SurfaceTexture needed for unification with SF
- implement connect/disconnect
- implement missing query
- handle texture_2d in addition to texture_external_oes

Change-Id: I971a70821f00f22b01f5337de4a7d451177fec4d
2011-04-11 21:19:55 -07:00
Eino-Ville Talvala 1d01a12e71 Add support for timestamps into SurfaceTexture.
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
2011-03-17 13:10:03 -07:00
Jamie Gennis bae774eb20 SurfaceTextureClient: Add ISurfaceTexture getter.
This change adds a getter method to SurfaceTextureClient to get the
ISurfaceTexture object with which the SurfaceTextureClient is
communicating.

Bug: 4086509
Change-Id: Ifec621e0fe5392a5be56b2348fdc54067cbebcdd
2011-03-14 17:47:11 -07:00
Jamie Gennis 9d4d6c101d Add the MIN_UNDEQUEUED_BUFFERS query to ANW.
This change adds a new query to ANativeWindow for getting the minimum
number of buffers that must be left un-dequeued during the steady-state
operation of the ANativeWindow.

Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551
Related-Bug: 3356050
2011-02-28 12:24:40 -08:00
Jamie Gennis 1b20cde313 Pass the IGraphicBufferAlloc to SurfaceTextureClient.
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
2011-02-02 15:31:47 -08:00
Jamie Gennis 8ba32fade1 Add the SurfaceTexture C++ implementation.
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
2011-01-06 13:20:47 -08:00