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/avoutputsettingspresethevc4320x2160?language=objc)
63    pub static AVOutputSettingsPresetHEVC4320x2160: &'static AVOutputSettingsPreset;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresethevc7680x4320?language=objc)
68    pub static AVOutputSettingsPresetHEVC7680x4320: &'static AVOutputSettingsPreset;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc960x960?language=objc)
73    pub static AVOutputSettingsPresetMVHEVC960x960: &'static AVOutputSettingsPreset;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc1440x1440?language=objc)
78    pub static AVOutputSettingsPresetMVHEVC1440x1440: &'static AVOutputSettingsPreset;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc4320x4320?language=objc)
83    pub static AVOutputSettingsPresetMVHEVC4320x4320: &'static AVOutputSettingsPreset;
84}
85
86extern "C" {
87    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingspresetmvhevc7680x7680?language=objc)
88    pub static AVOutputSettingsPresetMVHEVC7680x7680: &'static AVOutputSettingsPreset;
89}
90
91extern_class!(
92    /// A class, each instance of which specifies a set of parameters for configuring objects that use output settings dictionaries, for example AVAssetWriter
93    /// &
94    /// AVAssetWriterInput, so that the resulting media file conforms to some specific criteria
95    ///
96    /// 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.
97    ///
98    /// 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.
99    ///
100    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avoutputsettingsassistant?language=objc)
101    #[unsafe(super(NSObject))]
102    #[derive(Debug, PartialEq, Eq, Hash)]
103    pub struct AVOutputSettingsAssistant;
104);
105
106extern_conformance!(
107    unsafe impl NSObjectProtocol for AVOutputSettingsAssistant {}
108);
109
110impl AVOutputSettingsAssistant {
111    extern_methods!(
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new() -> Retained<Self>;
119
120        /// Returns the list of presets that can be used to create an instance of AVOutputSettingsAssistant
121        ///
122        /// Returns: An NSArray of NSString objects, each of which is a preset identifier
123        ///
124        /// Each preset in the returned list can be passed in to +outputSettingsAssistantWithPreset: to create a new instance of AVOutputSettingsAssistant.
125        ///
126        /// On iOS, the returned array may be different between different device models.
127        #[unsafe(method(availableOutputSettingsPresets))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn availableOutputSettingsPresets() -> Retained<NSArray<AVOutputSettingsPreset>>;
130
131        /// Returns an instance of AVOutputSettingsAssistant corresponding to the given preset
132        ///
133        /// Parameter `presetIdentifier`: The string identifier, for example AVOutputSettingsPreset1280x720, for the desired preset
134        ///
135        /// Returns: An instance of AVOutputSettingsAssistant with properties corresponding to the given preset, or nil if there is no such available preset.
136        ///
137        /// 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.
138        ///
139        /// Use +availableOutputSettingsPresets to get a list of presets identifiers that can be used with this method.
140        #[unsafe(method(outputSettingsAssistantWithPreset:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn outputSettingsAssistantWithPreset(
143            preset_identifier: &AVOutputSettingsPreset,
144        ) -> Option<Retained<Self>>;
145
146        /// A dictionary of key/value pairs, as specified in AVAudioSettings.h, to be used when e.g. creating an instance of AVAssetWriterInput
147        ///
148        /// The value of this property may change as a result of setting a new value for the sourceAudioFormat property.
149        #[unsafe(method(audioSettings))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn audioSettings(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
152
153        /// A dictionary of key/value pairs, as specified in AVVideoSettings.h, to be used when e.g. creating an instance of AVAssetWriterInput
154        ///
155        /// The value of this property may change as a result of setting a new value for the sourceVideoFormat property.
156        #[unsafe(method(videoSettings))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn videoSettings(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
159
160        #[cfg(feature = "AVMediaFormat")]
161        /// A UTI indicating the type of file to be written, to be used when e.g. creating an instance of AVAssetWriter
162        ///
163        /// Use [[UTType typeWithIdentifier:outputFileType] preferredFilenameExtension] to get a suitable file extension for a given file type.
164        #[unsafe(method(outputFileType))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn outputFileType(&self) -> Retained<AVFileType>;
167    );
168}
169
170/// AVOutputSettingsAssistant_SourceInformation.
171impl AVOutputSettingsAssistant {
172    extern_methods!(
173        #[cfg(feature = "objc2-core-media")]
174        /// A CMAudioFormatDescription object describing the format of you audio data
175        ///
176        /// 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.
177        ///
178        /// 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.
179        #[unsafe(method(sourceAudioFormat))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn sourceAudioFormat(&self) -> Option<Retained<CMAudioFormatDescription>>;
182
183        #[cfg(feature = "objc2-core-media")]
184        /// Setter for [`sourceAudioFormat`][Self::sourceAudioFormat].
185        #[unsafe(method(setSourceAudioFormat:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setSourceAudioFormat(
188            &self,
189            source_audio_format: Option<&CMAudioFormatDescription>,
190        );
191
192        #[cfg(feature = "objc2-core-media")]
193        /// A CMVideoFormatDescription object describing the format of your video data
194        ///
195        /// 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.
196        ///
197        /// 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.
198        #[unsafe(method(sourceVideoFormat))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn sourceVideoFormat(&self) -> Option<Retained<CMVideoFormatDescription>>;
201
202        #[cfg(feature = "objc2-core-media")]
203        /// Setter for [`sourceVideoFormat`][Self::sourceVideoFormat].
204        #[unsafe(method(setSourceVideoFormat:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn setSourceVideoFormat(
207            &self,
208            source_video_format: Option<&CMVideoFormatDescription>,
209        );
210
211        #[cfg(feature = "objc2-core-media")]
212        /// A CMTime describing the average frame duration (reciprocal of average frame rate) of your video data
213        ///
214        /// 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.
215        ///
216        /// The default value is 1/30, which means that the receiver is assuming that your source video has an average frame rate of 30fps.
217        ///
218        /// It is an error to set this property to a value that is not positive or not numeric.  See CMTIME_IS_NUMERIC.
219        #[unsafe(method(sourceVideoAverageFrameDuration))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn sourceVideoAverageFrameDuration(&self) -> CMTime;
222
223        #[cfg(feature = "objc2-core-media")]
224        /// Setter for [`sourceVideoAverageFrameDuration`][Self::sourceVideoAverageFrameDuration].
225        #[unsafe(method(setSourceVideoAverageFrameDuration:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn setSourceVideoAverageFrameDuration(
228            &self,
229            source_video_average_frame_duration: CMTime,
230        );
231
232        #[cfg(feature = "objc2-core-media")]
233        /// A CMTime describing the minimum frame duration (reciprocal of the maximum frame rate) of your video data
234        ///
235        /// 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.
236        ///
237        /// 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.
238        ///
239        /// The default value is 1/30, which means that the receiver is assuming that your source video has a maximum frame rate of 30fps.
240        ///
241        /// It is an error to set this property to a value that is not positive or not numeric.  See CMTIME_IS_NUMERIC.
242        #[unsafe(method(sourceVideoMinFrameDuration))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn sourceVideoMinFrameDuration(&self) -> CMTime;
245
246        #[cfg(feature = "objc2-core-media")]
247        /// Setter for [`sourceVideoMinFrameDuration`][Self::sourceVideoMinFrameDuration].
248        #[unsafe(method(setSourceVideoMinFrameDuration:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setSourceVideoMinFrameDuration(
251            &self,
252            source_video_min_frame_duration: CMTime,
253        );
254    );
255}