DefaultGlObjectsProvider
@UnstableApi
class DefaultGlObjectsProvider : GlObjectsProvider
Implementation of GlObjectsProvider
that configures an EGLContext
to share data with a preexisting sharedEglContext
.
The created EGLContext
is configured with 8-bit RGB or 10-bit RGB attributes and no depth buffer or render buffers.
Summary
Public constructors |
---|
Creates an instance with no shared EGL context. |
DefaultGlObjectsProvider(sharedEglContext: EGLContext?) Creates an instance with the specified shared EGL context. |
Public functions |
|
---|---|
GlTextureInfo! |
createBuffersForTexture(texId: Int, width: Int, height: Int) Returns a |
EGLContext! |
createEglContext( Creates a new |
EGLSurface! |
createEglSurface( Creates a new |
EGLSurface! |
createFocusedPlaceholderEglSurface( Creates and focuses a placeholder |
Unit |
release(eglDisplay: EGLDisplay!) Releases the created objects. |
Public constructors
DefaultGlObjectsProvider
DefaultGlObjectsProvider(sharedEglContext: EGLContext?)
Creates an instance with the specified shared EGL context.
Parameters | |
---|---|
sharedEglContext: EGLContext? |
The context with which to share data, or |
Public functions
createBuffersForTexture
fun createBuffersForTexture(texId: Int, width: Int, height: Int): GlTextureInfo!
Returns a GlTextureInfo
containing the identifiers of the newly created buffers.
Parameters | |
---|---|
texId: Int |
The identifier of the texture to attach to the buffers. |
width: Int |
The width of the texture in pixels. |
height: Int |
The height of the texture in pixels. |
Throws | |
---|---|
androidx.media3.common.util.GlUtil.GlException |
If an error occurs during creation. |
createEglContext
fun createEglContext(
eglDisplay: EGLDisplay!,
openGlVersion: Int,
configAttributes: IntArray!
): EGLContext!
Creates a new EGLContext
for the specified EGLDisplay
.
Parameters | |
---|---|
eglDisplay: EGLDisplay! |
The |
openGlVersion: Int |
The version of OpenGL ES to configure. Accepts either |
configAttributes: IntArray! |
The attributes to configure EGL with. |
Throws | |
---|---|
androidx.media3.common.util.GlUtil.GlException |
If an error occurs during creation. |
createEglSurface
fun createEglSurface(
eglDisplay: EGLDisplay!,
surface: Any!,
@C.ColorTransfer colorTransfer: Int,
isEncoderInputSurface: Boolean
): EGLSurface!
Creates a new EGLSurface
wrapping the specified surface
.
Parameters | |
---|---|
eglDisplay: EGLDisplay! |
The |
surface: Any! |
The surface to wrap; must be a surface, surface texture or surface holder. |
@C.ColorTransfer colorTransfer: Int |
The |
isEncoderInputSurface: Boolean |
Whether the |
Throws | |
---|---|
androidx.media3.common.util.GlUtil.GlException |
If an error occurs during creation. |
createFocusedPlaceholderEglSurface
fun createFocusedPlaceholderEglSurface(
eglContext: EGLContext!,
eglDisplay: EGLDisplay!
): EGLSurface!
Creates and focuses a placeholder EGLSurface
.
Parameters | |
---|---|
eglContext: EGLContext! |
The |
eglDisplay: EGLDisplay! |
The |
Returns | |
---|---|
EGLSurface! |
A placeholder |
Throws | |
---|---|
androidx.media3.common.util.GlUtil.GlException |
If an error occurs during creation. |
release
fun release(eglDisplay: EGLDisplay!): Unit
Releases the created objects.
Parameters | |
---|---|
eglDisplay: EGLDisplay! |
The |