SurfaceEglRenderer
Display the video stream on a Surface. renderFrame() is asynchronous to avoid blocking the calling thread. This class is thread safe and handles access from potentially three different threads: Interaction from the main app in init, release and setMirror. Interaction from C++ rtc::VideoSinkInterface in renderFrame. Interaction from SurfaceHolder lifecycle in surfaceCreated, surfaceChanged, and surfaceDestroyed.
Functions
Link copied to clipboard
Link copied to clipboard
open fun init(sharedContext: EglBase.Context, configAttributes: Array<Int>, drawer: RendererCommon.GlDrawer)
Same as above with usePresentationTimeStamp set to false.
open fun init(sharedContext: EglBase.Context, rendererEvents: RendererCommon.RendererEvents, configAttributes: Array<Int>, drawer: RendererCommon.GlDrawer)
Initialize this class, sharing resources with `sharedContext`.
Link copied to clipboard
Implementations should call frame.retain() if they need to hold a reference to the frame after this function returns.
Link copied to clipboard
Link copied to clipboard
Limit render framerate.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Inherited functions
Link copied to clipboard
open fun addFrameListener(listener: EglRenderer.FrameListener, scale: Float, drawerParam: RendererCommon.GlDrawer)
open fun addFrameListener(listener: EglRenderer.FrameListener, scale: Float, @Nullable drawerParam: RendererCommon.GlDrawer, applyFpsReduction: Boolean)
Register a callback to be invoked when a new video frame has been received.
Link copied to clipboard
Post a task to clear the surface to a transparent uniform color.
Post a task to clear the surface to a specific color.
Link copied to clipboard
Link copied to clipboard
open fun init(@Nullable sharedContext: EglBase.Context, configAttributes: Array<Int>, drawer: RendererCommon.GlDrawer, usePresentationTimeStamp: Boolean)
Initialize this class, sharing resources with `sharedContext`.
Link copied to clipboard
Link copied to clipboard
Release EGL surface.
Link copied to clipboard
Remove any pending callback that was added with addFrameListener.
Link copied to clipboard
Can be set in order to be notified about errors encountered during rendering.
Link copied to clipboard
Set layout aspect ratio.
Link copied to clipboard
Set if the video stream should be mirrored vertically or not.