public class CameraSurfaceRenderer
extends java.lang.Object
implements android.opengl.GLSurfaceView.Renderer
Do not call any methods here directly from another thread -- use the GLSurfaceView#queueEvent() call.
Constructor and Description |
---|
CameraSurfaceRenderer(CameraHandler cameraHandler,
TextureMovieEncoder movieEncoder)
Constructs CameraSurfaceRenderer.
|
Modifier and Type | Method and Description |
---|---|
int |
getBitrate() |
java.util.List<Texture2dProgram.ProgramType> |
getEffectList() |
int |
getFrameRate() |
void |
notifyPausing()
Notifies the renderer thread that the activity is pausing.
|
void |
onDrawFrame(javax.microedition.khronos.opengles.GL10 unused) |
void |
onSurfaceChanged(javax.microedition.khronos.opengles.GL10 unused,
int width,
int height) |
void |
onSurfaceCreated(javax.microedition.khronos.opengles.GL10 unused,
javax.microedition.khronos.egl.EGLConfig config) |
void |
recorderConfigChanged() |
void |
setBitrate(int bitrate) |
void |
setCameraPreviewSize(int width,
int height)
Records the size of the incoming camera preview frames.
|
void |
setEffect(Texture2dProgram.ProgramType effectType) |
void |
setFrameRate(int frameRate) |
void |
setOptions(IMediaMuxer writerHandler) |
void |
startRecording(long recordingStartTime)
Notifies the renderer that we want to stop or start recording.
|
void |
stopRecording() |
public CameraSurfaceRenderer(CameraHandler cameraHandler, TextureMovieEncoder movieEncoder)
cameraHandler
- Handler for communicating with UI threadmovieEncoder
- video encoder objectpublic void setEffect(Texture2dProgram.ProgramType effectType)
public void notifyPausing()
For best results, call this *after* disabling Camera preview.
public void startRecording(long recordingStartTime)
public void stopRecording()
public void setCameraPreviewSize(int width, int height)
It's not clear whether this is guaranteed to execute before or after onSurfaceCreated(), so we assume it could go either way. (Fortunately they both run on the same thread, so we at least know that they won't execute concurrently.)
public int getBitrate()
public void setBitrate(int bitrate)
public void onSurfaceCreated(javax.microedition.khronos.opengles.GL10 unused, javax.microedition.khronos.egl.EGLConfig config)
onSurfaceCreated
in interface android.opengl.GLSurfaceView.Renderer
public void setFrameRate(int frameRate)
public int getFrameRate()
public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 unused, int width, int height)
onSurfaceChanged
in interface android.opengl.GLSurfaceView.Renderer
public void onDrawFrame(javax.microedition.khronos.opengles.GL10 unused)
onDrawFrame
in interface android.opengl.GLSurfaceView.Renderer
public void setOptions(IMediaMuxer writerHandler)
public void recorderConfigChanged()
public java.util.List<Texture2dProgram.ProgramType> getEffectList()