Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

OpenTok.VideoFrame

Defines a video frame for the IVideoRenderer.RenderFrame(VideoFrame) and IVideoFrameConsumer.Consume(VideoFrame) methods. More...

Inherits IDisposable.

Public Member Functions

void Dispose ()
 Disposes of the VideoFrame object's resources. More...
IntPtr GetPlane (int index)
 Gets a pointer to a specified video plane for the frame. More...
int GetPlaneStride (int index)
 Gets the stride for a specified video plane for the frame. More...
int GetPlaneSize (int index)
 Gets the size of a specified video plane for the frame. More...
int GetPlaneWidth (int index)
 Gets the width (in pixels) for a specified video plane for the frame. More...
int GetPlaneHeight (int index)
 Gets the height (in pixels) for a specified video plane for the frame. More...
void ConvertInPlace (PixelFormat destinationFormat, IntPtr[] planes, int[] strides)
 Copies the video frame to a buffer, passed in as the planes parameter. More...

Static Public Member Functions

static VideoFrame CreateYuv420pFrameFromBuffer (PixelFormat sourceFormat, int width, int height, IntPtr[] planes, int[] strides)
 Creates a I420 video frame from an array of planes. More...
static VideoFrame CreateFrameFromBuffer (PixelFormat format, int width, int height, IntPtr[] planes, int[] strides)
 Creates a video frame from a set of planes. More...
static VideoFrame CreateFrameFromBuffer (PixelFormat format, int width, int height, IntPtr buffer)
 Creates a video frame from a buffer. More...
static VideoFrame CreateYuv420pFrameFromBitmap (Bitmap bitmap)
 Creates a YUV420p video frame from a bitmap. More...

Protected Member Functions

virtual void Dispose (bool disposing)

Properties

int Width [get]
 The width of the video frame, in pixels. More...
int Height [get]
 The height of the video frame, in pixels. More...
PixelFormat PixelFormat [get]
 The pixel format of the video frame. More...
int NumberOfPlanes [get]
 The number of planes in this video frame. More...
byte [] Metadata [get, set]
 The metadata associated with this frame, if any. The maximum size allowed for the metadata is 32 bytes. An ArgumentOutOfRangeException exception is thrown if you set this to a byte array larger than 32 bytes. More...

Detailed Description

Member Function Documentation

◆ ConvertInPlace()

void OpenTok.VideoFrame.ConvertInPlace ( PixelFormat  destinationFormat,
IntPtr []  planes,
int []  strides 
)

Copies the video frame to a buffer, passed in as the planes parameter.

Parameters
destinationFormatThe video format. Please note that currently this only works with PixelFormat.FormatYuv420p.
planesA pointer to the video data destination buffer planes.
stridesThe number of bytes in a single row of pixel data.

◆ CreateFrameFromBuffer() [1/2]

static VideoFrame OpenTok.VideoFrame.CreateFrameFromBuffer ( PixelFormat  format,
int  width,
int  height,
IntPtr []  planes,
int []  strides 
)

Creates a video frame from a set of planes.

Parameters
formatThe format of the source frames.
widthThe width, in pixels.
heightThe height, in pixels.
planesAn array containing the source planes.
stridesAn array containing the source strides.

◆ CreateFrameFromBuffer() [2/2]

static VideoFrame OpenTok.VideoFrame.CreateFrameFromBuffer ( PixelFormat  format,
int  width,
int  height,
IntPtr  buffer 
)

Creates a video frame from a buffer.

Parameters
formatThe format of the source frames.
widthThe width, in pixels.
heightThe height, in pixels.
bufferA pointer to the source buffer.

◆ CreateYuv420pFrameFromBitmap()

static VideoFrame OpenTok.VideoFrame.CreateYuv420pFrameFromBitmap ( Bitmap  bitmap)

Creates a YUV420p video frame from a bitmap.

Parameters
bitmapThe source bitmap for the frame.

◆ CreateYuv420pFrameFromBuffer()

static VideoFrame OpenTok.VideoFrame.CreateYuv420pFrameFromBuffer ( PixelFormat  sourceFormat,
int  width,
int  height,
IntPtr []  planes,
int []  strides 
)

Creates a I420 video frame from an array of planes.

Parameters
sourceFormatThe format of the source frames.
widthThe width, in pixels.
heightThe height, in pixels.
planesAn array containing the source planes.
stridesAn array containing the source strides.

◆ Dispose()

void OpenTok.VideoFrame.Dispose ( )

Disposes of the VideoFrame object's resources.

◆ GetPlane()

IntPtr OpenTok.VideoFrame.GetPlane ( int  index)

Gets a pointer to a specified video plane for the frame.

Parameters
indexThe index of the frame. The NumberOfPlanes property of the VideoFrame object is the number of planes available.

◆ GetPlaneHeight()

int OpenTok.VideoFrame.GetPlaneHeight ( int  index)

Gets the height (in pixels) for a specified video plane for the frame.

Parameters
indexThe index of the frame. The NumberOfPlanes property of the VideoFrame object is the number of planes available.

◆ GetPlaneSize()

int OpenTok.VideoFrame.GetPlaneSize ( int  index)

Gets the size of a specified video plane for the frame.

Parameters
indexThe index of the frame. The NumberOfPlanes property of the VideoFrame object is the number of planes available.

◆ GetPlaneStride()

int OpenTok.VideoFrame.GetPlaneStride ( int  index)

Gets the stride for a specified video plane for the frame.

Parameters
indexThe index of the frame. The NumberOfPlanes property of the VideoFrame object is the number of planes available.

◆ GetPlaneWidth()

int OpenTok.VideoFrame.GetPlaneWidth ( int  index)

Gets the width (in pixels) for a specified video plane for the frame.

Parameters
indexThe index of the frame. The NumberOfPlanes property of the VideoFrame object is the number of planes available.

Property Documentation

◆ Height

int OpenTok.VideoFrame.Height

The height of the video frame, in pixels.

◆ Metadata

byte [] OpenTok.VideoFrame.Metadata

The metadata associated with this frame, if any. The maximum size allowed for the metadata is 32 bytes. An ArgumentOutOfRangeException exception is thrown if you set this to a byte array larger than 32 bytes.

◆ NumberOfPlanes

int OpenTok.VideoFrame.NumberOfPlanes

The number of planes in this video frame.

◆ PixelFormat

PixelFormat OpenTok.VideoFrame.PixelFormat

The pixel format of the video frame.

◆ Width

int OpenTok.VideoFrame.Width

The width of the video frame, in pixels.