GlObjectsProvider
@UnstableApi
interface GlObjectsProvider
DefaultGlObjectsProvider |
Implementation of |
Provider to customize the creation and maintenance of GL objects.
Summary
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 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: @IntRange(from = 2, to = 3) Int,
configAttributes: IntArray!
): EGLContext!
Creates a new EGLContext for the specified EGLDisplay.
| Parameters | |
|---|---|
eglDisplay: EGLDisplay! |
The |
openGlVersion: @IntRange(from = 2, to = 3) 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 |