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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
//! 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::*;
use crate::*;
/// A reference to either a Video Toolbox Decompression Session,
/// Compression Session or Pixel Transfer Session.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtsession?language=objc)
#[doc(alias = "VTSessionRef")]
pub type VTSession = CFType;
extern "C-unwind" {
/// Returns a dictionary enumerating all the supported properties of a video toolbox session.
///
/// The keys of the returned dictionary are the supported property keys.
/// The values are themselves dictionaries, each containing the following optional fields:
/// <OL
/// >
/// <LI
/// > the type of value, (kVTPropertyTypeKey)
/// <LI
/// > the read/write status of the property (kVTPropertyReadWriteStatusKey),
/// <LI
/// > whether the property is suitable for serialization (kVTPropertyShouldBeSerializedKey),
/// <LI
/// > a range or list of the supported values, if appropriate, and
/// <LI
/// > developer-level documentation for the property (kVTPropertyDocumentationKey).
/// </OL
/// >
/// The caller must release the returned dictionary.
///
/// # Safety
///
/// - `session` should be of the correct type.
/// - `supported_property_dictionary_out` must be a valid pointer.
pub fn VTSessionCopySupportedPropertyDictionary(
session: &VTSession,
supported_property_dictionary_out: NonNull<*const CFDictionary>,
) -> OSStatus;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytypekey?language=objc)
pub static kVTPropertyTypeKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_enumeration?language=objc)
pub static kVTPropertyType_Enumeration: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_boolean?language=objc)
pub static kVTPropertyType_Boolean: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertytype_number?language=objc)
pub static kVTPropertyType_Number: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatuskey?language=objc)
pub static kVTPropertyReadWriteStatusKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatus_readonly?language=objc)
pub static kVTPropertyReadWriteStatus_ReadOnly: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyreadwritestatus_readwrite?language=objc)
pub static kVTPropertyReadWriteStatus_ReadWrite: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertyshouldbeserializedkey?language=objc)
pub static kVTPropertyShouldBeSerializedKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvalueminimumkey?language=objc)
pub static kVTPropertySupportedValueMinimumKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvaluemaximumkey?language=objc)
pub static kVTPropertySupportedValueMaximumKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertysupportedvaluelistkey?language=objc)
pub static kVTPropertySupportedValueListKey: &'static CFString;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtpropertydocumentationkey?language=objc)
pub static kVTPropertyDocumentationKey: &'static CFString;
}
extern "C-unwind" {
/// Sets a property on a video toolbox session.
///
/// Setting a property value to NULL restores the default value.
///
/// # Safety
///
/// - `session` should be of the correct type.
/// - `property_value` should be of the correct type.
pub fn VTSessionSetProperty(
session: &VTSession,
property_key: &CFString,
property_value: Option<&CFType>,
) -> OSStatus;
}
extern "C-unwind" {
/// Retrieves a property on a video toolbox session.
///
/// The caller must release the retrieved property value.
/// <BR
/// >
/// Note: for most types of property, the returned values should be considered immutable.
/// In particular, for CFPropertyList types, sharing of mutable property value
/// objects between the client, session and codec should be avoided.
/// However, some properties will be used for exchanging service objects that are inherently
/// mutable (eg, CVPixelBufferPool).
///
/// Parameter `propertyKey`: The key for the property to retrieve.
///
/// Parameter `allocator`: An allocator suitable for use when copying property values.
///
/// Parameter `propertyValueOut`: Points to a variable to receive the property value, which must be a CF-registered type --
/// the caller may call CFGetTypeID() on it to identify which specific type.
/// The caller must release the this property value.
///
/// Returns: noErr if successful; kVTPropertyNotSupportedErr for unrecognized or unsupported properties.
///
/// # Safety
///
/// - `session` should be of the correct type.
/// - `property_value_out` must be a valid pointer or null.
pub fn VTSessionCopyProperty(
session: &VTSession,
property_key: &CFString,
allocator: Option<&CFAllocator>,
property_value_out: *mut c_void,
) -> OSStatus;
}
extern "C-unwind" {
/// Sets multiple properties at once.
///
/// Sets the properties specified by keys in propertyDictionary to the corresponding values.
///
/// # Safety
///
/// - `session` should be of the correct type.
/// - `property_dictionary` generics must be of the correct type.
pub fn VTSessionSetProperties(
session: &VTSession,
property_dictionary: &CFDictionary,
) -> OSStatus;
}
extern "C-unwind" {
/// Retrieves the set of serializable property keys and their current values.
///
/// The serializable properties are those which can be saved and applied to a different session.
/// The caller must release the returned dictionary.
///
/// # Safety
///
/// - `session` should be of the correct type.
/// - `dictionary_out` must be a valid pointer.
pub fn VTSessionCopySerializableProperties(
session: &VTSession,
allocator: Option<&CFAllocator>,
dictionary_out: NonNull<*const CFDictionary>,
) -> OSStatus;
}