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