Texture Movie Encoder
Encode a movie from frames rendered from an external texture image.
The object wraps an encoder running on a dedicated thread. The various control messages may be sent from arbitrary threads (typically the app UI thread). The encoder thread manages both sides of the encoder (feeding and draining); the only external input is the GL texture.
The design is complicated slightly by the need to create an EGL context that shares state with a view that gets restarted if (say) the device orientation changes. When the view in question is a GLSurfaceView, we don't have full control over the EGL context creation on that side, so we have to bend a bit backwards here.
To use:
- create TextureMovieEncoder object
- create an EncoderConfig
- call TextureMovieEncoder#startRecording() with the config
- call TextureMovieEncoder#setTextureId() with the texture object that receives frames
- for each frame, after latching it with SurfaceTexture#updateTexImage(), call TextureMovieEncoder#frameAvailable().
Types
Functions
Link copied to clipboard
Tells the video recorder that a new frame is available.
Link copied to clipboard
Returns true if recording has been started.
Link copied to clipboard
Tells the video recorder what texture name to use.
Link copied to clipboard
Tells the video recorder to start recording.
Link copied to clipboard
Tells the video recorder to stop recording.
Link copied to clipboard
Tells the video recorder to refresh its EGL surface.