Skip to main content
Version: 20 Mar 2024

Frame

Struct representing a captured camera frame.

Public Fields

Format

Gets the format of the image planes in this frame.


public MLWebRTC.VideoSink.Frame.OutputFormat Format { get; set; }

TypeDescription
MLWebRTC.VideoSink.Frame.OutputFormatDefines the supported output formats of the image planes.

Id

Gets the id of the frame.


public ulong Id { get; set; }


ImagePlanes

Gets the array of image planes contained in this frame.


public MLWebRTC.VideoSink.Frame.PlaneInfo [] ImagePlanes { get; set; }

TypeDescription
MLWebRTC.VideoSink.Frame.PlaneInfo []Struct representing an image plane that comes from some captured camera frame.

NativeFrame


public NativeBufferInfo NativeFrame { get; set; }


TimeStampUs

Gets the timestamp of the frame in microseconds.


public ulong TimeStampUs { get; set; }


Public Methods

Frame Create

Creates and returns an initialized version of this struct.

public static Frame Create(
ulong id,
ulong timeStampUs,
PlaneInfo [] imagePlanes,
OutputFormat format
)

Parameters

TypeNameDescription
ulongidId of the frame.
ulongtimeStampUsTimestamp of the frame in microseconds.
PlaneInfo []imagePlanesArray of image planes this frame contains.
OutputFormatformatThe output format of this frame.

Returns: An initialized version of this struct.


Frame Create

public static Frame Create(
ulong id,
ulong timeStampUs,
NativeBufferInfo nativeBufferInfo
)

Parameters

TypeNameDescription
ulongid
ulongtimeStampUs
NativeBufferInfonativeBufferInfo

override string ToString

Override to display the contents of a frame as a string.

public override string ToString()

Returns: A string representation of this struct.


Public Attributes

NativeImagePlanesLength

Defines amount of valid image planes to be found within the frame's image planes array output formats of the image planes.


public static readonly Dictionary< OutputFormat, byte > NativeImagePlanesLength = new Dictionary<OutputFormat, byte>()
{
{ OutputFormat.YUV_420_888, 3 },
{ OutputFormat.RGBA_8888, 1 },
{ OutputFormat.NativeBuffer, 0 }
};

TypeDescription
readonly Dictionary< OutputFormat, byte >Defines the supported output formats of the image planes.

Public Enums

OutputFormat

Defines the supported output formats of the image planes.

EnumeratorValueDescription
YUV_420_888YUV_420_888 format.
RGBA_8888RGBA_8888 format.
NativeBufferNative buffer format