Changes

Jump to: navigation, search

Platform/GFX/Gralloc

55 bytes added, 07:17, 22 May 2013
How Android is using Gralloc
The concrete implementation of ANativeWindowBuffer is '''GraphicBuffer''', the class discussed above in this document.
 
 
== SurfaceTexture ==
SurfaceTexture is the server side of a client-server architecturesystem, whose client side is SurfaceTextureClient. The As explained above, SurfaceTextureClient implements is a concrete implementation of ANativeWindow, into which the application renders.
The ANativeWindow is a glue to make SurfaceTexture can be used as render surface of EGL, which abstract out some buffer management detail when use OpenGL to manipulate shared memory in Android and make it easier to use OpenGL across process. Since eglSwapBuffers calls to ANativeWindow::dequeueBuffer to acquire new buffer and ANativeWindow::queueBuffer to return the buffer implicitly, the user can avoid to create several textures and manage them directly. The other useful feature of implement it in this way is that most BSP vendor provided graphics profilers(e.g. Adreno profiler from QCOM, PerfHUD ES from nVidia) that recognize the eglSwapBuffers call as frame boundary to collect frame based GL information from driver to help developement and performance tuning. SurfaceTexture is a unified buffer management mechanism on Android, which you can setup it to run in different mode: sync/async, single/multiple buffer by simple function call which make SurfaceTexture be used everywhere in Android: Codec/Camera configure it to have serveral buffer (based on hardware, 9 for camera preview in Unagi) run asynchronously, Layer rendering configure it to have 2~3 buffer (based on BSP) run synchronously. And since its flexbility, you can encode a OpenGL rendered surface on-the-fly by using SurfaceMediaSource (which implement ISurfaceTexture) which is the core of Google Miracast.
Confirm
753
edits

Navigation menu