RCRTCSurfaceTextureHelper

Helper class for using a SurfaceTexture to create WebRTC VideoFrames. In order to create WebRTC VideoFrames, render onto the SurfaceTexture. The frames will be delivered to the listener. Only one texture frame can be in flight at once, so the frame must be released 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 released.

Types

Link copied to clipboard
public interface Sink

Properties

Link copied to clipboard
public final Handler handler
Link copied to clipboard
public volatile boolean isTextureInUse
Link copied to clipboard
public final SurfaceTexture surfaceTexture
Link copied to clipboard
public final YuvConverter yuvConverter

Functions

Link copied to clipboard
public static RCRTCSurfaceTextureHelper create(String threadName, Context sharedContext)
Same as above with alignTimestamps set to false and yuvConverter set to new YuvConverter.
public static RCRTCSurfaceTextureHelper create(String threadName, Context sharedContext, boolean alignTimestamps)
Same as above with yuvConverter set to new YuvConverter.
public static RCRTCSurfaceTextureHelper create(String threadName, Context sharedContext, boolean alignTimestamps, YuvConverter yuvConverter)
Construct a new SurfaceTextureHelper sharing OpenGL resources with |sharedContext|.
Link copied to clipboard
public void dispose()
Call disconnect() to stop receiving frames.
Link copied to clipboard
public Handler getHandler()
Retrieve the handler that calls onFrame().
Link copied to clipboard
public SurfaceTexture getSurfaceTexture()
Retrieve the underlying SurfaceTexture.
Link copied to clipboard
public YuvConverter getYuvConverter()
Link copied to clipboard
public boolean isTextureInUse()
Link copied to clipboard
public void setFrameRotation(int rotation)
Set the rotation of the delivered frames.
Link copied to clipboard
public void setTextureSize(int textureWidth, int textureHeight)
Use this function to set the texture size.
Link copied to clipboard
Start to stream textures to the given |listener|.
Link copied to clipboard
public void stopListening()
Stop listening.
Link copied to clipboard
@Deprecated()
public I420Buffer textureToYuv(TextureBuffer textureBuffer)
Posts to the correct thread to convert |textureBuffer| to I420.