Package tvi.webrtc

Class EglThread

java.lang.Object
tvi.webrtc.EglThread
All Implemented Interfaces:
RenderSynchronizer.Listener

public class EglThread extends Object implements RenderSynchronizer.Listener
EGL graphics thread that allows multiple clients to share the same underlying EGLContext.
  • Method Details

    • create

      public static EglThread create(@Nullable EglThread.ReleaseMonitor releaseMonitor, @Nullable EglBase.Context sharedContext, int[] configAttributes, @Nullable RenderSynchronizer renderSynchronizer)
    • create

      public static EglThread create(@Nullable EglThread.ReleaseMonitor releaseMonitor, @Nullable EglBase.Context sharedContext, int[] configAttributes)
    • release

      public void release()
    • createEglBaseWithSharedConnection

      public EglBase createEglBaseWithSharedConnection()
      Creates an EglBase instance with the EglThread's EglConnection. This method can be called on any thread, but the returned EglBase instance should only be used on this EglThread's Handler.
    • getHandler

      public android.os.Handler getHandler()
      Returns the Handler to interact with Gl/EGL on. Callers need to make sure that their own EglBase is current on the handler before running any graphics operations since the EglThread can be shared by multiple clients.
    • addExceptionCallback

      public void addExceptionCallback(Runnable callback)
      Adds a callback that will be called on the EGL thread if there is an exception on the thread.
    • removeExceptionCallback

      public void removeExceptionCallback(Runnable callback)
      Removes a previously added exception callback.
    • scheduleRenderUpdate

      public void scheduleRenderUpdate(EglThread.RenderUpdate update)
      Schedules a render update (like swapBuffers) to be run in sync with other updates on the next open render window. If the render window is currently open the update will run immediately. This method must be called on the EglThread during a render pass.
    • onRenderWindowOpen

      public void onRenderWindowOpen()
      Specified by:
      onRenderWindowOpen in interface RenderSynchronizer.Listener
    • onRenderWindowClose

      public void onRenderWindowClose()
      Specified by:
      onRenderWindowClose in interface RenderSynchronizer.Listener