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