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));
            }
        }
Esempio n. 3
0
 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);
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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);
Esempio n. 8
0
 static extern CMFormatDescriptionError CMFormatDescriptionCreate(/* CFAllocatorRef */ IntPtr allocator, CMMediaType mediaType, /* FourCharCode */ uint mediaSubtype, /* CFDictionaryRef */ IntPtr extensions, /* CMFormatDescriptionRef* */ out IntPtr descOut);
Esempio n. 9
0
 static public string GetLocalizedName(this CMMediaType mediaType, uint mediaSubType)
 {
     return(CFString.FromHandle(MTCopyLocalizedNameForMediaSubType(mediaType, mediaSubType), releaseHandle: true));
 }
Esempio n. 10
0
 static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaSubType(
     CMMediaType mediaType, uint mediaSubType);
Esempio n. 11
0
 static public string GetLocalizedName(this CMMediaType mediaType)
 {
     return(CFString.FetchString(MTCopyLocalizedNameForMediaType(mediaType), releaseHandle: true));
 }
Esempio n. 12
0
 static extern CMFormatDescriptionError CMFormatDescriptionCreate(IntPtr allocator, CMMediaType mediaType, uint mediaSubtype, IntPtr extensions, out IntPtr handle);
Esempio n. 13
0
 static public string GetLocalizedName(this CMMediaType mediaType, uint mediaSubType)
 {
     return(CFString.FetchString(MTCopyLocalizedNameForMediaSubType(mediaType, mediaSubType)));
 }