Package tvi.webrtc

Class GlTextureFrameBuffer


  • public class GlTextureFrameBuffer
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      GlTextureFrameBuffer​(int pixelFormat)
      Generate texture and framebuffer resources.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFrameBufferId()
      Gets the OpenGL frame buffer id.
      int getHeight()  
      int getTextureId()
      Gets the OpenGL texture id.
      int getWidth()  
      void release()
      Release texture and framebuffer.
      void setSize​(int width, int height)
      (Re)allocate texture.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • 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.