> What would be the use cases and what benefits do you see us getting from this? SurfaceTexture/Surface has several limitations. - [1] Consumer could exist only in one process and one thread. + If content side want to get access to the data, it needs to copy back from compositor to client side. It is implemented for video rendering to WebGL by Bug 1486659. But it does not work for all use cases like Bug 1526207 and offscreencanvas. + https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_SurfaceAllocatorService_68.pdf - [2] Consumer provide only one buffer access that exists on top. + During video rendering SurfaceTexture uses many buffers, only one to frame could be accessed via SurfaceTexture on consumer side. + https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_CodecProxy_68.pdf - [3] SurfaceTexture does not provide access to raw buffer + It is necessary to implement GetAsSourceSurface(). See Bug 1526207 AHardwareBuffer(android::GraphicBuffer) could remove the above limitations. Then, content process could access to a buffer without copy-back from compositor. And could implement GetAsSourceSurface() on any thread in content process. Further AHardwareBuffer could be used to implement video/WebGL overlay with ASurfaceTransaction that exists since android10(Q). See Bug 1529629.
Bug 1562818 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
> What would be the use cases and what benefits do you see us getting from this? SurfaceTexture/Surface has several limitations. - [1] Consumer could exist only in one process and one thread. + If content side want to get access to the data, it needs to copy back from compositor to client side. It is implemented for video rendering to WebGL by Bug 1486659. But it does not work for all use cases like Bug 1526207 and offscreencanvas. + https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_SurfaceAllocatorService_68.pdf - [2] Consumer provide only one buffer access that exists on top. + During video rendering SurfaceTexture uses many buffers, only one top frame could be accessed via SurfaceTexture on consumer side. + https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_CodecProxy_68.pdf - [3] SurfaceTexture does not provide access to raw buffer + It is necessary to implement GetAsSourceSurface(). See Bug 1526207 AHardwareBuffer(android::GraphicBuffer) could remove the above limitations. Then, content process could access to a buffer without copy-back from compositor. And could implement GetAsSourceSurface() on any thread in content process. Further AHardwareBuffer could be used to implement video/WebGL overlay with ASurfaceTransaction that exists since android10(Q). See Bug 1529629.