public class SurfaceTextureHelper
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
SurfaceTextureHelper.OnTextureFrameAvailableListener
Callback interface for being notified that a new texture frame is available.
|
限定符和类型 | 方法和说明 |
---|---|
static SurfaceTextureHelper |
create(java.lang.String threadName,
EglBase.Context sharedContext)
Construct a new SurfaceTextureHelper sharing OpenGL resources with |sharedContext|.
|
VideoFrame.TextureBuffer |
createTextureBuffer(int width,
int height,
Matrix transformMatrix)
Creates a VideoFrame buffer backed by this helper's texture.
|
void |
dispose()
Call disconnect() to stop receiving frames.
|
Handler |
getHandler()
Retrieve the handler that calls onTextureFrameAvailable().
|
SurfaceTexture |
getSurfaceTexture()
Retrieve the underlying SurfaceTexture.
|
boolean |
isTextureInUse() |
void |
returnTextureFrame()
Call this function to signal that you are done with the frame received in
onTextureFrameAvailable().
|
void |
startListening(SurfaceTextureHelper.OnTextureFrameAvailableListener listener)
Start to stream textures to the given |listener|.
|
void |
stopListening()
Stop listening.
|
void |
surfaceTextureRebuild() |
VideoFrame.I420Buffer |
textureToYuv(VideoFrame.TextureBuffer textureBuffer)
Posts to the correct thread to convert |textureBuffer| to I420.
|
public static SurfaceTextureHelper create(java.lang.String threadName, EglBase.Context sharedContext)
public void startListening(SurfaceTextureHelper.OnTextureFrameAvailableListener listener)
public void stopListening()
public SurfaceTexture getSurfaceTexture()
public void surfaceTextureRebuild()
public Handler getHandler()
public void returnTextureFrame()
public boolean isTextureInUse()
public void dispose()
public VideoFrame.I420Buffer textureToYuv(VideoFrame.TextureBuffer textureBuffer)
public VideoFrame.TextureBuffer createTextureBuffer(int width, int height, Matrix transformMatrix)