objc2_av_foundation/generated/
AVAssetPlaybackAssistant.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoption?language=objc)
11// NS_TYPED_ENUM
12pub type AVAssetPlaybackConfigurationOption = NSString;
13
14extern "C" {
15    /// Indicates whether or not the asset can be rendered as stereo video.
16    ///
17    /// Clients may use this property to determine whether to configure stereo video rendering.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoptionstereovideo?language=objc)
20    pub static AVAssetPlaybackConfigurationOptionStereoVideo:
21        &'static AVAssetPlaybackConfigurationOption;
22}
23
24extern "C" {
25    /// Indicates whether or not the asset can rendered as stereo video and is also in a multiview compression format.
26    ///
27    /// Clients may use this property to determine whether to configure stereo video rendering.
28    ///
29    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoptionstereomultiviewvideo?language=objc)
30    pub static AVAssetPlaybackConfigurationOptionStereoMultiviewVideo:
31        &'static AVAssetPlaybackConfigurationOption;
32}
33
34extern "C" {
35    /// Indicates whether or not the asset can be rendered as spatial video.
36    ///
37    /// Clients may use this property to determine whether to configure spatial video rendering.
38    ///
39    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoptionspatialvideo?language=objc)
40    pub static AVAssetPlaybackConfigurationOptionSpatialVideo:
41        &'static AVAssetPlaybackConfigurationOption;
42}
43
44extern "C" {
45    /// Indicates whether the asset calls for the use of a non-rectilinear projection for rendering video.
46    ///
47    /// Clients may use this property to determine whether to configure a non-rectilinear projection when displaying video.
48    ///
49    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoptionnonrectilinearprojection?language=objc)
50    pub static AVAssetPlaybackConfigurationOptionNonRectilinearProjection:
51        &'static AVAssetPlaybackConfigurationOption;
52}
53
54extern "C" {
55    /// Indicates whether the asset is Apple Immersive Video.
56    ///
57    /// Clients may use this property to switch into specific display and control modes for Apple Immersive Video playback.
58    ///
59    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackconfigurationoptionappleimmersivevideo?language=objc)
60    pub static AVAssetPlaybackConfigurationOptionAppleImmersiveVideo:
61        &'static AVAssetPlaybackConfigurationOption;
62}
63
64extern_class!(
65    /// AVAssetPlaybackAssistant provides playback information for an asset.
66    ///
67    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
68    ///
69    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetplaybackassistant?language=objc)
70    #[unsafe(super(NSObject))]
71    #[derive(Debug, PartialEq, Eq, Hash)]
72    pub struct AVAssetPlaybackAssistant;
73);
74
75unsafe impl Send for AVAssetPlaybackAssistant {}
76
77unsafe impl Sync for AVAssetPlaybackAssistant {}
78
79extern_conformance!(
80    unsafe impl NSObjectProtocol for AVAssetPlaybackAssistant {}
81);
82
83impl AVAssetPlaybackAssistant {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92
93        #[cfg(feature = "AVAsset")]
94        /// Returns an instance of AVAssetPlaybackAssistant for inspection of an AVAsset object.
95        ///
96        /// - Parameter asset: An instance of AVAsset.
97        ///
98        /// - Returns: An instance of AVAssetPlaybackAssistant.
99        #[unsafe(method(assetPlaybackAssistantWithAsset:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn assetPlaybackAssistantWithAsset(asset: &AVAsset) -> Retained<Self>;
102
103        #[cfg(feature = "block2")]
104        /// Calls the completionHandler with information about the asset.
105        ///
106        /// completionHandler is called when all of the AVAssetPlaybackConfigurationOption values have been loaded. If AVAssetPlaybackAssistant encounters failures when inspecting the contents of the asset, it will return no AVAssetPlaybackConfigurationOptions associated with those contents.
107        ///
108        /// - Parameter completionHandler: Called with an array of AVAssetPlaybackConfigurationOption values describing capabilities of the asset.
109        ///
110        /// # Safety
111        ///
112        /// `completion_handler` block must be sendable.
113        #[unsafe(method(loadPlaybackConfigurationOptionsWithCompletionHandler:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn loadPlaybackConfigurationOptionsWithCompletionHandler(
116            &self,
117            completion_handler: &block2::DynBlock<
118                dyn Fn(NonNull<NSArray<AVAssetPlaybackConfigurationOption>>),
119            >,
120        );
121    );
122}