objc2_av_foundation/generated/
AVOutputSettingsAssistant.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-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset?language=objc)
13// NS_TYPED_ENUM
14pub type AVOutputSettingsPreset = NSString;
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset640x480?language=objc)
18    pub static AVOutputSettingsPreset640x480: &'static AVOutputSettingsPreset;
19}
20
21extern "C" {
22    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset960x540?language=objc)
23    pub static AVOutputSettingsPreset960x540: &'static AVOutputSettingsPreset;
24}
25
26extern "C" {
27    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset1280x720?language=objc)
28    pub static AVOutputSettingsPreset1280x720: &'static AVOutputSettingsPreset;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset1920x1080?language=objc)
33    pub static AVOutputSettingsPreset1920x1080: &'static AVOutputSettingsPreset;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspreset3840x2160?language=objc)
38    pub static AVOutputSettingsPreset3840x2160: &'static AVOutputSettingsPreset;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc1920x1080?language=objc)
43    pub static AVOutputSettingsPresetHEVC1920x1080: &'static AVOutputSettingsPreset;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc1920x1080withalpha?language=objc)
48    pub static AVOutputSettingsPresetHEVC1920x1080WithAlpha: &'static AVOutputSettingsPreset;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc3840x2160?language=objc)
53    pub static AVOutputSettingsPresetHEVC3840x2160: &'static AVOutputSettingsPreset;
54}
55
56extern "C" {
57    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc3840x2160withalpha?language=objc)
58    pub static AVOutputSettingsPresetHEVC3840x2160WithAlpha: &'static AVOutputSettingsPreset;
59}
60
61extern "C" {
62    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc7680x4320?language=objc)
63    pub static AVOutputSettingsPresetHEVC7680x4320: &'static AVOutputSettingsPreset;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc960x960?language=objc)
68    pub static AVOutputSettingsPresetMVHEVC960x960: &'static AVOutputSettingsPreset;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc1440x1440?language=objc)
73    pub static AVOutputSettingsPresetMVHEVC1440x1440: &'static AVOutputSettingsPreset;
74}
75
76extern_class!(
77    /// A class, each instance of which specifies a set of parameters for configuring objects that use output settings dictionaries, for example AVAssetWriter
78    /// &
79    /// AVAssetWriterInput, so that the resulting media file conforms to some specific criteria
80    ///
81    /// Instances of AVOutputSettingsAssistant are typically created using a string constant representing a specific preset configuration, such as AVOutputSettingsPreset1280x720.  Once you have an instance, its properties can be used as a guide for creating and configuring an AVAssetWriter object and one or more AVAssetWriterInput objects.  If all the suggested properties are respected, the resulting media file will conform to the criteria implied by the preset.  Alternatively, the properties of an instance can be used as a "base" configuration which can be customized to suit your individual needs.
82    ///
83    /// The recommendations made by an instance get better as you tell it more about the format of your source data.  For example, if you set the sourceVideoFormat property, the recommendation made by the videoSettings property will ensure that your video frames are not scaled up from a smaller size.
84    ///
85    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant?language=objc)
86    #[unsafe(super(NSObject))]
87    #[derive(Debug, PartialEq, Eq, Hash)]
88    pub struct AVOutputSettingsAssistant;
89);
90
91unsafe impl NSObjectProtocol for AVOutputSettingsAssistant {}
92
93impl AVOutputSettingsAssistant {
94    extern_methods!(
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102
103        /// Returns the list of presets that can be used to create an instance of AVOutputSettingsAssistant
104        ///
105        /// Returns: An NSArray of NSString objects, each of which is a preset identifier
106        ///
107        /// Each preset in the returned list can be passed in to +outputSettingsAssistantWithPreset: to create a new instance of AVOutputSettingsAssistant.
108        ///
109        /// On iOS, the returned array may be different between different device models.
110        #[unsafe(method(availableOutputSettingsPresets))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn availableOutputSettingsPresets() -> Retained<NSArray<AVOutputSettingsPreset>>;
113
114        /// Returns an instance of AVOutputSettingsAssistant corresponding to the given preset
115        ///
116        /// Parameter `presetIdentifier`: The string identifier, for example AVOutputSettingsPreset1280x720, for the desired preset
117        ///
118        /// Returns: An instance of AVOutputSettingsAssistant with properties corresponding to the given preset, or nil if there is no such available preset.
119        ///
120        /// The properties of the returned object can be used as a guide for creating and configuring an AVAssetWriter object and one or more AVAssetWriterInput objects.  If all the suggested properties are respected in creating the AVAssetWriter, the resulting media file will conform to the criteria implied by the preset.
121        ///
122        /// Use +availableOutputSettingsPresets to get a list of presets identifiers that can be used with this method.
123        #[unsafe(method(outputSettingsAssistantWithPreset:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn outputSettingsAssistantWithPreset(
126            preset_identifier: &AVOutputSettingsPreset,
127        ) -> Option<Retained<Self>>;
128
129        /// A dictionary of key/value pairs, as specified in AVAudioSettings.h, to be used when e.g. creating an instance of AVAssetWriterInput
130        ///
131        /// The value of this property may change as a result of setting a new value for the sourceAudioFormat property.
132        #[unsafe(method(audioSettings))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn audioSettings(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
135
136        /// A dictionary of key/value pairs, as specified in AVVideoSettings.h, to be used when e.g. creating an instance of AVAssetWriterInput
137        ///
138        /// The value of this property may change as a result of setting a new value for the sourceVideoFormat property.
139        #[unsafe(method(videoSettings))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn videoSettings(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
142
143        #[cfg(feature = "AVMediaFormat")]
144        /// A UTI indicating the type of file to be written, to be used when e.g. creating an instance of AVAssetWriter
145        ///
146        /// Use [[UTType typeWithIdentifier:outputFileType] preferredFilenameExtension] to get a suitable file extension for a given file type.
147        #[unsafe(method(outputFileType))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn outputFileType(&self) -> Retained<AVFileType>;
150    );
151}
152
153/// AVOutputSettingsAssistant_SourceInformation.
154impl AVOutputSettingsAssistant {
155    extern_methods!(
156        #[cfg(feature = "objc2-core-media")]
157        /// A CMAudioFormatDescription object describing the format of you audio data
158        ///
159        /// Setting this property will allow the receiver to make a more informed recommendation for the audio settings that should be used.  After setting this property, you should re-query the audioSettings property to get the new recommendation.  The default value is NULL, which means that the receiver does not know anything about the format of your audio data.
160        ///
161        /// If you set a non-NULL value for this property, and are using the receiver to initialize an AVAssetWriterInput, the same format description should be used to initialize the AVAssetWriterInput, along with the dictionary from the audioSettings property.
162        #[unsafe(method(sourceAudioFormat))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn sourceAudioFormat(&self) -> Option<Retained<CMAudioFormatDescription>>;
165
166        #[cfg(feature = "objc2-core-media")]
167        /// Setter for [`sourceAudioFormat`][Self::sourceAudioFormat].
168        #[unsafe(method(setSourceAudioFormat:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setSourceAudioFormat(
171            &self,
172            source_audio_format: Option<&CMAudioFormatDescription>,
173        );
174
175        #[cfg(feature = "objc2-core-media")]
176        /// A CMVideoFormatDescription object describing the format of your video data
177        ///
178        /// Setting this property will allow the receiver to make a more informed recommendation for the video settings that should be used.  After setting this property, you should re-query the videoSettings property to get the new recommendation.  The default value is NULL, which means that the receiver does not know anything about the format of your video data.
179        ///
180        /// If you set a non-NULL value for this property, and are using the receiver to initialize an AVAssetWriterInput, the same format description should be used to initialize the AVAssetWriterInput, along with the dictionary from the videoSettings property.
181        #[unsafe(method(sourceVideoFormat))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn sourceVideoFormat(&self) -> Option<Retained<CMVideoFormatDescription>>;
184
185        #[cfg(feature = "objc2-core-media")]
186        /// Setter for [`sourceVideoFormat`][Self::sourceVideoFormat].
187        #[unsafe(method(setSourceVideoFormat:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setSourceVideoFormat(
190            &self,
191            source_video_format: Option<&CMVideoFormatDescription>,
192        );
193
194        #[cfg(feature = "objc2-core-media")]
195        /// A CMTime describing the average frame duration (reciprocal of average frame rate) of your video data
196        ///
197        /// Setting this property will allow the receiver to make a more informed recommendation for the video settings that should be used.  After setting this property, you should re-query the videoSettings property to get the new recommendation.
198        ///
199        /// The default value is 1/30, which means that the receiver is assuming that your source video has an average frame rate of 30fps.
200        ///
201        /// It is an error to set this property to a value that is not positive or not numeric.  See CMTIME_IS_NUMERIC.
202        #[unsafe(method(sourceVideoAverageFrameDuration))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn sourceVideoAverageFrameDuration(&self) -> CMTime;
205
206        #[cfg(feature = "objc2-core-media")]
207        /// Setter for [`sourceVideoAverageFrameDuration`][Self::sourceVideoAverageFrameDuration].
208        #[unsafe(method(setSourceVideoAverageFrameDuration:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn setSourceVideoAverageFrameDuration(
211            &self,
212            source_video_average_frame_duration: CMTime,
213        );
214
215        #[cfg(feature = "objc2-core-media")]
216        /// A CMTime describing the minimum frame duration (reciprocal of the maximum frame rate) of your video data
217        ///
218        /// Setting this property will allow the receiver to make a more informed recommendation for the video settings that should be used.  After setting this property, you should re-query the videoSettings property to get the new recommendation.
219        ///
220        /// If your source of video data is an instance of AVAssetReaderOutput, you can discover the minimum frame duration of your source asset using the AVAssetTrack.minFrameDuration property.
221        ///
222        /// The default value is 1/30, which means that the receiver is assuming that your source video has a maximum frame rate of 30fps.
223        ///
224        /// It is an error to set this property to a value that is not positive or not numeric.  See CMTIME_IS_NUMERIC.
225        #[unsafe(method(sourceVideoMinFrameDuration))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn sourceVideoMinFrameDuration(&self) -> CMTime;
228
229        #[cfg(feature = "objc2-core-media")]
230        /// Setter for [`sourceVideoMinFrameDuration`][Self::sourceVideoMinFrameDuration].
231        #[unsafe(method(setSourceVideoMinFrameDuration:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn setSourceVideoMinFrameDuration(
234            &self,
235            source_video_min_frame_duration: CMTime,
236        );
237    );
238}