-
- All Implemented Interfaces:
-
com.serenegiant.opengl.renderer.IRendererHolder,java.lang.Runnable
public class RendererHolder extends EGLTask implements IRendererHolder
Hold shared texture that receive camera frame and draw them to registered surface if needs
-
-
Field Summary
Fields Modifier and Type Field Description protected volatile booleanisRunning
-
Constructor Summary
Constructors Constructor Description RendererHolder(int width, int height, RendererHolderCallback callback)RendererHolder(int width, int height, EGLBase.IContext sharedContext, int flags, int maxClientVersion, RendererHolderCallback callback)
-
Method Summary
Modifier and Type Method Description booleanisRunning()voidrelease()release all used resource SurfacegetPrimarySurface()Get Surface that receive camera frame. SurfaceTexturegetPrimarySurfaceTexture()Get SurfaceTexture that receive camera frame. voidcheckPrimarySurface()Check whether Primary Surface is valid, if invalid recreate Primary Surface voidupdatePrimarySize(int width, int height)Change size of Primary Surface voidaddSlaveSurface(int id, Object surface, boolean isRecordable)Add slave surface that is a mirror of primary surface voidaddSlaveSurface(int id, Object surface, boolean isRecordable, int maxFps)Add slave surface that is a mirror of primary surface voidremoveSlaveSurface(int id)Remove slave surface voidremoveSlaveSurfaceAll()Remove all slave surface voidclearSlaveSurface(int id, int color)Fill specific slave Surface with specific color voidclearSlaveSurfaceAll(int color)Fill all slave Surface with specific color voidrotateTo(int angle)voidrotateBy(int angle)voidsetMirrorMode(int mode)Set slave surface's MirrorMode that flip image horizontally, or flip image vertically. intgetMirrorMode()Get slave surface's Mirror Mode that flip image horizontally, or flip image vertically. booleanisSlaveSurfaceEnable(int id)Get state of slave surface voidsetSlaveSurfaceEnable(int id, boolean enable)Set state of slave surface voidrequestFrame()Update all slave surface based on master surface immediately -
Methods inherited from class com.serenegiant.opengl.EGLTask
getLooper, quit, quitSafely, run -
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, start, stop, suspend, toString, yield -
Methods inherited from class com.serenegiant.opengl.renderer.IRendererHolder
addSlaveSurface, addSlaveSurface, rotateBy, rotateTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
RendererHolder
RendererHolder(int width, int height, RendererHolderCallback callback)
-
RendererHolder
RendererHolder(int width, int height, EGLBase.IContext sharedContext, int flags, int maxClientVersion, RendererHolderCallback callback)
-
-
Method Detail
-
isRunning
boolean isRunning()
-
release
void release()
release all used resource
-
getPrimarySurface
Surface getPrimarySurface()
Get Surface that receive camera frame.
-
getPrimarySurfaceTexture
SurfaceTexture getPrimarySurfaceTexture()
Get SurfaceTexture that receive camera frame.
-
checkPrimarySurface
void checkPrimarySurface()
Check whether Primary Surface is valid, if invalid recreate Primary Surface
-
updatePrimarySize
void updatePrimarySize(int width, int height)
Change size of Primary Surface
-
addSlaveSurface
void addSlaveSurface(int id, Object surface, boolean isRecordable)
Add slave surface that is a mirror of primary surface
- Parameters:
id- often use #hashCode.
-
addSlaveSurface
void addSlaveSurface(int id, Object surface, boolean isRecordable, int maxFps)
Add slave surface that is a mirror of primary surface
- Parameters:
id- often use #hashCode.maxFps- no limit if it is less than zero
-
removeSlaveSurface
void removeSlaveSurface(int id)
Remove slave surface
-
removeSlaveSurfaceAll
void removeSlaveSurfaceAll()
Remove all slave surface
-
clearSlaveSurface
void clearSlaveSurface(int id, int color)
Fill specific slave Surface with specific color
-
clearSlaveSurfaceAll
void clearSlaveSurfaceAll(int color)
Fill all slave Surface with specific color
-
rotateTo
void rotateTo(int angle)
-
rotateBy
void rotateBy(int angle)
-
setMirrorMode
void setMirrorMode(int mode)
Set slave surface's MirrorMode that flip image horizontally, or flip image vertically.
- Parameters:
mode- 0:normal, 1:flip horizontally, 2:flip vertically, 3:flip horizontal direction and vertical direction
-
getMirrorMode
int getMirrorMode()
Get slave surface's Mirror Mode that flip image horizontally, or flip image vertically.
-
isSlaveSurfaceEnable
boolean isSlaveSurfaceEnable(int id)
Get state of slave surface
-
setSlaveSurfaceEnable
void setSlaveSurfaceEnable(int id, boolean enable)
Set state of slave surface
-
requestFrame
void requestFrame()
Update all slave surface based on master surface immediately
-
-
-
-