Constructor and Description |
---|
EglEnv(EGLContext sharedEglContext)
Construct a new instance using
the default EGLDisplay and
create a new EGLContext
that shares resource with the specified shared EGLContext and
supports the EGL_ANDROID_RECORDABLE extension
|
EglEnv(EGLContext eglContextShared,
EGLSurface eglBaseSurface)
Deprecated.
|
EglEnv(EGLContext sharedEglContext,
Object nativeSurface)
Construct a new instance using
the default EGLDisplay and
create a new EGLContext
that shares resource with the specified shared EGLContext
supports the EGL_ANDROID_RECORDABLE extension and
wrap the specified Android surface with a newly created EGLSurface
|
EglEnv(EGLContext sharedEglContext,
Object nativeSurface,
boolean recordable)
Construct a new instance using
the default EGLDisplay and
create a new EGLContext that
shares resource with the specified shared EGLContext and
wrap the specified Android surface with a newly created EGLSurface
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext)
Construct a new instance using
the specified EGLDisplay and
the specified EGLContext
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext,
EGLSurface eglSurface)
Construct a new instance using
the specified EGLDisplay and
the specified EGLContext and
the specified EGLSurface
|
EglEnv(EGLDisplay eglDisplay,
EGLContext eglContext,
Object nativeSurface)
Construct a new instance using
the specified EGLDisplay and
the specified EGLContext
wrap the specified Android surface with an EGLSurface
|
EglEnv(int eglVersion,
EGLContext sharedEglContext,
boolean recordable)
Construct a new instance using
the default EGLDisplay and
create a new EGLContext that
shares resource with the specified shared EGLContext
|
EglEnv(int eglVersion,
EGLDisplay eglDisplay,
EGLContext eglContext,
EGLContext sharedEglContext,
Object nativeSurface,
boolean recordable)
Construct a new instance using the specified parameters
|
EglEnv(int eglVersion,
EGLDisplay eglDisplay,
Object nativeSurface,
boolean recordable)
Construct a new instance using
the specified EGL version and
the specified EGL display and
create a new EGLContext
wrap 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
For this operation to be supported, the following conditions must apply:
This EglEnv instance's EGLContext must have been created with EGL version 3.
This EglEnv instance's EGLContext must have been created by specifying the same EGLContext on which the source EGLSurface was created as a shared context
An EGLSurface must have been created for this EglEnv instance
|
static EGLSurface |
createEglSurface(EGLDisplay eglDisplay,
EGLSurface eglBaseSurface,
Surface nativeSurface)
Deprecated.
|
EGLSurface |
generateEglWindowSurface(Object nativeSurface)
Generate a new EGLSurface that wraps the specified native Android surface.
|
WZSize |
getBaseSurfaceSize()
Deprecated.
|
EGLSurface |
getEglBaseSurface()
Deprecated.
|
EGLConfig |
getEglConfig() |
EGLContext |
getEglContext() |
EGLDisplay |
getEglDisplay() |
EGLSurface |
getEglSurface() |
WZSize |
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)
Establish a new shared EGLContext.
|
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
If the native surface is associated with a
android.media.MediaCodec the contents will then
be processed by the active encoder or decoder |
public EglEnv(int eglVersion, EGLDisplay eglDisplay, EGLContext eglContext, EGLContext sharedEglContext, Object nativeSurface, boolean recordable)
eglVersion
- The EGL version to use (currently supported values: 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 createdsharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified contextnativeSurface
- If this is not null and is an instance of Surface
or SurfaceTexture
,
an EGLSurface
will be automatically created to wrap the native Android surfacerecordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE
for use with android.media.MediaCodec
IllegalStateException
- If an error occurs during the creation processpublic EglEnv(EGLContext sharedEglContext, Object nativeSurface, boolean recordable)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified contextnativeSurface
- If this is not null and is an instance of Surface
or SurfaceTexture
,
an EGLSurface
will be automatically created to wrap the native Android surfacerecordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE
for use with android.media.MediaCodec
IllegalStateException
- If an error occurs during the creation processpublic EglEnv(EGLContext sharedEglContext, Object nativeSurface)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified contextnativeSurface
- If this is not null and is an instance of Surface
or SurfaceTexture
,
an EGLSurface
will be automatically created to wrap the native Android surfaceIllegalStateException
- If an error occurs during the creation processpublic EglEnv(EGLContext sharedEglContext)
sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified contextIllegalStateException
- If an error occurs during the creation processpublic EglEnv(int eglVersion, EGLDisplay eglDisplay, Object nativeSurface, boolean recordable)
eglVersion
- The EGL version to use (currently supported values: 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 is not null and is an instance of Surface
or SurfaceTexture
,
an EGLSurface
will be automatically created to wrap the native Android surfacerecordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE
for use with android.media.MediaCodec
IllegalStateException
- If an error occurs during the creation processpublic EglEnv(int eglVersion, EGLContext sharedEglContext, boolean recordable)
eglVersion
- The EGL version to use (currently supported values: 2 or 3)sharedEglContext
- Unless EGL14#EGL_NO_CONTEXT
is specified, the newly created context will share EGL resources with the specified contextrecordable
- Indicates that the newly created context should support the EGL EGL_ANDROID_RECORDABLE
for use with android.media.MediaCodec
IllegalStateException
- If an error occurs during the creation processpublic 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 createdeglSurface
- The EGL surface.IllegalStateException
- If an error occurs during the creation processpublic EglEnv(EGLDisplay eglDisplay, EGLContext eglContext, 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 creatednativeSurface
- If this is not null and is an instance of Surface
or SurfaceTexture
,
an EGLSurface
will be automatically created to wrap the native Android surfaceIllegalStateException
- If an error occurs during the creation processpublic 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 createdIllegalStateException
- If an error occurs during the creation processpublic EglEnv(EGLContext eglContextShared, EGLSurface eglBaseSurface)
public EGLDisplay getEglDisplay()
EGLDisplay
for this instance or EGL14#EGL_NO_DISPLAY
of one has not been specified or createdpublic EGLContext getEglContext()
EGLContext
for this instance or EGL14#EGL_NO_CONTEXT
of one has not been specified or createdpublic EGLConfig getEglConfig()
EGLConfig
for this instance or null if one has not been establishedpublic int getEglVersion()
public EGLSurface getEglSurface()
EGLSurface
for this instance or EGL14#EGL_NO_SURFACE
has not been specified or createdpublic WZSize getEglSurfaceSize()
public boolean makeCurrent()
public boolean makeCurrent(EGLSurface readSurface)
public boolean makeNothingCurrent()
public boolean copySurfaceContents(EGLSurface sourceSurface, int surfaceWidth, int surfaceHeight)
sourceSurface
- The source EGLSurfacesurfaceWidth
- The width of the source EGLSurfacesurfaceHeight
- The height of the source EGLSurfacepublic boolean setPresentationTime(long nanoseconds)
nanoseconds
- the frame's presentation time, in nanosecondspublic boolean swapBuffers()
android.media.MediaCodec
the contents will then
be processed by the active encoder or decoderpublic boolean setSharedEglContext(EGLContext eglSharedContext)
eglSharedContext
- The shared EGLContextpublic EGLSurface generateEglWindowSurface(Object nativeSurface)
nativeSurface
- An instance of an Android Surface
or SurfaceTexture
public void releaseSurface()
public void release()
public EGLSurface getEglBaseSurface()
public WZSize 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 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal