NatCorder
Search…
GLESTextureInput
class NatSuite.Recorders.Inputs.GLESTextureInput : ITextureInput
The GLESTextureInput class provides a simple primitive for recording video frames from Texture objects on Android OpenGL ES3. It works by performing asynchronous pixel buffer readbacks from the GPU using Android's native graphics infrastructure.
This texture input is can only be used on Android when rendering with OpenGL ES3.

Creating the Recorder Input

1
/// <summary>
2
/// Create a GLES texture input.
3
/// </summary>
4
/// <param name="recorder">Media recorder to receive video frames.</param>
5
/// <param name="multithreading">Enable multithreading. This improves recording performance.</param>
6
GLESTextureInput (IMediaRecorder recorder, bool multithreading = false);
Copied!
The texture input is always created with a recorder which receives any frames committed by the input. The texture input can also commit frames on a background thread when the multithreading flag is enabled, further improving recording performance.

Committing Video Frames

1
/// <summary>
2
/// Commit a video frame from a texture.
3
/// </summary>
4
/// <param name="texture">Source texture.</param>
5
/// <param name="timestamp">Frame timestamp in nanoseconds.</param>
6
void CommitFrame (Texture texture, long timestamp);
Copied!
Refer to the Committing Video Frames section of the ITextureInput interface for more information.

Disposing the Recorder Input

1
/// <summary>
2
/// Stop recorder input and release resources.
3
/// </summary>
4
void Dispose ();
Copied!
Refer to the Disposing the Recorder Input section of the ITextureInput interface for more information.
Last modified 4mo ago