objc2_av_foundation/generated/AVAssetVariant.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::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-media")]
9use objc2_core_media::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15 /// An AVAssetVariant represents a bit rate variant.
16 /// Each asset contains a collection of variants that represent a combination of audio, video, text, closed captions, and subtitles for a particular bit rate.
17 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariant?language=objc)
20 #[unsafe(super(NSObject))]
21 #[derive(Debug, PartialEq, Eq, Hash)]
22 pub struct AVAssetVariant;
23);
24
25unsafe impl Send for AVAssetVariant {}
26
27unsafe impl Sync for AVAssetVariant {}
28
29extern_conformance!(
30 unsafe impl NSObjectProtocol for AVAssetVariant {}
31);
32
33impl AVAssetVariant {
34 extern_methods!(
35 #[unsafe(method(init))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39 #[unsafe(method(new))]
40 #[unsafe(method_family = new)]
41 pub unsafe fn new() -> Retained<Self>;
42
43 /// If it is not declared, the value will be negative.
44 #[unsafe(method(peakBitRate))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn peakBitRate(&self) -> c_double;
47
48 /// If it is not declared, the value will be negative.
49 #[unsafe(method(averageBitRate))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn averageBitRate(&self) -> c_double;
52
53 /// Provides variant's video rendition attributes. If no video attributes are declared, it will be nil.
54 #[unsafe(method(videoAttributes))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn videoAttributes(&self) -> Option<Retained<AVAssetVariantVideoAttributes>>;
57
58 /// Provides variant's audio rendition attributes. If no audio attributes are declared, it will be nil.
59 #[unsafe(method(audioAttributes))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn audioAttributes(&self) -> Option<Retained<AVAssetVariantAudioAttributes>>;
62 );
63}
64
65extern_class!(
66 /// Video attributes for an asset variant.
67 ///
68 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
69 ///
70 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariantvideoattributes?language=objc)
71 #[unsafe(super(NSObject))]
72 #[derive(Debug, PartialEq, Eq, Hash)]
73 pub struct AVAssetVariantVideoAttributes;
74);
75
76extern_conformance!(
77 unsafe impl NSObjectProtocol for AVAssetVariantVideoAttributes {}
78);
79
80impl AVAssetVariantVideoAttributes {
81 extern_methods!(
82 #[unsafe(method(init))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86 #[unsafe(method(new))]
87 #[unsafe(method_family = new)]
88 pub unsafe fn new() -> Retained<Self>;
89
90 #[cfg(feature = "AVMediaFormat")]
91 /// Provides the video range of the variant. If it is not declared, it will be AVVideoRangeSDR.
92 #[unsafe(method(videoRange))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn videoRange(&self) -> Retained<AVVideoRange>;
95
96 /// Provides an array of video sample codec types present in the variant's renditions if any are declared. Each value in the array is a NSNumber representation of CMVideoCodecType.
97 #[unsafe(method(codecTypes))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn codecTypes(&self) -> Retained<NSArray<NSNumber>>;
100
101 #[cfg(feature = "objc2-core-foundation")]
102 /// If it is not declared, it will be CGSizeZero.
103 #[unsafe(method(presentationSize))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn presentationSize(&self) -> CGSize;
106
107 /// If it is not declared, the value will be negative.
108 #[unsafe(method(nominalFrameRate))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn nominalFrameRate(&self) -> c_double;
111
112 /// Describes the video layout attributes.
113 ///
114 /// videoLayoutAttributes' count may be greater than one if this variant contains a collection of differing video layout media attributes over time.
115 #[unsafe(method(videoLayoutAttributes))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn videoLayoutAttributes(
118 &self,
119 ) -> Retained<NSArray<AVAssetVariantVideoLayoutAttributes>>;
120 );
121}
122
123extern_class!(
124 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
125 ///
126 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariantvideolayoutattributes?language=objc)
127 #[unsafe(super(NSObject))]
128 #[derive(Debug, PartialEq, Eq, Hash)]
129 pub struct AVAssetVariantVideoLayoutAttributes;
130);
131
132unsafe impl Send for AVAssetVariantVideoLayoutAttributes {}
133
134unsafe impl Sync for AVAssetVariantVideoLayoutAttributes {}
135
136extern_conformance!(
137 unsafe impl NSObjectProtocol for AVAssetVariantVideoLayoutAttributes {}
138);
139
140impl AVAssetVariantVideoLayoutAttributes {
141 extern_methods!(
142 #[unsafe(method(init))]
143 #[unsafe(method_family = init)]
144 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
145
146 #[unsafe(method(new))]
147 #[unsafe(method_family = new)]
148 pub unsafe fn new() -> Retained<Self>;
149
150 #[cfg(feature = "objc2-core-media")]
151 /// Describes the stereo components. If not declared, the value will be `kCMStereoViewComponent_None`.
152 /// In case of monoscopic content, the value will be `kCMStereoViewComponent_None` and incase of stereoscopic content, the value will be `(kCMStereoViewComponent_LeftEye | kCMStereoViewComponent_RightEye)`.
153 #[unsafe(method(stereoViewComponents))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn stereoViewComponents(&self) -> CMStereoViewComponents;
156 );
157}
158
159extern_class!(
160 /// Audio attributes for an asset variant.
161 ///
162 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
163 ///
164 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariantaudioattributes?language=objc)
165 #[unsafe(super(NSObject))]
166 #[derive(Debug, PartialEq, Eq, Hash)]
167 pub struct AVAssetVariantAudioAttributes;
168);
169
170unsafe impl Send for AVAssetVariantAudioAttributes {}
171
172unsafe impl Sync for AVAssetVariantAudioAttributes {}
173
174extern_conformance!(
175 unsafe impl NSObjectProtocol for AVAssetVariantAudioAttributes {}
176);
177
178impl AVAssetVariantAudioAttributes {
179 extern_methods!(
180 #[unsafe(method(init))]
181 #[unsafe(method_family = init)]
182 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
183
184 #[unsafe(method(new))]
185 #[unsafe(method_family = new)]
186 pub unsafe fn new() -> Retained<Self>;
187
188 /// Provides an array of audio formats present in the variant's renditions if any are declared. Each value in the array is a NSNumber representation of AudioFormatID.
189 #[unsafe(method(formatIDs))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn formatIDs(&self) -> Retained<NSArray<NSNumber>>;
192
193 #[cfg(feature = "AVMediaSelectionGroup")]
194 /// Provides attributes for a specific audio media selection option. If no rendition specific attributes are declared, it will be nil.
195 ///
196 /// Parameter `mediaSelectionOption`: The option to return rendition specific information for.
197 #[unsafe(method(renditionSpecificAttributesForMediaOption:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn renditionSpecificAttributesForMediaOption(
200 &self,
201 media_selection_option: &AVMediaSelectionOption,
202 ) -> Option<Retained<AVAssetVariantAudioRenditionSpecificAttributes>>;
203 );
204}
205
206extern_class!(
207 /// Audio rendition attributes for an asset variant.
208 ///
209 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
210 ///
211 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariantaudiorenditionspecificattributes?language=objc)
212 #[unsafe(super(NSObject))]
213 #[derive(Debug, PartialEq, Eq, Hash)]
214 pub struct AVAssetVariantAudioRenditionSpecificAttributes;
215);
216
217unsafe impl Send for AVAssetVariantAudioRenditionSpecificAttributes {}
218
219unsafe impl Sync for AVAssetVariantAudioRenditionSpecificAttributes {}
220
221extern_conformance!(
222 unsafe impl NSObjectProtocol for AVAssetVariantAudioRenditionSpecificAttributes {}
223);
224
225impl AVAssetVariantAudioRenditionSpecificAttributes {
226 extern_methods!(
227 /// If it is not declared, the value will be negative.
228 ///
229 /// A channel count greater than two indicates that the variant offers a rich multichannel authoring.
230 #[unsafe(method(channelCount))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn channelCount(&self) -> NSInteger;
233
234 /// Indicates that the variant is best suited for delivery to headphones.
235 ///
236 /// A binaural variant may originate from a direct binaural recording or from the processing of a multichannel audio source.
237 #[unsafe(method(isBinaural))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn isBinaural(&self) -> bool;
240
241 /// Indicates that this variant contains virtualized or otherwise pre-processed audio content that is suitable for a variety of purposes.
242 ///
243 /// If a variant audio redition is immersive it is eligible for rendering either to headphones or speakers.
244 #[unsafe(method(isImmersive))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn isImmersive(&self) -> bool;
247
248 /// Indicates that this variant is declared as a downmix derivative of other media of greater channel count.
249 ///
250 /// If one or more multichannel variants are also provided, the dowmix is assumed to be compatible in its internal timing and other attributes with those variants. Typically this is because it has been derived from the same source. A downmix can be used as a suitable substitute for a multichannel variant under some conditions.
251 #[unsafe(method(isDownmix))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn isDownmix(&self) -> bool;
254 );
255}
256
257/// Methods declared on superclass `NSObject`.
258impl AVAssetVariantAudioRenditionSpecificAttributes {
259 extern_methods!(
260 #[unsafe(method(init))]
261 #[unsafe(method_family = init)]
262 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
263
264 #[unsafe(method(new))]
265 #[unsafe(method_family = new)]
266 pub unsafe fn new() -> Retained<Self>;
267 );
268}
269
270extern_class!(
271 /// The qualifier of an asset variant.
272 ///
273 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
274 ///
275 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetvariantqualifier?language=objc)
276 #[unsafe(super(NSObject))]
277 #[derive(Debug, PartialEq, Eq, Hash)]
278 pub struct AVAssetVariantQualifier;
279);
280
281unsafe impl Send for AVAssetVariantQualifier {}
282
283unsafe impl Sync for AVAssetVariantQualifier {}
284
285extern_conformance!(
286 unsafe impl NSCopying for AVAssetVariantQualifier {}
287);
288
289unsafe impl CopyingHelper for AVAssetVariantQualifier {
290 type Result = Self;
291}
292
293extern_conformance!(
294 unsafe impl NSObjectProtocol for AVAssetVariantQualifier {}
295);
296
297impl AVAssetVariantQualifier {
298 extern_methods!(
299 #[unsafe(method(init))]
300 #[unsafe(method_family = init)]
301 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
302
303 #[unsafe(method(new))]
304 #[unsafe(method_family = new)]
305 pub unsafe fn new() -> Retained<Self>;
306
307 /// Returns a qualifer for a predicate.
308 ///
309 /// Parameter `predicate`: The variant predicate. Must be a valid, non-nil NSPredicate.
310 #[unsafe(method(assetVariantQualifierWithPredicate:))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn assetVariantQualifierWithPredicate(predicate: &NSPredicate)
313 -> Retained<Self>;
314
315 /// Returns a qualifer for a particular asset variant.
316 ///
317 /// Parameter `variant`: A variant obtained from the -[AVAsset variants] or -[AVAssetDownloadConfiguration playableVariants]. Must be a valid, non-nil AVAssetVariant.
318 #[unsafe(method(assetVariantQualifierWithVariant:))]
319 #[unsafe(method_family = none)]
320 pub unsafe fn assetVariantQualifierWithVariant(variant: &AVAssetVariant) -> Retained<Self>;
321
322 /// Returns a qualifer for finding variant with minimum value in the input key path.
323 ///
324 /// Parameter `keyPath`: AVAssetVariant keyPath. Allowed keyPath values are peakBitRate, averageBitRate, videoAttributes.presentationSize. Must be a valid, non-nil NSString.
325 #[unsafe(method(assetVariantQualifierForMinimumValueInKeyPath:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn assetVariantQualifierForMinimumValueInKeyPath(
328 key_path: &NSString,
329 ) -> Retained<Self>;
330
331 /// Returns a qualifer for finding variant with maximum value in the input key path
332 ///
333 /// Parameter `keyPath`: AVAssetVariant keyPath. Allowed keyPath values are peakBitRate, averageBitRate, videoAttributes.presentationSize. Must be a valid, non-nil NSString.
334 #[unsafe(method(assetVariantQualifierForMaximumValueInKeyPath:))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn assetVariantQualifierForMaximumValueInKeyPath(
337 key_path: &NSString,
338 ) -> Retained<Self>;
339
340 #[cfg(feature = "AVMediaSelectionGroup")]
341 /// Creates a NSPredicate for audio channel count which can be used with other NSPredicates to express variant preferences.
342 ///
343 /// Parameter `channelCount`: The RHS value for the channel count in the predicate equation.
344 ///
345 /// Parameter `mediaSelectionOption`: The audio media selection option under consideration.
346 ///
347 /// Parameter `operatorType`: The valid values are NSLessThanPredicateOperatorType, NSLessThanOrEqualToPredicateOperatorType, NSGreaterThanPredicateOperatorType, NSGreaterThanOrEqualToPredicateOperatorType, NSEqualToPredicateOperatorType and NSNotEqualToPredicateOperatorType.
348 #[unsafe(method(predicateForChannelCount:mediaSelectionOption:operatorType:))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn predicateForChannelCount_mediaSelectionOption_operatorType(
351 channel_count: NSInteger,
352 media_selection_option: &AVMediaSelectionOption,
353 operator_type: NSPredicateOperatorType,
354 ) -> Retained<NSPredicate>;
355
356 #[cfg(feature = "AVMediaSelectionGroup")]
357 /// Creates a NSPredicate for binaural which can be used with other NSPredicates to express variant preferences.
358 ///
359 /// Parameter `isBinaural`: The RHS value for the value of isBinauralAudio in the predicate equation.
360 ///
361 /// Parameter `mediaSelectionOption`: The audio media selection option under consideration.
362 #[unsafe(method(predicateForBinauralAudio:mediaSelectionOption:))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn predicateForBinauralAudio_mediaSelectionOption(
365 is_binaural_audio: bool,
366 media_selection_option: &AVMediaSelectionOption,
367 ) -> Retained<NSPredicate>;
368
369 #[cfg(feature = "AVMediaSelectionGroup")]
370 /// Creates a NSPredicate for immersive audio which can be used with other NSPredicates to express variant preferences.
371 ///
372 /// Parameter `isImmersiveAudio`: The RHS value for the value of isImmersiveAudio in the predicate equation.
373 ///
374 /// Parameter `mediaSelectionOption`: The audio media selection option under consideration.
375 #[unsafe(method(predicateForImmersiveAudio:mediaSelectionOption:))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn predicateForImmersiveAudio_mediaSelectionOption(
378 is_immersive_audio: bool,
379 media_selection_option: &AVMediaSelectionOption,
380 ) -> Retained<NSPredicate>;
381
382 #[cfg(feature = "AVMediaSelectionGroup")]
383 /// Creates a NSPredicate for immersive audio which can be used with other NSPredicates to express variant preferences.
384 ///
385 /// Parameter `isDownmixAudio`: The RHS value for the value of isDownmixAudio in the predicate equation.
386 ///
387 /// Parameter `mediaSelectionOption`: The audio media selection option under consideration.
388 #[unsafe(method(predicateForDownmixAudio:mediaSelectionOption:))]
389 #[unsafe(method_family = none)]
390 pub unsafe fn predicateForDownmixAudio_mediaSelectionOption(
391 is_downmix_audio: bool,
392 media_selection_option: &AVMediaSelectionOption,
393 ) -> Retained<NSPredicate>;
394
395 #[cfg(feature = "objc2-core-foundation")]
396 /// Creates a NSPredicate for presentation size width which can be used with other NSPredicates to express variant preferences.
397 ///
398 /// Parameter `width`: The RHS value for the presentation size width in the predicate equation.
399 ///
400 /// Parameter `operatorType`: The valid values are NSLessThanPredicateOperatorType, NSLessThanOrEqualToPredicateOperatorType, NSGreaterThanPredicateOperatorType, NSGreaterThanOrEqualToPredicateOperatorType, NSEqualToPredicateOperatorType and NSNotEqualToPredicateOperatorType.
401 #[unsafe(method(predicateForPresentationWidth:operatorType:))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn predicateForPresentationWidth_operatorType(
404 width: CGFloat,
405 operator_type: NSPredicateOperatorType,
406 ) -> Retained<NSPredicate>;
407
408 #[cfg(feature = "objc2-core-foundation")]
409 /// Creates a NSPredicate for presentation size height which can be used with other NSPredicates to express variant preferences.
410 ///
411 /// Parameter `height`: The RHS value for the presentation size height in the predicate equation.
412 ///
413 /// Parameter `operatorType`: The valid values are NSLessThanPredicateOperatorType, NSLessThanOrEqualToPredicateOperatorType, NSGreaterThanPredicateOperatorType, NSGreaterThanOrEqualToPredicateOperatorType, NSEqualToPredicateOperatorType and NSNotEqualToPredicateOperatorType.
414 #[unsafe(method(predicateForPresentationHeight:operatorType:))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn predicateForPresentationHeight_operatorType(
417 height: CGFloat,
418 operator_type: NSPredicateOperatorType,
419 ) -> Retained<NSPredicate>;
420
421 #[cfg(feature = "AVMediaSelectionGroup")]
422 /// Creates a NSPredicate for audio sample rate which can be used with other NSPredicates to express variant preferences.
423 ///
424 /// Parameter `sampleRate`: The RHS value for the sample rate in the predicate equation.
425 ///
426 /// Parameter `mediaSelectionOption`: The audio media selection option under consideration.
427 ///
428 /// Parameter `operatorType`: The valid values are NSLessThanPredicateOperatorType, NSLessThanOrEqualToPredicateOperatorType, NSGreaterThanPredicateOperatorType, NSGreaterThanOrEqualToPredicateOperatorType, NSEqualToPredicateOperatorType and NSNotEqualToPredicateOperatorType.
429 #[unsafe(method(predicateForAudioSampleRate:mediaSelectionOption:operatorType:))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn predicateForAudioSampleRate_mediaSelectionOption_operatorType(
432 sample_rate: c_double,
433 media_selection_option: &AVMediaSelectionOption,
434 operator_type: NSPredicateOperatorType,
435 ) -> Retained<NSPredicate>;
436 );
437}