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