NatCorder
Search…
WatermarkTextureInput
class NatML.Recorders.Inputs.WatermarkTextureInput : ITextureInput
The WatermarkTextureInput class provides a simple primitive for recording video frames from Texture objects while applying a watermark image to the recording.

The crop texture input can be created with a recorder or a backing texture input:

/// <summary>
/// Create a watermark texture input.
/// </summary>
/// <param name="recorder">Media recorder to receive watermarked frames.</param>
WatermarkTextureInput (IMediaRecorder recorder);
The watermark texture input can be created to send watermarked frames to an IMediaRecorder.

/// <summary>
/// Create a watermark texture input.
/// </summary>
/// <param name="input">Texture input to receive watermarked frames.</param>
WatermarkTextureInput (TextureInput input);
The crop texture input can be created to send watermarked frames to a TextureInput. This is useful when chaining multiple texture inputs.

/// <summary>
/// Texture input frame size.
/// </summary>
(int width, int height) frameSize { get; }
Refer to the Inspecting the Frame Size section of the TextureInput class for more information.

/// <summary>
/// Watermark image.
/// If `null`, no watermark will be rendered.
/// </summary>
Texture watermark { get; set; }
The watermark can be any Texture object. If it is null, then no watermark is rendered.

/// <summary>
/// Watermark display rect in pixel coordinates of the recorder.
/// </summary>
RectInt rect { get; set; }
The watermark position and size are specified by the rect field. The rect is always initialized to the frame size of the recorder, thereby filling the screen with the watermark.

/// <summary>
/// Commit a video frame from a texture.
/// </summary>
/// <param name="texture">Source texture.</param>
/// <param name="timestamp">Frame timestamp in nanoseconds.</param>
void CommitFrame (Texture texture, long timestamp);
Refer to the Committing Video Frames section of the TextureInput class for more information.

/// <summary>
/// Stop recorder input and release resources.
/// </summary>
void Dispose ();
Refer to the Disposing the Recorder Input section of the TextureInput class for more information.
Copy link
On this page
Creating the Texture Input
With a Media Recorder
With a Texture Input
Inspecting the Frame Size
Specifying the Watermark Image
Specifying the Watermark Rectangle
Committing Video Frames
Disposing the Recorder Input