public class VideoEncoder
extends java.lang.Object
Constructor and Description |
---|
VideoEncoder(int width,
int height,
int bitRate,
int frameRate,
IMediaMuxer writerHandler)
Configures encoder and muxer state, and prepares the input Surface.
|
Modifier and Type | Method and Description |
---|---|
void |
drainEncoder(boolean endOfStream)
Extracts all pending data from the encoder and forwards it to the muxer.
|
android.view.Surface |
getInputSurface()
Returns the encoder's input surface.
|
void |
release()
Releases encoder resources.
|
void |
stopMuxer() |
public VideoEncoder(int width, int height, int bitRate, int frameRate, IMediaMuxer writerHandler) throws java.io.IOException
java.io.IOException
public android.view.Surface getInputSurface()
public void release()
public void drainEncoder(boolean endOfStream)
If endOfStream is not set, this returns when there is no more data to drain. If it is set, we send EOS to the encoder, and then iterate until we see EOS on the output. Calling this with endOfStream set should be done once, swipe_right before stopping the muxer.
We're just using the muxer to get a .mp4 file (instead of a raw H.264 stream). We're not recording audio.
public void stopMuxer()