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    #[cfg(all(feature = "objc2-core-graphics", feature = "objc2-core-video"))]
32    pub fn VTCreateCGImageFromCVPixelBuffer(
33        pixel_buffer: &CVPixelBuffer,
34        options: Option<&CFDictionary>,
35        image_out: NonNull<*mut CGImage>,
36    ) -> OSStatus;
37}
38
39extern "C-unwind" {
40    /// Requests that a video decoder, if available, be registered for the specified CMVideoCodecType
41    ///
42    /// Parameter `codecType`: The CMVideoCodecType corresponding the format being requested
43    ///
44    /// This call will find and register a video decoder for the provided CMVideoCodecType if
45    /// such a decoder is available on the system but not registered by default.
46    #[cfg(feature = "objc2-core-media")]
47    pub fn VTRegisterSupplementalVideoDecoderIfAvailable(codec_type: CMVideoCodecType);
48}
49
50extern "C-unwind" {
51    /// Returns information about the Media Extension video decoder required to decode the specified format.
52    ///
53    /// 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.
54    ///
55    /// Parameter `formatDesc`: The format description for the video format for which information is being requested.
56    ///
57    /// 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.
58    ///
59    /// 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. Otherwise, the return value will be an error code describing the failure.
60    #[cfg(feature = "objc2-core-media")]
61    pub fn VTCopyVideoDecoderExtensionProperties(
62        format_desc: &CMFormatDescription,
63        media_extension_properties_out: NonNull<*const CFDictionary>,
64    ) -> OSStatus;
65}
66
67extern "C-unwind" {
68    /// Returns information about the Media Extension RAW processor supporting the specified format.
69    ///
70    /// 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.
71    ///
72    /// Parameter `formatDesc`: The format description for the video format for which information is being requested.
73    ///
74    /// 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.
75    ///
76    /// 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. Otherwise, the return value will be an error code describing the failure.
77    #[cfg(feature = "objc2-core-media")]
78    pub fn VTCopyRAWProcessorExtensionProperties(
79        format_desc: &CMFormatDescription,
80        media_extension_properties_out: NonNull<*const CFDictionary>,
81    ) -> OSStatus;
82}
83
84/// A key in a Media Extension extension properties dictionary.
85///
86/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtextensionpropertieskey?language=objc)
87// NS_TYPED_ENUM
88pub type VTExtensionPropertiesKey = CFString;
89
90extern "C" {
91    /// A CFDictionary key for the video decoder extension identifier.
92    ///
93    /// 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.
94    ///
95    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionidentifierkey?language=objc)
96    pub static kVTExtensionProperties_ExtensionIdentifierKey: &'static VTExtensionPropertiesKey;
97}
98
99extern "C" {
100    /// A CFDictionary key for the localized extension name.
101    ///
102    /// This key points to a CFStringRef value with the localized extension name.
103    ///
104    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionnamekey?language=objc)
105    pub static kVTExtensionProperties_ExtensionNameKey: &'static VTExtensionPropertiesKey;
106}
107
108extern "C" {
109    /// A CFDictionary key for the extension host application localized name.
110    ///
111    /// This key points to a CFStringRef value with the localized name of the application hosting the extension.
112    ///
113    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_containingbundlenamekey?language=objc)
114    pub static kVTExtensionProperties_ContainingBundleNameKey: &'static VTExtensionPropertiesKey;
115}
116
117extern "C" {
118    /// A CFDictionary key for the URL of the extension.
119    ///
120    /// This key points to a CFURLRef value with the URL for the extension.
121    ///
122    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_extensionurlkey?language=objc)
123    pub static kVTExtensionProperties_ExtensionURLKey: &'static VTExtensionPropertiesKey;
124}
125
126extern "C" {
127    /// A CFDictionary key for the URL of the extension host application.
128    ///
129    /// This key points to a CFURLRef value with the URL of the extension host application.
130    ///
131    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_containingbundleurlkey?language=objc)
132    pub static kVTExtensionProperties_ContainingBundleURLKey: &'static VTExtensionPropertiesKey;
133}
134
135extern "C" {
136    /// A CFDictionary key for the user readable name string of the codec.
137    ///
138    /// 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.
139    ///
140    /// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtextensionproperties_codecnamekey?language=objc)
141    pub static kVTExtensionProperties_CodecNameKey: &'static VTExtensionPropertiesKey;
142}