webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Public Member Functions | List of all members
org.webrtc.EglRenderer Class Reference

Inherits org.webrtc.VideoRenderer.Callbacks.

Classes

interface  FrameListener
 

Public Member Functions

 EglRenderer (String name)
 
void init (final EglBase.Context sharedContext, final int[] configAttributes, RendererCommon.GlDrawer drawer)
 
void createEglSurface (Surface surface)
 
void createEglSurface (SurfaceTexture surfaceTexture)
 
void release ()
 
void printStackTrace ()
 
void setMirror (final boolean mirror)
 
void setLayoutAspectRatio (float layoutAspectRatio)
 
void setFpsReduction (float fps)
 
void disableFpsReduction ()
 
void pauseVideo ()
 
void addFrameListener (final FrameListener listener, final float scale)
 
void addFrameListener (final FrameListener listener, final float scale, final RendererCommon.GlDrawer drawer)
 
void removeFrameListener (final FrameListener listener)
 
void renderFrame (VideoRenderer.I420Frame frame)
 
void releaseEglSurface (final Runnable completionCallback)
 
void clearImage ()
 

Detailed Description

Implements org.webrtc.VideoRenderer.Callbacks 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.

Constructor & Destructor Documentation

◆ EglRenderer()

org.webrtc.EglRenderer.EglRenderer ( String  name)
inline

Standard constructor. The name will be used for the render thread name and included when logging. In order to render something, you must first call init() and createEglSurface.

Member Function Documentation

◆ addFrameListener() [1/2]

void org.webrtc.EglRenderer.addFrameListener ( final FrameListener  listener,
final float  scale 
)
inline

Register a callback to be invoked when a new video frame has been received. This version uses the drawer of the EglRenderer that was passed in init.

Parameters
listenerThe callback to be invoked.
scaleThe scale of the Bitmap passed to the callback, or 0 if no Bitmap is required.

◆ addFrameListener() [2/2]

void org.webrtc.EglRenderer.addFrameListener ( final FrameListener  listener,
final float  scale,
final RendererCommon.GlDrawer  drawer 
)
inline

Register a callback to be invoked when a new video frame has been received.

Parameters
listenerThe callback to be invoked.
scaleThe scale of the Bitmap passed to the callback, or 0 if no Bitmap is required.
drawerCustom drawer to use for this frame listener.

◆ clearImage()

void org.webrtc.EglRenderer.clearImage ( )
inline

Post a task to clear the TextureView to a transparent uniform color.

◆ createEglSurface() [1/2]

void org.webrtc.EglRenderer.createEglSurface ( Surface  surface)
inline

◆ createEglSurface() [2/2]

void org.webrtc.EglRenderer.createEglSurface ( SurfaceTexture  surfaceTexture)
inline

◆ disableFpsReduction()

void org.webrtc.EglRenderer.disableFpsReduction ( )
inline

◆ init()

void org.webrtc.EglRenderer.init ( final EglBase.Context  sharedContext,
final int []  configAttributes,
RendererCommon.GlDrawer  drawer 
)
inline

Initialize this class, sharing resources with |sharedContext|. The custom |drawer| will be used for drawing frames on the EGLSurface. This class is responsible for calling release() on |drawer|. It is allowed to call init() to reinitialize the renderer after a previous init()/release() cycle.

◆ pauseVideo()

void org.webrtc.EglRenderer.pauseVideo ( )
inline

◆ printStackTrace()

void org.webrtc.EglRenderer.printStackTrace ( )
inline

◆ release()

void org.webrtc.EglRenderer.release ( )
inline

Block until any pending frame is returned and all GL resources released, even if an interrupt occurs. If an interrupt occurs during release(), the interrupt flag will be set. This function should be called before the Activity is destroyed and the EGLContext is still valid. If you don't call this function, the GL resources might leak.

◆ releaseEglSurface()

void org.webrtc.EglRenderer.releaseEglSurface ( final Runnable  completionCallback)
inline

Release EGL surface. This function will block until the EGL surface is released.

◆ removeFrameListener()

void org.webrtc.EglRenderer.removeFrameListener ( final FrameListener  listener)
inline

Remove any pending callback that was added with addFrameListener. If the callback is not in the queue, nothing happens. It is ensured that callback won't be called after this method returns.

Parameters
runnableThe callback to remove.

◆ renderFrame()

void org.webrtc.EglRenderer.renderFrame ( VideoRenderer.I420Frame  frame)
inline

◆ setFpsReduction()

void org.webrtc.EglRenderer.setFpsReduction ( float  fps)
inline

Limit render framerate.

Parameters
fpsLimit render framerate to this value, or use Float.POSITIVE_INFINITY to disable fps reduction.

◆ setLayoutAspectRatio()

void org.webrtc.EglRenderer.setLayoutAspectRatio ( float  layoutAspectRatio)
inline

Set layout aspect ratio. This is used to crop frames when rendering to avoid stretched video. Set this to 0 to disable cropping.

◆ setMirror()

void org.webrtc.EglRenderer.setMirror ( final boolean  mirror)
inline

Set if the video stream should be mirrored or not.


The documentation for this class was generated from the following file: