objc2_video_toolbox/generated/
VTSession.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
7use crate::*;
8
9/// A reference to either a Video Toolbox Decompression Session,
10/// Compression Session or Pixel Transfer Session.
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtsession?language=objc)
13#[doc(alias = "VTSessionRef")]
14pub type VTSession = CFType;
15
16extern "C-unwind" {
17    /// Returns a dictionary enumerating all the supported properties of a video toolbox session.
18    ///
19    /// The keys of the returned dictionary are the supported property keys.
20    /// The values are themselves dictionaries, each containing the following optional fields:
21    /// <OL
22    /// >
23    /// <LI
24    /// > the type of value, (kVTPropertyTypeKey)
25    /// <LI
26    /// > the read/write status of the property (kVTPropertyReadWriteStatusKey),
27    /// <LI
28    /// > whether the property is suitable for serialization (kVTPropertyShouldBeSerializedKey),
29    /// <LI
30    /// > a range or list of the supported values, if appropriate, and
31    /// <LI
32    /// > developer-level documentation for the property (kVTPropertyDocumentationKey).
33    /// </OL
34    /// >
35    /// The caller must release the returned dictionary.
36    ///
37    /// # Safety
38    ///
39    /// - `session` should be of the correct type.
40    /// - `supported_property_dictionary_out` must be a valid pointer.
41    pub fn VTSessionCopySupportedPropertyDictionary(
42        session: &VTSession,
43        supported_property_dictionary_out: NonNull<*const CFDictionary>,
44    ) -> OSStatus;
45}
46
47extern "C" {
48    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytypekey?language=objc)
49    pub static kVTPropertyTypeKey: &'static CFString;
50}
51
52extern "C" {
53    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_enumeration?language=objc)
54    pub static kVTPropertyType_Enumeration: &'static CFString;
55}
56
57extern "C" {
58    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_boolean?language=objc)
59    pub static kVTPropertyType_Boolean: &'static CFString;
60}
61
62extern "C" {
63    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_number?language=objc)
64    pub static kVTPropertyType_Number: &'static CFString;
65}
66
67extern "C" {
68    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatuskey?language=objc)
69    pub static kVTPropertyReadWriteStatusKey: &'static CFString;
70}
71
72extern "C" {
73    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatus_readonly?language=objc)
74    pub static kVTPropertyReadWriteStatus_ReadOnly: &'static CFString;
75}
76
77extern "C" {
78    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatus_readwrite?language=objc)
79    pub static kVTPropertyReadWriteStatus_ReadWrite: &'static CFString;
80}
81
82extern "C" {
83    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyshouldbeserializedkey?language=objc)
84    pub static kVTPropertyShouldBeSerializedKey: &'static CFString;
85}
86
87extern "C" {
88    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvalueminimumkey?language=objc)
89    pub static kVTPropertySupportedValueMinimumKey: &'static CFString;
90}
91
92extern "C" {
93    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvaluemaximumkey?language=objc)
94    pub static kVTPropertySupportedValueMaximumKey: &'static CFString;
95}
96
97extern "C" {
98    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvaluelistkey?language=objc)
99    pub static kVTPropertySupportedValueListKey: &'static CFString;
100}
101
102extern "C" {
103    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertydocumentationkey?language=objc)
104    pub static kVTPropertyDocumentationKey: &'static CFString;
105}
106
107extern "C-unwind" {
108    /// Sets a property on a video toolbox session.
109    ///
110    /// Setting a property value to NULL restores the default value.
111    ///
112    /// # Safety
113    ///
114    /// - `session` should be of the correct type.
115    /// - `property_value` should be of the correct type.
116    pub fn VTSessionSetProperty(
117        session: &VTSession,
118        property_key: &CFString,
119        property_value: Option<&CFType>,
120    ) -> OSStatus;
121}
122
123extern "C-unwind" {
124    /// Retrieves a property on a video toolbox session.
125    ///
126    /// The caller must release the retrieved property value.
127    /// <BR
128    /// >
129    /// Note: for most types of property, the returned values should be considered immutable.
130    /// In particular, for CFPropertyList types, sharing of mutable property value
131    /// objects between the client, session and codec should be avoided.
132    /// However, some properties will be used for exchanging service objects that are inherently
133    /// mutable (eg, CVPixelBufferPool).
134    ///
135    /// Parameter `propertyKey`: The key for the property to retrieve.
136    ///
137    /// Parameter `allocator`: An allocator suitable for use when copying property values.
138    ///
139    /// Parameter `propertyValueOut`: Points to a variable to receive the property value, which must be a CF-registered type --
140    /// the caller may call CFGetTypeID() on it to identify which specific type.
141    /// The caller must release the this property value.
142    ///
143    /// Returns: noErr if successful; kVTPropertyNotSupportedErr for unrecognized or unsupported properties.
144    ///
145    /// # Safety
146    ///
147    /// - `session` should be of the correct type.
148    /// - `property_value_out` must be a valid pointer or null.
149    pub fn VTSessionCopyProperty(
150        session: &VTSession,
151        property_key: &CFString,
152        allocator: Option<&CFAllocator>,
153        property_value_out: *mut c_void,
154    ) -> OSStatus;
155}
156
157extern "C-unwind" {
158    /// Sets multiple properties at once.
159    ///
160    /// Sets the properties specified by keys in propertyDictionary to the corresponding values.
161    ///
162    /// # Safety
163    ///
164    /// - `session` should be of the correct type.
165    /// - `property_dictionary` generics must be of the correct type.
166    pub fn VTSessionSetProperties(
167        session: &VTSession,
168        property_dictionary: &CFDictionary,
169    ) -> OSStatus;
170}
171
172extern "C-unwind" {
173    /// Retrieves the set of serializable property keys and their current values.
174    ///
175    /// The serializable properties are those which can be saved and applied to a different session.
176    /// The caller must release the returned dictionary.
177    ///
178    /// # Safety
179    ///
180    /// - `session` should be of the correct type.
181    /// - `dictionary_out` must be a valid pointer.
182    pub fn VTSessionCopySerializableProperties(
183        session: &VTSession,
184        allocator: Option<&CFAllocator>,
185        dictionary_out: NonNull<*const CFDictionary>,
186    ) -> OSStatus;
187}