public class SurfaceTextureHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SurfaceTextureHelper.OnTextureFrameAvailableListener
Callback interface for being notified that a new texture frame is available.
|
Modifier and Type | Field and Description |
---|---|
int |
mTextureType |
Modifier and Type | Method and Description |
---|---|
static SurfaceTextureHelper |
create(java.lang.String threadName,
EglBase.Context sharedContext)
Construct a new SurfaceTextureHelper sharing OpenGL resources with |sharedContext|.
|
void |
dispose()
Call disconnect() to stop receiving frames.
|
android.os.Handler |
getHandler()
Retrieve the handler that calls onTextureFrameAvailable().
|
android.graphics.SurfaceTexture |
getSurfaceTexture()
Retrieve the underlying SurfaceTexture.
|
boolean |
isTextureInUse() |
void |
lockBeforeUseTexture() |
boolean |
resetEglContext(EglBase.Context sharedContext) |
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 |
textureToYUV(java.nio.ByteBuffer buf,
int width,
int height,
int stride,
int textureId,
int textureType,
float[] transformMatrix) |
void |
unlockAfterUseTexture() |
public static SurfaceTextureHelper create(java.lang.String threadName, EglBase.Context sharedContext)
public void startListening(SurfaceTextureHelper.OnTextureFrameAvailableListener listener)
public void stopListening()
public android.graphics.SurfaceTexture getSurfaceTexture()
public android.os.Handler getHandler()
public void returnTextureFrame()
public boolean isTextureInUse()
public void dispose()
public boolean resetEglContext(EglBase.Context sharedContext)
public void textureToYUV(java.nio.ByteBuffer buf, int width, int height, int stride, int textureId, int textureType, float[] transformMatrix)
public void lockBeforeUseTexture()
public void unlockAfterUseTexture()