Package com.banuba.sdk.render_target
Class OpenGLRenderTarget
- java.lang.Object
-
- com.banuba.sdk.render_target.OpenGLRenderTarget
-
- All Implemented Interfaces:
IRenderedFrameProvider
,IRenderTarget
,IRenderTargetPresentable
public class OpenGLRenderTarget extends java.lang.Object implements IRenderTarget
Implementation of the RenderTarget with using OpenGL render
-
-
Constructor Summary
Constructors Constructor Description OpenGLRenderTarget(com.banuba.sdk.effect_player.EffectPlayer effectPlayer, android.util.Size renderSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
Activate rendering contextvoid
destroy()
Destroy RenderTarget and release resourcesEglCore
getContext()
long
getFrameTimeNanos()
Get the drawing time of the current frameint
getGlTexture()
android.util.Size
getRenderingSize()
Get render surface sizevoid
present()
Display frame on attached surfacevoid
present(WindowSurface windowSurface, android.graphics.Rect renderingRect)
Draw frame on surfacecom.banuba.sdk.types.PixelBuffer
readPixels()
Get the rendered frame as an array of pixelsvoid
resize()
Recalculate viewport size and set new draw sizesvoid
setFrameTimeNanos(long timeNanos)
Set frame drawing time.
-
-
-
Method Detail
-
getContext
public EglCore getContext()
-
destroy
public void destroy()
Description copied from interface:IRenderTarget
Destroy RenderTarget and release resources- Specified by:
destroy
in interfaceIRenderTarget
-
activate
public void activate()
Description copied from interface:IRenderTarget
Activate rendering context- Specified by:
activate
in interfaceIRenderTarget
-
getRenderingSize
public android.util.Size getRenderingSize()
Description copied from interface:IRenderTargetPresentable
Get render surface size- Specified by:
getRenderingSize
in interfaceIRenderTargetPresentable
- Returns:
- size of the rendering viewport
-
present
public void present(WindowSurface windowSurface, android.graphics.Rect renderingRect)
Description copied from interface:IRenderTargetPresentable
Draw frame on surface- Specified by:
present
in interfaceIRenderTargetPresentable
- Parameters:
windowSurface
- the surface on which the frame will be drawnrenderingRect
- scaling and positioning the frame on the surface
-
present
public void present()
Description copied from interface:IRenderTargetPresentable
Display frame on attached surface- Specified by:
present
in interfaceIRenderTargetPresentable
-
getGlTexture
public int getGlTexture()
-
resize
public void resize()
Description copied from interface:IRenderTarget
Recalculate viewport size and set new draw sizes- Specified by:
resize
in interfaceIRenderTarget
-
readPixels
public com.banuba.sdk.types.PixelBuffer readPixels()
Description copied from interface:IRenderedFrameProvider
Get the rendered frame as an array of pixels- Specified by:
readPixels
in interfaceIRenderedFrameProvider
- Returns:
- pixel buffer, stores dimensions, pixel type and array of pixels
-
setFrameTimeNanos
public void setFrameTimeNanos(long timeNanos)
Description copied from interface:IRenderTarget
Set frame drawing time. Necessary for correct video recording- Specified by:
setFrameTimeNanos
in interfaceIRenderTarget
- Parameters:
timeNanos
- current frame drawing time in nanoseconds
-
getFrameTimeNanos
public long getFrameTimeNanos()
Description copied from interface:IRenderTargetPresentable
Get the drawing time of the current frame- Specified by:
getFrameTimeNanos
in interfaceIRenderTargetPresentable
- Returns:
- frame drawing time in nanoseconds
-
-