Shared Egl Context
Singleton holder for the shared EGL context used across the WebRTC stack.
The EGL context needs to be shared between:
Video decoders (which output TextureBuffer frames)
Video renderers (SurfaceViewRenderer)
If these use different EGL contexts, TextureBuffer frames from the decoder will appear as black when rendered, because the texture IDs are only valid within the EGL context where they were created.
Functions
Gets the shared EGL base. Returns null if not yet initialized.
Gets the shared EGL base context. Returns null if not yet initialized. Renderers should use this to share textures with decoders.
Sets the shared EGL base. Should be called by AndroidWebRtcDevice during initialization. The EglBase is expected to live for the duration of the WebRTC session.