EglRenderer

open class EglRenderer : VideoSink

Implements VideoSink by displaying the video stream on an EGL Surface. This class is intended to be used as a helper class for rendering on SurfaceViews and TextureViews.

Inheritors

Constructors

Link copied to clipboard
constructor(name: String)
Standard constructor.
constructor(name: String, videoFrameDrawer: VideoFrameDrawer)

Types

Link copied to clipboard
interface ErrorCallback
Callback for clients to be notified about errors encountered during rendering.
Link copied to clipboard
interface FrameListener

Functions

Link copied to clipboard
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
open fun clearImage()
Post a task to clear the surface to a transparent uniform color.
open fun clearImage(r: Float, g: Float, b: Float, a: Float)
Post a task to clear the surface to a specific color.
Link copied to clipboard
open fun createEglSurface(surfaceTexture: SurfaceTexture)
open fun createEglSurface(surface: Surface)
Link copied to clipboard
Link copied to clipboard
open fun init(@Nullable sharedContext: EglBase.Context, configAttributes: Array<Int>, drawer: RendererCommon.GlDrawer)
Same as above with usePresentationTimeStamp set to false.
open fun init(eglThread: EglThread, drawer: RendererCommon.GlDrawer, usePresentationTimeStamp: Boolean)

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
open fun onFrame(frame: VideoFrame)
Implementations should call frame.retain() if they need to hold a reference to the frame after this function returns.
Link copied to clipboard
open fun pauseVideo()
Link copied to clipboard
open fun printStackTrace()
Link copied to clipboard
open fun release()
Block until any pending frame is returned and all GL resources released, even if an interrupt occurs.
Link copied to clipboard
open fun releaseEglSurface(completionCallback: Runnable)
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
open fun setFpsReduction(fps: Float)
Limit render framerate.
Link copied to clipboard
open fun setLayoutAspectRatio(layoutAspectRatio: Float)
Set layout aspect ratio.
Link copied to clipboard
open fun setMirror(mirror: Boolean)
Set if the video stream should be mirrored horizontally or not.
Link copied to clipboard
open fun setMirrorVertically(mirrorVertically: Boolean)
Set if the video stream should be mirrored vertically or not.