Package tvi.webrtc
Class EglThread
java.lang.Object
tvi.webrtc.EglThread
- All Implemented Interfaces:
RenderSynchronizer.Listener
EGL graphics thread that allows multiple clients to share the same underlying EGLContext.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Callback for externally managed reference count.static interface
Interface for clients to schedule rendering updates that will run synchronized. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExceptionCallback
(Runnable callback) Adds a callback that will be called on the EGL thread if there is an exception on the thread.static EglThread
create
(EglThread.ReleaseMonitor releaseMonitor, EglBase.Context sharedContext, int[] configAttributes) static EglThread
create
(EglThread.ReleaseMonitor releaseMonitor, EglBase.Context sharedContext, int[] configAttributes, RenderSynchronizer renderSynchronizer) Creates an EglBase instance with the EglThread's EglConnection.android.os.Handler
Returns the Handler to interact with Gl/EGL on.void
void
void
release()
void
removeExceptionCallback
(Runnable callback) Removes a previously added exception callback.void
Schedules a render update (like swapBuffers) to be run in sync with other updates on the next open render window.
-
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() -
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
Adds a callback that will be called on the EGL thread if there is an exception on the thread. -
removeExceptionCallback
Removes a previously added exception callback. -
scheduleRenderUpdate
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 interfaceRenderSynchronizer.Listener
-
onRenderWindowClose
public void onRenderWindowClose()- Specified by:
onRenderWindowClose
in interfaceRenderSynchronizer.Listener
-