Share via


VTCompressionSession.Create Method

Definition

Overloads

Create(Int32, Int32, CMVideoCodecType, VTCompressionSession+VTCompressionOutputCallback, VTVideoEncoderSpecification, CVPixelBufferAttributes)

Create a new compression session

public static VideoToolbox.VTCompressionSession? Create(int width, int height, CoreMedia.CMVideoCodecType codecType, VideoToolbox.VTCompressionSession.VTCompressionOutputCallback compressionOutputCallback, VideoToolbox.VTVideoEncoderSpecification? encoderSpecification, CoreVideo.CVPixelBufferAttributes? sourceImageBufferAttributes);
static member Create : int * int * CoreMedia.CMVideoCodecType * VideoToolbox.VTCompressionSession.VTCompressionOutputCallback * VideoToolbox.VTVideoEncoderSpecification * CoreVideo.CVPixelBufferAttributes -> VideoToolbox.VTCompressionSession

Parameters

width
Int32

Frame width in pixels.

height
Int32

Frame height in pixels.

codecType
CMVideoCodecType

Encoder to use to compress the frames.

compressionOutputCallback
VTCompressionSession.VTCompressionOutputCallback

A callback that will be invoked to process a compressed frame. See the delegate type for more information on the received parameters.

encoderSpecification
VTVideoEncoderSpecification

Parameters to choose the encoder, or null to let VideoToolbox choose it.

sourceImageBufferAttributes
CVPixelBufferAttributes

Any additional attributes for the compressed data.

Returns

A new VTCompressionSession if successful, null otherwise.

Remarks

The compressionOutputCallback callback will be invoked for each frame in decode order, not necessarily the display order.

Applies to

Create(Int32, Int32, CMVideoCodecType, VTCompressionSession+VTCompressionOutputCallback, VTVideoEncoderSpecification, NSDictionary)

Create a new compression session

public static VideoToolbox.VTCompressionSession? Create(int width, int height, CoreMedia.CMVideoCodecType codecType, VideoToolbox.VTCompressionSession.VTCompressionOutputCallback compressionOutputCallback, VideoToolbox.VTVideoEncoderSpecification? encoderSpecification = default, Foundation.NSDictionary? sourceImageBufferAttributes = default);
static member Create : int * int * CoreMedia.CMVideoCodecType * VideoToolbox.VTCompressionSession.VTCompressionOutputCallback * VideoToolbox.VTVideoEncoderSpecification * Foundation.NSDictionary -> VideoToolbox.VTCompressionSession

Parameters

width
Int32

Frame width in pixels.

height
Int32

Frame height in pixels.

codecType
CMVideoCodecType

Encoder to use to compress the frames.

compressionOutputCallback
VTCompressionSession.VTCompressionOutputCallback

A callback that will be invoked to process a compressed frame. See the delegate type for more information on the received parameters.

encoderSpecification
VTVideoEncoderSpecification

Parameters to choose the encoder, or null to let VideoToolbox choose it.

sourceImageBufferAttributes
NSDictionary

Any additional attributes for the compressed data.

Returns

A new VTCompressionSession if successful, null otherwise.

Remarks

The compressionOutputCallback callback will be invoked for each frame in decode order, not necessarily the display order.

Applies to