Package tvi.webrtc

Class GlTextureFrameBuffer

java.lang.Object
tvi.webrtc.GlTextureFrameBuffer

public class GlTextureFrameBuffer extends Object
Helper class for handling OpenGL framebuffer with only color attachment and no depth or stencil buffer. Intended for simple tasks such as texture copy, texture downscaling, and texture color conversion. This class is not thread safe and must be used by a thread with an active GL context.
  • Constructor Details

    • GlTextureFrameBuffer

      public GlTextureFrameBuffer(int pixelFormat)
      Generate texture and framebuffer resources. An EGLContext must be bound on the current thread when calling this function. The framebuffer is not complete until setSize() is called.
  • Method Details

    • setSize

      public void setSize(int width, int height)
      (Re)allocate texture. Will do nothing if the requested size equals the current size. An EGLContext must be bound on the current thread when calling this function. Must be called at least once before using the framebuffer. May be called multiple times to change size.
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getFrameBufferId

      public int getFrameBufferId()
      Gets the OpenGL frame buffer id. This value is only valid after setSize() has been called.
    • getTextureId

      public int getTextureId()
      Gets the OpenGL texture id. This value is only valid after setSize() has been called.
    • release

      public void release()
      Release texture and framebuffer. An EGLContext must be bound on the current thread when calling this function. This object should not be used after this call.