public static CMFormatDescription Create(CMMediaType mediaType, uint mediaSubtype, out CMFormatDescriptionError error) { IntPtr handle; error = CMFormatDescriptionCreate(IntPtr.Zero, mediaType, mediaSubtype, IntPtr.Zero, out handle); if (error != CMFormatDescriptionError.None) { return(null); } return(Create(mediaType, handle, true)); }
static CMFormatDescription Create(CMMediaType type, IntPtr handle, bool owns) { switch (type) { case CMMediaType.Video: return(new CMVideoFormatDescription(handle, owns)); case CMMediaType.Audio: return(new CMAudioFormatDescription(handle, owns)); default: return(new CMFormatDescription(handle, owns)); } }
static extern IntPtr MTCopyLocalizedNameForMediaType( CMMediaType mediaType);
extern static /* OSStatus */ CMFormatDescriptionError CMFormatDescriptionCreate(/* CFAllocatorRef */ IntPtr allocator, CMMediaType mediaType, /* FourCharCode */ uint mediaSubtype, /* CFDictionaryRef */ IntPtr extensions, /* CMFormatDescriptionRef* */ out IntPtr descOut);
public static CMFormatDescription Create(CMMediaType mediaType, uint mediaSubtype, out CMFormatDescriptionError error) { IntPtr handle; error = CMFormatDescriptionCreate (IntPtr.Zero, mediaType, mediaSubtype, IntPtr.Zero, out handle); if (error != CMFormatDescriptionError.None) return null; return Create (mediaType, handle, true); }
static CMFormatDescription Create(CMMediaType type, IntPtr handle, bool owns) { switch (type) { case CMMediaType.Video: return new CMVideoFormatDescription (handle, owns); case CMMediaType.Audio: return new CMAudioFormatDescription (handle, owns); default: return new CMFormatDescription (handle, owns); } }
extern static CMFormatDescriptionError CMFormatDescriptionCreate(IntPtr allocator, CMMediaType mediaType, uint mediaSubtype, IntPtr extensions, out IntPtr handle);
static extern CMFormatDescriptionError CMFormatDescriptionCreate(/* CFAllocatorRef */ IntPtr allocator, CMMediaType mediaType, /* FourCharCode */ uint mediaSubtype, /* CFDictionaryRef */ IntPtr extensions, /* CMFormatDescriptionRef* */ out IntPtr descOut);
static public string GetLocalizedName(this CMMediaType mediaType, uint mediaSubType) { return(CFString.FromHandle(MTCopyLocalizedNameForMediaSubType(mediaType, mediaSubType), releaseHandle: true)); }
static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaSubType( CMMediaType mediaType, uint mediaSubType);
static public string GetLocalizedName(this CMMediaType mediaType) { return(CFString.FetchString(MTCopyLocalizedNameForMediaType(mediaType), releaseHandle: true)); }
static extern CMFormatDescriptionError CMFormatDescriptionCreate(IntPtr allocator, CMMediaType mediaType, uint mediaSubtype, IntPtr extensions, out IntPtr handle);
static public string GetLocalizedName(this CMMediaType mediaType, uint mediaSubType) { return(CFString.FetchString(MTCopyLocalizedNameForMediaSubType(mediaType, mediaSubType))); }