Bewerken

Delen via


CMFormatDescription.Create Method

Definition

Overloads

Create(IntPtr)

Creates a CMFormatDescription (or a subclass of it) based on a native handle.

Create(IntPtr, Boolean)

Creates a CMFormatDescription (or a subclass of it) based on a native handle.

Create(CMMediaType, UInt32, CMFormatDescriptionError)

Creates a CMFormatDescription (or a subclass of it) based on a native handle and to have it wrapped in a specific type.

Create(IntPtr)

Creates a CMFormatDescription (or a subclass of it) based on a native handle.

public static CoreMedia.CMFormatDescription Create (IntPtr handle);
static member Create : nativeint -> CoreMedia.CMFormatDescription

Parameters

handle
IntPtr

nativeint

The native handle to a CMFormatDescription or a subclass of it.

Returns

The return can be either a CMFormatDescription a CMAudioFormatDescription or a CMVideoFormatDescription, you can use the C# is expression to find out which subclass to cast the result to if you need access to the audio or video specific elements.

Remarks

This is the recommended way of surfacing an unmanaged format description, as this will create the proper wrapper with a strong type for the audio or video versions of it.

Applies to

Create(IntPtr, Boolean)

Creates a CMFormatDescription (or a subclass of it) based on a native handle.

public static CoreMedia.CMFormatDescription Create (IntPtr handle, bool owns);
static member Create : nativeint * bool -> CoreMedia.CMFormatDescription

Parameters

handle
IntPtr

nativeint

The native handle to a CMFormatDescription or a subclass of it.

owns
Boolean

True if the handle is already owned by maanged code, false otherwise (and in this case, the code will manually call retain on the object).

Returns

The return can be either a CMFormatDescription a CMAudioFormatDescription or a CMVideoFormatDescription, you can use the C# is expression to find out which subclass to cast the result to if you need access to the audio or video specific elements.

Remarks

This is mostly used to support the binding infrastructure.

Applies to

Create(CMMediaType, UInt32, CMFormatDescriptionError)

Creates a CMFormatDescription (or a subclass of it) based on a native handle and to have it wrapped in a specific type.

public static CoreMedia.CMFormatDescription Create (CoreMedia.CMMediaType mediaType, uint mediaSubtype, out CoreMedia.CMFormatDescriptionError error);
static member Create : CoreMedia.CMMediaType * uint32 *  -> CoreMedia.CMFormatDescription

Parameters

mediaType
CMMediaType

media type that we want to create a wrapper for

mediaSubtype
UInt32

The media subtype

error
CMFormatDescriptionError

Errors, if any, are returned here.

Returns

The return can be either a CMFormatDescription a CMAudioFormatDescription or a CMVideoFormatDescription depending on the mediaType parameter that you passed.

Remarks

In general, the Create(IntPtr) is a better option as it probes for the underlying type and creates the correct subclass of CMFormatDescription

Applies to