objc2_video_toolbox/generated/
VTUtilities.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2_core_foundation::*;
6#[cfg(feature = "objc2-core-graphics")]
7use objc2_core_graphics::*;
8#[cfg(feature = "objc2-core-media")]
9use objc2_core_media::*;
10#[cfg(feature = "objc2-core-video")]
11use objc2_core_video::*;
12
13use crate::*;
14
15extern "C-unwind" {
16    /// Creates a CGImage using the provided CVPixelBuffer
17    ///
18    /// Parameter `pixelBuffer`: The pixelBuffer to be used as the image data source for the CGImage.
19    ///
20    /// Parameter `options`: no options currently.  pass NULL.
21    ///
22    /// Parameter `imageOut`: pointer to an address to receive the newly created CGImage.
23    ///
24    /// This routine creates a CGImage representation of the image data contained in
25    /// the provided CVPixelBuffer.
26    /// The source CVPixelBuffer may be retained for the lifetime of the CGImage.  Changes
27    /// to the CVPixelBuffer after making this call (other than releasing it) will have
28    /// undefined results.
29    /// Not all CVPixelBuffer pixel formats will support conversion into a CGImage compatible
30    /// pixel format.
31    ///
32    /// # Safety
33    ///
34    /// - `options` generics must be of the correct type.
35    /// - `image_out` must be a valid pointer.
36    #[cfg(all(feature = "objc2-core-graphics", feature = "objc2-core-video"))]
37    pub fn VTCreateCGImageFromCVPixelBuffer(
38        pixel_buffer: &CVPixelBuffer,
39        options: Option<&CFDictionary>,
40        image_out: NonNull<*mut CGImage>,
41    ) -> OSStatus;
42}
43
44extern "C-unwind" {
45    /// Requests that a video decoder, if available, be registered for the specified CMVideoCodecType
46    ///
47    /// Parameter `codecType`: The CMVideoCodecType corresponding the format being requested
48    ///
49    /// This call will find and register a video decoder for the provided CMVideoCodecType if
50    /// such a decoder is available on the system but not registered by default.
51    #[cfg(feature = "objc2-core-media")]
52    pub fn VTRegisterSupplementalVideoDecoderIfAvailable(codec_type: CMVideoCodecType);
53}
54
55extern "C-unwind" {
56    /// Returns information about the Media Extension video decoder required to decode the specified format.
57    ///
58    /// If a Media Extension video decoder will be used to decode the specified format, this function will return information about the Media Extension that will be used.
59    ///
60    /// Parameter `formatDesc`: The format description for the video format for which information is being requested.
61    ///
62    /// Parameter `mediaExtensionPropertiesOut`: If a Media Extension video decoder will be used to decode the specified format, this pointer will return a dictionary with a set of properties describing the extension video decoder. The dictionary keys are VTExtensionPropertiesKey values.
63    ///
64    /// Returns: If the function succeeds and a Media Extension video decoder will be used to decode this format, the return value will be noErr. If the function succeeds but a Media Extension video decoder will not be used to decode this format, the return value will be kVTCouldNotFindExtensionErr. If a Media Extension video decoder for the format was found but is disabled, the function will return kVTExtensionDisabledErr. Otherwise, the return value will be an error code describing the failure.
65    ///
66    /// # Safety
67    ///
68    /// `media_extension_properties_out` must be a valid pointer.
69    #[cfg(feature = "objc2-core-media")]
70    pub fn VTCopyVideoDecoderExtensionProperties(
71        format_desc: &CMFormatDescription,
72        media_extension_properties_out: NonNull<*const CFDictionary>,
73    ) -> OSStatus;
74}
75
76extern "C-unwind" {
77    /// Returns information about the Media Extension RAW processor supporting the specified format.
78    ///
79    /// If a Media Extension RAW processor will be used to process the specified format, this function will return information about the Media Extension that will be used.
80    ///
81    /// Parameter `formatDesc`: The format description for the video format for which information is being requested.
82    ///
83    /// Parameter `mediaExtensionPropertiesOut`: If a Media Extension RAW processor  will be used to process the specified format, this pointer will return a dictionary with a set of properties describing the extension RAW processor. The dictionary keys VTExtensionPropertiesKey values.
84    ///
85    /// Returns: If the function succeeds and a Media Extension RAW processor will be used to process this format, the return value will be noErr. If the function succeeds but a Media Extension RAW processor will not be used to process this format, the return value will be kVTCouldNotFindExtensionErr. If a Media Extension RAW processor for the format was found but is disabled, the function will return kVTExtensionDisabledErr. Otherwise, the return value will be an error code describing the failure.
86    ///
87    /// # Safety
88    ///
89    /// `media_extension_properties_out` must be a valid pointer.
90    #[cfg(feature = "objc2-core-media")]
91    pub fn VTCopyRAWProcessorExtensionProperties(
92        format_desc: &CMFormatDescription,
93        media_extension_properties_out: NonNull<*const CFDictionary>,
94    ) -> OSStatus;
95}
96
97/// A key in a Media Extension extension properties dictionary.
98///
99/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtextensionpropertieskey?language=objc)
100// NS_TYPED_ENUM
101pub type VTExtensionPropertiesKey = CFString;
102
103extern "C" {
104    /// A CFDictionary key for the video decoder extension identifier.
105    ///
106    /// This key points to a CFStringRef value with the extension identifier, corresponding to the ClassImplementationID value from the EXAppExtensionAttributes dictionary in the Info.plist file.
107    ///
108    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionidentifierkey?language=objc)
109    pub static kVTExtensionProperties_ExtensionIdentifierKey: &'static VTExtensionPropertiesKey;
110}
111
112extern "C" {
113    /// A CFDictionary key for the localized extension name.
114    ///
115    /// This key points to a CFStringRef value with the localized extension name.
116    ///
117    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionnamekey?language=objc)
118    pub static kVTExtensionProperties_ExtensionNameKey: &'static VTExtensionPropertiesKey;
119}
120
121extern "C" {
122    /// A CFDictionary key for the extension host application localized name.
123    ///
124    /// This key points to a CFStringRef value with the localized name of the application hosting the extension.
125    ///
126    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_containingbundlenamekey?language=objc)
127    pub static kVTExtensionProperties_ContainingBundleNameKey: &'static VTExtensionPropertiesKey;
128}
129
130extern "C" {
131    /// A CFDictionary key for the URL of the extension.
132    ///
133    /// This key points to a CFURLRef value with the URL for the extension.
134    ///
135    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionurlkey?language=objc)
136    pub static kVTExtensionProperties_ExtensionURLKey: &'static VTExtensionPropertiesKey;
137}
138
139extern "C" {
140    /// A CFDictionary key for the URL of the extension host application.
141    ///
142    /// This key points to a CFURLRef value with the URL of the extension host application.
143    ///
144    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_containingbundleurlkey?language=objc)
145    pub static kVTExtensionProperties_ContainingBundleURLKey: &'static VTExtensionPropertiesKey;
146}
147
148extern "C" {
149    /// A CFDictionary key for the user readable name string of the codec.
150    ///
151    /// This key points to a CFStringRef with the name of the codec from the supplied format description. This name will be the one listed in the extension CodecInfo array with the key CodecName.
152    ///
153    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_codecnamekey?language=objc)
154    pub static kVTExtensionProperties_CodecNameKey: &'static VTExtensionPropertiesKey;
155}