project.android.imageprocessing.output
Class Mp4VideoFileEndpoint

java.lang.Object
  extended by project.android.imageprocessing.GLRenderer
      extended by project.android.imageprocessing.output.Mp4VideoFileEndpoint
All Implemented Interfaces:
GLTextureInputRenderer

public class Mp4VideoFileEndpoint
extends GLRenderer
implements GLTextureInputRenderer

A mp4 video renderer extension of GLRenderer. This class accepts a texture as input and renders it to a mp4 video file at the given frame rate. This class currently fails on most android 4+ (API 14+) devices but does work on most android 2.2 (API 8) devices. Hopefully, this will be fixed in future updates. Video recording will start when startRecording is called. It will finish recording and close the video recorder when finishRecording is called. This class does not handle displaying to the screen; however it does use the screen to render to the video recorder, so if display is not required the opengl context should be hidden.

Author:
Chris Batt

Constructor Summary
Mp4VideoFileEndpoint(java.lang.String filename, int fps)
          Creates a new Mp4VideoFileEndpoint
 
Method Summary
 void finishRecording()
          Stops and finalizes the video recording.
 boolean isRecording()
          Returns whether or not the recorder is running
 void newTextureReady(int texture, GLTextureOutputRenderer source)
          Signals that a new texture is available and the image should be reprocessed.
 void startRecording()
          Starts a new video recording
 
Methods inherited from class project.android.imageprocessing.GLRenderer
getHeight, getWidth, onDrawFrame, onPause, onResume, onSurfaceCreated, rotateClockwise90Degrees, rotateCounterClockwise90Degrees, setRenderSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mp4VideoFileEndpoint

public Mp4VideoFileEndpoint(java.lang.String filename,
                            int fps)
Creates a new Mp4VideoFileEndpoint

Parameters:
filename - The file name and path that the video should be written to. ".mp4" will appended to the filename
fps - The frames per second that the video should be encoded at
Method Detail

isRecording

public boolean isRecording()
Returns whether or not the recorder is running


startRecording

public void startRecording()
Starts a new video recording


newTextureReady

public void newTextureReady(int texture,
                            GLTextureOutputRenderer source)
Description copied from interface: GLTextureInputRenderer
Signals that a new texture is available and the image should be reprocessed.

Specified by:
newTextureReady in interface GLTextureInputRenderer
Parameters:
texture - The texture id to be used as input.
source - The GLTextureOutputRenderer which produced the texture.

finishRecording

public void finishRecording()
Stops and finalizes the video recording. Unknown results if called when video recorder is not recording.