Package com.telnyx.webrtc.lib
Class EglThread
java.lang.Object
com.telnyx.webrtc.lib.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 interfaceCallback for externally managed reference count.static interfaceInterface for clients to schedule rendering updates that will run synchronized. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExceptionCallback(Runnable callback) Adds a callback that will be called on the EGL thread if there is an exception on the thread.static EglThreadcreate(EglThread.ReleaseMonitor releaseMonitor, EglBase.Context sharedContext, int[] configAttributes) static EglThreadcreate(EglThread.ReleaseMonitor releaseMonitor, EglBase.Context sharedContext, int[] configAttributes, RenderSynchronizer renderSynchronizer) Creates an EglBase instance with the EglThread's EglConnection.Returns the Handler to interact with Gl/EGL on.voidvoidvoidrelease()voidremoveExceptionCallback(Runnable callback) Removes a previously added exception callback.voidDeprecated.voidscheduleRenderUpdate(UUID id, EglThread.RenderUpdate update) 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
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.- Parameters:
id- a unique id of the renderer that scheduled this render update.
-
scheduleRenderUpdate
Deprecated. -
onRenderWindowOpen
public void onRenderWindowOpen()- Specified by:
onRenderWindowOpenin interfaceRenderSynchronizer.Listener
-
onRenderWindowClose
public void onRenderWindowClose()- Specified by:
onRenderWindowClosein interfaceRenderSynchronizer.Listener
-