Edit

Share via


VTCompressionSession.Create Method

Definition

Overloads

Create(Int32, Int32, CMVideoCodecType, VTCompressionSession+VTCompressionOutputCallback, VTVideoEncoderSpecification, CVPixelBufferAttributes)
Create(Int32, Int32, CMVideoCodecType, VTCompressionSession+VTCompressionOutputCallback, VTVideoEncoderSpecification, NSDictionary)
Obsolete.

Creates a compression session

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

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
height
Int32
codecType
CMVideoCodecType
encoderSpecification
VTVideoEncoderSpecification
sourceImageBufferAttributes
CVPixelBufferAttributes

Returns

Applies to

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

Caution

This overload requires that the provided compressionOutputCallback manually CFRetain the passed CMSampleBuffer, use Create(int,int,CMVideoCodecType,VTCompressionOutputCallback,VTVideoEncoderSpecification,CVPixelBufferAttributes) variant instead which does not have that requirement.

Creates a compression session

[System.Obsolete("This overload requires that the provided compressionOutputCallback manually CFRetain the passed CMSampleBuffer, use Create(int,int,CMVideoCodecType,VTCompressionOutputCallback,VTVideoEncoderSpecification,CVPixelBufferAttributes) variant instead which does not have that requirement.")]
public static VideoToolbox.VTCompressionSession Create (int width, int height, CoreMedia.CMVideoCodecType codecType, VideoToolbox.VTCompressionSession.VTCompressionOutputCallback compressionOutputCallback, VideoToolbox.VTVideoEncoderSpecification encoderSpecification = null, Foundation.NSDictionary sourceImageBufferAttributes = null);
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

Method 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

The Dictionary property extracted from a CVPixelBufferAttributes type, or an NSDictionary with the desired CoreVideo Pixel Buffer Attributes values.

Returns

Attributes

Remarks

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

Applies to