public static class WOWZGLES.EglEnv
extends java.lang.Object
Constructor and Description |
---|
EglEnv(EGLContext sharedEglContext)
Creates and initializes an instance using the default EGLDisplay and creates a new EGLContext that shares resources with the specified shared EGLContext.
|
EglEnv(EGLContext eglContextShared,
EGLSurface eglBaseSurface)
Deprecated.
|
EglEnv(EGLContext sharedEglContext,
java.lang.Object nativeSurface)
Creates and initializes an instance using the default EGLDisplay, creates a new EGLContext that shares resources with the specified shared EGLContext,
and wraps the specified Android surface with a newly created EGLSurface.
|
EglEnv(EGLContext sharedEglContext,
java.lang.Object nativeSurface,
boolean recordable)
Creates and initializes an instance using the default EGLDisplay, creates a new EGLContext that shares resources with the specified shared EGLContext, supports the EGL_ANDROID_RECORDABLE extension, and
wraps the specified Android surface with a newly created EGLSurface.
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext)
Creates and initializes an instance using the specified EGLDisplay and the EGLContext.
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext,
EGLSurface eglSurface)
Creates and initializes an instance using the specified EGLDisplay, EGLContext, and EGLSurface.
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext,
java.lang.Object nativeSurface)
Creates and initializes an instance using the specified EGLDisplay and EGLContext, and wraps the specified Android surface with an EGLSurface.
|
EglEnv(int eglVersion,
EGLContext sharedEglContext,
boolean recordable)
Creates and initializes an instance using the default EGLDisplay and creates a new EGLContext that shares resources with the specified shared EGLContext.
|
EglEnv(int eglVersion,
EGLDisplay eglDisplay,
EGLContext eglContext,
EGLContext sharedEglContext,
java.lang.Object nativeSurface,
boolean recordable)
Creates and initializes an instance using the specified parameters.
|
EglEnv(int eglVersion,
EGLDisplay eglDisplay,
java.lang.Object nativeSurface,
boolean recordable)
Creates and initializes an instance using the specified EGL version and the specified EGL display,
creates a new EGLContext, and wraps the specified Android surface with a newly created EGLSurface.
|
Modifier and Type | Method and Description |
---|---|
boolean |
copySurfaceContents(EGLSurface sourceSurface,
int surfaceWidth,
int surfaceHeight)
Copies the content of the specified EGLSurface to this instance's EGLSurface.
|
static EGLSurface |
createEglSurface(EGLDisplay eglDisplay,
EGLSurface eglBaseSurface,
Surface nativeSurface)
Deprecated.
|
EGLSurface |
generateEglWindowSurface(java.lang.Object nativeSurface)
Generates a new EGLSurface that wraps the specified native Android surface; destroys the current EGLSurface if there is one.
|
WOWZSize |
getBaseSurfaceSize()
Deprecated.
|
EGLSurface |
getEglBaseSurface()
Deprecated.
|
EGLConfig |
getEglConfig() |
EGLContext |
getEglContext() |
EGLDisplay |
getEglDisplay() |
EGLSurface |
getEglSurface() |
WOWZSize |
getEglSurfaceSize() |
int |
getEglVersion() |
Surface |
getNativeSurface()
Deprecated.
|
int |
getTextureId()
Deprecated.
Do not use EglEnv to track texture IDs.
|
boolean |
makeCurrent()
Binds this instance to the current rendering thread.
|
boolean |
makeCurrent(EGLSurface readSurface)
Binds this instance to the current rendering thread and the specified read surface.
|
boolean |
makeNothingCurrent()
Unbinds this EglEnv instance from the current rendering thread.
|
void |
release()
Releases the EGL resources associated with thie EglEnv instance.
|
void |
releaseSurface()
Releases any current EGLSurface for this EglEnv instance.
|
boolean |
setNativeSurface(Surface nativeSurface)
Deprecated.
Use
generateEglWindowSurface(java.lang.Object) instead. |
boolean |
setPresentationTime(long nanoseconds)
Sets the presentation time for a rendered frame on this EglEnv instance's EGLSurface.
|
boolean |
setSharedEglContext(EGLContext eglSharedContext)
Establishes a new shared EGLContext; destroys the current EGLContext if there is one.
|
void |
setTextureId(int textureId)
Deprecated.
Do not use EglEnv to track texture IDs.
|
boolean |
swapBuffers()
Posts the contents of this EglEnv instance's EGLSurface to the native Android surface.
|
public EglEnv(int eglVersion, EGLDisplay eglDisplay, EGLContext eglContext, EGLContext sharedEglContext, java.lang.Object nativeSurface, boolean recordable)
eglVersion
- The EGL version to use, either 2 or 3.eglDisplay
- The EGL display. If EGL14#EGL_NO_DISPLAY
is specified, the value EGL14#EGL_DEFAULT_DISPLAY
will be used.eglContext
- The EGL context. If EGL14#EGL_NO_CONTEXT
is specified, an EGLContext will be created.sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified context.nativeSurface
- If this is not null and is an instance of Surface or SurfaceTexture, an EGLSurface will be created to wrap the native Android surface.recordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE for use with android.media.MediaCodec.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLContext sharedEglContext, java.lang.Object nativeSurface, boolean recordable)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified context.nativeSurface
- If this isn't null and is an instance of Surface or SurfaceTexture, an EGLSurface will be created to wrap the native Android surface.recordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE for use with android.media.MediaCodec.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLContext sharedEglContext, java.lang.Object nativeSurface)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified context.nativeSurface
- If this isn't null and is an instance of Surface or SurfaceTexture, an EGLSurface will be created to wrap the native Android surface.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLContext sharedEglContext)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified context.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(int eglVersion, EGLDisplay eglDisplay, java.lang.Object nativeSurface, boolean recordable)
eglVersion
- The EGL version to use, either 2 or 3.eglDisplay
- The EGL display. If EGL14#EGL_NO_DISPLAY
is specified, the value EGL14#EGL_DEFAULT_DISPLAY
will be used.nativeSurface
- If this isn't null and is an instance of Surface or SurfaceTexture, an EGLSurface will be created to wrap the native Android surface.recordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE for use with android.media.MediaCodec.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(int eglVersion, EGLContext sharedEglContext, boolean recordable)
eglVersion
- The EGL version to use, either 2 or 3.sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified context.recordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE for use with android.media.MediaCodec.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface)
eglDisplay
- The EGL display. If EGL14#EGL_NO_DISPLAY
is specified, the value EGL14#EGL_DEFAULT_DISPLAY
will be used.eglContext
- The EGL context. If EGL14#EGL_NO_CONTEXT
is specified, an EGLContext will be created.eglSurface
- The EGL surface.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLDisplay eglDisplay, EGLContext eglContext, java.lang.Object nativeSurface)
eglDisplay
- The EGL display. If EGL14#EGL_NO_DISPLAY
is specified, the value EGL14#EGL_DEFAULT_DISPLAY
will be used.eglContext
- The EGL context. If EGL14#EGL_NO_CONTEXT
is specified, an EGLContext will be created.nativeSurface
- If this isn't null and is an instance of Surface or SurfaceTexture, an EGLSurface will be created to wrap the native Android surface.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLDisplay eglDisplay, EGLContext eglContext)
eglDisplay
- The EGL display. If EGL14#EGL_NO_DISPLAY
is specified, the value EGL14#EGL_DEFAULT_DISPLAY
will be used.eglContext
- The EGL context. If EGL14#EGL_NO_CONTEXT
is specified, an EGLContext will be created.java.lang.IllegalStateException
- If an error occurs during the creation process.public EglEnv(EGLContext eglContextShared, EGLSurface eglBaseSurface)
public EGLDisplay getEglDisplay()
EGL14#EGL_NO_DISPLAY
if one hasn't been specified or created.public EGLContext getEglContext()
EGL14#EGL_NO_CONTEXT
if one hasn't been specified or created.public EGLConfig getEglConfig()
public int getEglVersion()
public EGLSurface getEglSurface()
EGL14#EGL_NO_SURFACE
hasn't been specified or created.public WOWZSize getEglSurfaceSize()
public boolean makeCurrent()
public boolean makeCurrent(EGLSurface readSurface)
public boolean makeNothingCurrent()
public boolean copySurfaceContents(EGLSurface sourceSurface, int surfaceWidth, int surfaceHeight)
sourceSurface
- The source EGLSurface.surfaceWidth
- The width of the source EGLSurface.surfaceHeight
- The height of the source EGLSurface.public boolean setPresentationTime(long nanoseconds)
nanoseconds
- The frame's presentation time, in nanoseconds.public boolean swapBuffers()
public boolean setSharedEglContext(EGLContext eglSharedContext)
eglSharedContext
- The shared EGLContext.public EGLSurface generateEglWindowSurface(java.lang.Object nativeSurface)
nativeSurface
- An instance of an Android Surface or SurfaceTexture.public void releaseSurface()
public void release()
public EGLSurface getEglBaseSurface()
public WOWZSize getBaseSurfaceSize()
public Surface getNativeSurface()
public int getTextureId()
public void setTextureId(int textureId)
public static EGLSurface createEglSurface(EGLDisplay eglDisplay, EGLSurface eglBaseSurface, Surface nativeSurface)
public boolean setNativeSurface(Surface nativeSurface)
generateEglWindowSurface(java.lang.Object)
instead.© 2016 - 2018 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal