Class OpenGLRenderTarget

java.lang.Object
com.banuba.sdk.render_target.OpenGLRenderTarget
All Implemented Interfaces:
IRenderedFrameProvider, IRenderTarget, IRenderTargetPresentable

public class OpenGLRenderTarget extends Object implements IRenderTarget
Implementation of the RenderTarget with using OpenGL render
  • Constructor Details

    • OpenGLRenderTarget

      public OpenGLRenderTarget(com.banuba.sdk.effect_player.EffectPlayer effectPlayer, android.util.Size renderSize)
  • Method Details

    • getContext

      public EglCore getContext()
    • destroy

      public void destroy()
      Description copied from interface: IRenderTarget
      Destroy RenderTarget and release resources
      Specified by:
      destroy in interface IRenderTarget
    • activate

      public void activate()
      Description copied from interface: IRenderTarget
      Activate rendering context
      Specified by:
      activate in interface IRenderTarget
    • getRenderingSize

      public android.util.Size getRenderingSize()
      Description copied from interface: IRenderTargetPresentable
      Get render surface size
      Specified by:
      getRenderingSize in interface IRenderTargetPresentable
      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 interface IRenderTargetPresentable
      Parameters:
      windowSurface - the surface on which the frame will be drawn
      renderingRect - 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 interface IRenderTargetPresentable
    • 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 interface IRenderTarget
    • 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 interface IRenderedFrameProvider
      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 interface IRenderTarget
      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 interface IRenderTargetPresentable
      Returns:
      frame drawing time in nanoseconds