Package 

Class RendererHolder

  • All Implemented Interfaces:
    com.serenegiant.opengl.renderer.IRendererHolder , java.lang.Runnable

    
    public class RendererHolder
    extends EGLTask implements IRendererHolder
                        

    Hold shared texture that receive camera frame and draw them to registered surface if needs

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected volatile boolean isRunning
    • Method Summary

      Modifier and Type Method Description
      boolean isRunning()
      void release() release all used resource
      Surface getPrimarySurface() Get Surface that receive camera frame.
      SurfaceTexture getPrimarySurfaceTexture() Get SurfaceTexture that receive camera frame.
      void checkPrimarySurface() Check whether Primary Surface is valid, if invalid recreate Primary Surface
      void updatePrimarySize(int width, int height) Change size of Primary Surface
      void addSlaveSurface(int id, Object surface, boolean isRecordable) Add slave surface that is a mirror of primary surface
      void addSlaveSurface(int id, Object surface, boolean isRecordable, int maxFps) Add slave surface that is a mirror of primary surface
      void removeSlaveSurface(int id) Remove slave surface
      void removeSlaveSurfaceAll() Remove all slave surface
      void clearSlaveSurface(int id, int color) Fill specific slave Surface with specific color
      void clearSlaveSurfaceAll(int color) Fill all slave Surface with specific color
      void rotateTo(int angle)
      void rotateBy(int angle)
      void setMirrorMode(int mode) Set slave surface's MirrorMode that flip image horizontally, or flip image vertically.
      int getMirrorMode() Get slave surface's Mirror Mode that flip image horizontally, or flip image vertically.
      boolean isSlaveSurfaceEnable(int id) Get state of slave surface
      void setSlaveSurfaceEnable(int id, boolean enable) Set state of slave surface
      void requestFrame() Update all slave surface based on master surface immediately
      • Methods inherited from class com.serenegiant.opengl.EGLTask

        getLooper, quit, quitSafely, run
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class com.serenegiant.opengl.renderer.IRendererHolder

        addSlaveSurface, addSlaveSurface, rotateBy, rotateTo
      • Methods inherited from class java.lang.Object

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

      • release

         void release()

        release all used resource

      • getPrimarySurface

         Surface getPrimarySurface()

        Get Surface that receive camera frame.

      • checkPrimarySurface

         void checkPrimarySurface()

        Check whether Primary Surface is valid, if invalid recreate Primary Surface

      • updatePrimarySize

         void updatePrimarySize(int width, int height)

        Change size of Primary Surface

      • addSlaveSurface

         void addSlaveSurface(int id, Object surface, boolean isRecordable)

        Add slave surface that is a mirror of primary surface

        Parameters:
        id - often use #hashCode.
      • addSlaveSurface

         void addSlaveSurface(int id, Object surface, boolean isRecordable, int maxFps)

        Add slave surface that is a mirror of primary surface

        Parameters:
        id - often use #hashCode.
        maxFps - no limit if it is less than zero
      • clearSlaveSurface

         void clearSlaveSurface(int id, int color)

        Fill specific slave Surface with specific color

      • clearSlaveSurfaceAll

         void clearSlaveSurfaceAll(int color)

        Fill all slave Surface with specific color

      • setMirrorMode

         void setMirrorMode(int mode)

        Set slave surface's MirrorMode that flip image horizontally, or flip image vertically.

        Parameters:
        mode - 0:normal, 1:flip horizontally, 2:flip vertically, 3:flip horizontal direction and vertical direction
      • getMirrorMode

         int getMirrorMode()

        Get slave surface's Mirror Mode that flip image horizontally, or flip image vertically.

      • requestFrame

         void requestFrame()

        Update all slave surface based on master surface immediately