webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Classes | |
interface | OnTextureFrameAvailableListener |
Public Member Functions | |
void | startListening (final OnTextureFrameAvailableListener listener) |
void | stopListening () |
SurfaceTexture | getSurfaceTexture () |
Handler | getHandler () |
void | returnTextureFrame () |
boolean | isTextureInUse () |
void | dispose () |
void | textureToYUV (final ByteBuffer buf, final int width, final int height, final int stride, final int textureId, final float[] transformMatrix) |
Static Public Member Functions | |
static SurfaceTextureHelper | create (final String threadName, final EglBase.Context sharedContext) |
Helper class to create and synchronize access to a SurfaceTexture. The caller will get notified of new frames in onTextureFrameAvailable(), and should call returnTextureFrame() when done with the frame. Only one texture frame can be in flight at once, so returnTextureFrame() must be called in order to receive a new frame. Call stopListening() to stop receiveing new frames. Call dispose to release all resources once the texture frame is returned. Note that there is a C++ counter part of this class that optionally can be used. It is used for wrapping texture frames into webrtc::VideoFrames and also handles calling returnTextureFrame() when the webrtc::VideoFrame is no longer used.
|
inlinestatic |
Construct a new SurfaceTextureHelper sharing OpenGL resources with |sharedContext|. A dedicated thread and handler is created for handling the SurfaceTexture. May return null if EGL fails to initialize a pixel buffer surface and make it current.
|
inline |
Call disconnect() to stop receiving frames. OpenGL resources are released and the handler is stopped when the texture frame has been returned by a call to returnTextureFrame(). You are guaranteed to not receive any more onTextureFrameAvailable() after this function returns.
|
inline |
Retrieve the handler that calls onTextureFrameAvailable(). This handler is valid until dispose() is called.
|
inline |
Retrieve the underlying SurfaceTexture. The SurfaceTexture should be passed in to a video producer such as a camera or decoder.
|
inline |
|
inline |
Call this function to signal that you are done with the frame received in onTextureFrameAvailable(). Only one texture frame can be in flight at once, so you must call this function in order to receive a new frame.
|
inline |
Start to stream textures to the given |listener|. If you need to change listener, you need to call stopListening() first.
|
inline |
Stop listening. The listener set in startListening() is guaranteded to not receive any more onTextureFrameAvailable() callbacks after this function returns.
|
inline |