Class VideoFrame
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The VideoFrame interface of the Web Codecs API represents a frame of a video.
[Value("VideoFrame")]
public class VideoFrame
- Inheritance
-
VideoFrame
- Inherited Members
Remarks
VideoFrame is a transferable object.
Constructors
VideoFrame()
public VideoFrame()
VideoFrame(Union225, VideoFrameBufferInit)
The VideoFrame() constructor creates a new VideoFrame object representing a frame of a video.
public VideoFrame(Union225 data, VideoFrameBufferInit init)
Parameters
dataUnion225initVideoFrameBufferInit
Remarks
VideoFrame(Union72, VideoFrameInit)
The VideoFrame() constructor creates a new VideoFrame object representing a frame of a video.
public VideoFrame(Union72 image, VideoFrameInit init = null)
Parameters
imageUnion72initVideoFrameInit
Remarks
Properties
CodedHeight
The codedHeight property of the VideoFrame interface returns the height of the VideoFrame in pixels, potentially including non-visible padding, and prior to considering potential ratio adjustments.
[Value("codedHeight")]
public ulong CodedHeight { get; }
Property Value
- ulong
An integer.
Remarks
CodedRect
The codedRect property of the VideoFrame interface returns a DOMRectReadOnly with the width and height matching CodedWidth and CodedHeight.
[Value("codedRect")]
public DOMRectReadOnly? CodedRect { get; }
Property Value
Remarks
CodedWidth
The codedWidth property of the VideoFrame interface returns the width of the VideoFrame in pixels, potentially including non-visible padding, and prior to considering potential ratio adjustments.
[Value("codedWidth")]
public ulong CodedWidth { get; }
Property Value
- ulong
An integer.
Remarks
ColorSpace
The colorSpace property of the VideoFrame interface returns a VideoColorSpace object representing the color space of the video.
[Value("colorSpace")]
public VideoColorSpace ColorSpace { get; }
Property Value
- VideoColorSpace
A VideoColorSpace object.
Remarks
DisplayHeight
The displayHeight property of the VideoFrame interface returns the height of the VideoFrame after applying aspect ratio adjustments.
[Value("displayHeight")]
public ulong DisplayHeight { get; }
Property Value
- ulong
An integer.
Remarks
DisplayWidth
The displayWidth property of the VideoFrame interface returns the width of the VideoFrame after applying aspect ratio adjustments.
[Value("displayWidth")]
public ulong DisplayWidth { get; }
Property Value
- ulong
An integer.
Remarks
Duration
The duration property of the VideoFrame interface returns an integer indicating the duration of the video in microseconds.
[Value("duration")]
public ulong? Duration { get; }
Property Value
- ulong?
An integer.
Remarks
Flip
NOTE
Experimentalflip property of the VideoFrame interface returns a boolean that indicates whether the VideoFrame is horizontally mirrored.
[Value("flip")]
public bool Flip { get; }
Property Value
- bool
A boolean. If
true, horizontal mirroring is applied. Defaults tofalse.
Remarks
Format
The format property of the VideoFrame interface returns the pixel format of the VideoFrame.
[Value("format")]
public VideoPixelFormat? Format { get; }
Property Value
- VideoPixelFormat?
A string containing a video pixel format, one of:
Remarks
Rotation
NOTE
Experimentalrotation property of the VideoFrame interface returns the rotation of the video frame.
[Value("rotation")]
public Number Rotation { get; }
Property Value
- Number
An integer representing the rotation (0, 90, 180, or 270) in degrees clockwise. Defaults to
0. Arbitrary numbers (including negatives) are rounded to the next quarter turn.
Remarks
Timestamp
The timestamp property of the VideoFrame interface returns an integer indicating the timestamp of the video in microseconds.
[Value("timestamp")]
public long Timestamp { get; }
Property Value
- long
An integer.
Remarks
VisibleRect
The visibleRect property of the VideoFrame interface returns a DOMRectReadOnly describing the visible rectangle of pixels for this VideoFrame.
[Value("visibleRect")]
public DOMRectReadOnly? VisibleRect { get; }
Property Value
Remarks
Methods
AllocationSize(VideoFrameCopyToOptions)
The allocationSize() method of the VideoFrame interface returns the number of bytes required to hold the video as filtered by options passed into the method.
[Value("allocationSize")]
public ulong AllocationSize(VideoFrameCopyToOptions options = null)
Parameters
optionsVideoFrameCopyToOptions
Returns
- ulong
An integer containing the number of bytes needed to hold the frame as specified by
options.
Remarks
Clone()
The clone() method of the VideoFrame interface creates a new VideoFrame object referencing the same media resource as the original.
[Value("clone")]
public VideoFrame Clone()
Returns
- VideoFrame
A new cloned VideoFrame object.
Remarks
Close()
The close() method of the VideoFrame interface clears all states and releases the reference to the media resource.
[Value("close")]
public GlobalObject.Undefined Close()
Returns
- GlobalObject.Undefined
Undefined.
Remarks
CopyTo(Union225, VideoFrameCopyToOptions)
The copyTo() method of the VideoFrame interface copies the contents of the VideoFrame to an ArrayBuffer.
[Value("copyTo")]
public Task<List<PlaneLayout>> CopyTo(Union225 destination, VideoFrameCopyToOptions options = null)
Parameters
destinationUnion225optionsVideoFrameCopyToOptions
Returns
- Task<List<PlaneLayout>>
A
Promisethat resolves to the layout of the copy when the copy has completed.
Remarks
Metadata()
[Value("metadata")]
public VideoFrameMetadata Metadata()