objc2_av_foundation/generated/AVMovie.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 "C" {
15 /// Indicates the restrictions used by the movie when resolving references to external media data. The value of this key is an NSNumber wrapping an AVAssetReferenceRestrictions enum value or the logical combination of multiple such values. See AVAsset.h for the declaration of the AVAssetReferenceRestrictions enum.
16 ///
17 /// Some movies can contain references to media data stored outside the movie's container, for example in another file. This key can be used to specify a policy to use when these references are encountered. If a movie contains one or more references of a type that is forbidden by the reference restrictions, loading of movie properties will fail. In addition, such a movie cannot be used with other AVFoundation modules, such as AVPlayerItem or AVAssetExportSession.
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmoviereferencerestrictionskey?language=objc)
20 pub static AVMovieReferenceRestrictionsKey: &'static NSString;
21}
22
23extern "C" {
24 /// Indicates whether alias data references in the movie should be parsed and resolved.
25 ///
26 /// Default is NO. Although the majority of QuickTime movie files contain all of the media data they require, some contain references to media stored in other files. While AVFoundation and CoreMedia typically employ a URL reference for this purpose, older implementations such as QuickTime 7 have commonly employed a Macintosh alias instead, as documented in the QuickTime File Format specification. If your application must work with legacy QuickTime movie files containing alias-based references to media data stored in other files, the use of this AVMovie initialization option is appropriate. AVMovie and AVMutableMovie do not create movies using alias data references to external media files.
27 ///
28 /// If you provide a value for AVMovieReferenceRestrictionsKey, restrictions will be observed for resolved alias references just as they are for URL references.
29 ///
30 /// For more details about alias resolution, consult documentation of the bookmark-related interfaces of NSURL.
31 ///
32 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmovieshouldsupportaliasdatareferenceskey?language=objc)
33 pub static AVMovieShouldSupportAliasDataReferencesKey: &'static NSString;
34}
35
36extern_class!(
37 /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmovie?language=objc)
38 #[unsafe(super(AVAsset, NSObject))]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 #[cfg(feature = "AVAsset")]
41 pub struct AVMovie;
42);
43
44#[cfg(all(feature = "AVAsset", feature = "AVAsynchronousKeyValueLoading"))]
45extern_conformance!(
46 unsafe impl AVAsynchronousKeyValueLoading for AVMovie {}
47);
48
49#[cfg(feature = "AVAsset")]
50extern_conformance!(
51 unsafe impl NSCopying for AVMovie {}
52);
53
54#[cfg(feature = "AVAsset")]
55unsafe impl CopyingHelper for AVMovie {
56 type Result = Self;
57}
58
59#[cfg(feature = "AVAsset")]
60extern_conformance!(
61 unsafe impl NSMutableCopying for AVMovie {}
62);
63
64#[cfg(feature = "AVAsset")]
65unsafe impl MutableCopyingHelper for AVMovie {
66 type Result = AVMutableMovie;
67}
68
69#[cfg(feature = "AVAsset")]
70extern_conformance!(
71 unsafe impl NSObjectProtocol for AVMovie {}
72);
73
74#[cfg(feature = "AVAsset")]
75impl AVMovie {
76 extern_methods!(
77 #[cfg(feature = "AVMediaFormat")]
78 /// Provides the file types the AVMovie class understands.
79 ///
80 /// Returns: An NSArray of UTIs identifying the file types the AVMovie class understands.
81 #[unsafe(method(movieTypes))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn movieTypes() -> Retained<NSArray<AVFileType>>;
84
85 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
86 ///
87 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
88 ///
89 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
90 ///
91 /// Returns: An AVMovie object
92 ///
93 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
94 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
95 /// to indicate where the sample data should be written.
96 ///
97 /// # Safety
98 ///
99 /// `options` generic should be of the correct type.
100 #[unsafe(method(movieWithURL:options:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn movieWithURL_options(
103 url: &NSURL,
104 options: Option<&NSDictionary<NSString, AnyObject>>,
105 ) -> Retained<Self>;
106
107 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
108 ///
109 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
110 ///
111 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
112 ///
113 /// Returns: An AVMovie object
114 ///
115 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
116 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
117 /// to indicate where the sample data should be written.
118 ///
119 /// # Safety
120 ///
121 /// `options` generic should be of the correct type.
122 #[unsafe(method(initWithURL:options:))]
123 #[unsafe(method_family = init)]
124 pub unsafe fn initWithURL_options(
125 this: Allocated<Self>,
126 url: &NSURL,
127 options: Option<&NSDictionary<NSString, AnyObject>>,
128 ) -> Retained<Self>;
129
130 /// Creates an AVMovie object from a movie header stored in an NSData object.
131 ///
132 /// Parameter `data`: An NSData object containing a movie header.
133 ///
134 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
135 ///
136 /// Returns: An AVMovie object
137 ///
138 /// You can use this method to operate on movie headers that are not stored in files; this might include movie headers on the pasteboard (which do not contain media data). In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
139 /// If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
140 ///
141 /// # Safety
142 ///
143 /// `options` generic should be of the correct type.
144 #[unsafe(method(movieWithData:options:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn movieWithData_options(
147 data: &NSData,
148 options: Option<&NSDictionary<NSString, AnyObject>>,
149 ) -> Retained<Self>;
150
151 /// Creates an AVMovie object from a movie header stored in an NSData object.
152 ///
153 /// Parameter `data`: An NSData object containing a movie header.
154 ///
155 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
156 ///
157 /// Returns: An AVMovie object
158 ///
159 /// You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
160 ///
161 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
162 ///
163 /// # Safety
164 ///
165 /// `options` generic should be of the correct type.
166 #[unsafe(method(initWithData:options:))]
167 #[unsafe(method_family = init)]
168 pub unsafe fn initWithData_options(
169 this: Allocated<Self>,
170 data: &NSData,
171 options: Option<&NSDictionary<NSString, AnyObject>>,
172 ) -> Retained<Self>;
173
174 /// The URL with which the instance of AVMovie was initialized; may be nil.
175 #[unsafe(method(URL))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
178
179 /// The data block with which the instance of AVMovie was initialized; may be nil.
180 #[unsafe(method(data))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn data(&self) -> Option<Retained<NSData>>;
183
184 /// The default storage container for media data added to a movie.
185 ///
186 /// The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written by default.
187 #[unsafe(method(defaultMediaDataStorage))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn defaultMediaDataStorage(&self) -> Option<Retained<AVMediaDataStorage>>;
190
191 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
192 /// The tracks in a movie.
193 ///
194 /// The value of this property is an array of tracks the movie contains; the tracks are of type AVMovieTrack.
195 #[unsafe(method(tracks))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn tracks(&self) -> Retained<NSArray<AVMovieTrack>>;
198
199 /// Indicates whether the movie file is capable of being extended by fragments.
200 ///
201 /// The value of this property is YES if an 'mvex' box is present in the 'moov' box. The 'mvex' box is necessary in order to signal the possible presence of later 'moof' boxes.
202 #[unsafe(method(canContainMovieFragments))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn canContainMovieFragments(&self) -> bool;
205
206 /// Indicates whether the movie file is extended by at least one movie fragment.
207 ///
208 /// The value of this property is YES if canContainMovieFragments is YES and at least one 'moof' box is present after the 'moov' box.
209 #[unsafe(method(containsMovieFragments))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn containsMovieFragments(&self) -> bool;
212 );
213}
214
215/// Methods declared on superclass `AVAsset`.
216#[cfg(feature = "AVAsset")]
217impl AVMovie {
218 extern_methods!(
219 /// Returns an instance of AVAsset for inspection of a media resource.
220 ///
221 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
222 ///
223 /// - Parameter URL: An instance of NSURL that references a media resource.
224 ///
225 /// - Returns: An instance of AVAsset.
226 #[unsafe(method(assetWithURL:))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
229 );
230}
231
232/// Methods declared on superclass `NSObject`.
233#[cfg(feature = "AVAsset")]
234impl AVMovie {
235 extern_methods!(
236 #[unsafe(method(init))]
237 #[unsafe(method_family = init)]
238 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
239
240 #[unsafe(method(new))]
241 #[unsafe(method_family = new)]
242 pub unsafe fn new() -> Retained<Self>;
243 );
244}
245
246/// These options can be passed into writeMovieHeaderToURL:fileType:options:error: to control the writing of a movie header to a destination URL.
247///
248/// Writing the movie header will remove any existing movie header in the destination file and add a new movie header, preserving any other data in the file. If the destination file was empty, a file type box will be written at the beginning of the file.
249///
250/// If set, writing the movie header will truncate all existing data in the destination file and write a new movie header, thereby creating a pure reference movie file. A file type box will be written at the beginning of the file.
251///
252/// You would not want to use the AVMovieWritingTruncateDestinationToMovieHeaderOnly option if you had written sample data to the destination file using (for example) -[AVMutableMovie insertTimeRange:ofAsset:atTime:copySampleData:error:] with copySampleData set to YES, since that data would be lost.
253///
254/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmoviewritingoptions?language=objc)
255// NS_OPTIONS
256#[repr(transparent)]
257#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
258pub struct AVMovieWritingOptions(pub NSUInteger);
259bitflags::bitflags! {
260 impl AVMovieWritingOptions: NSUInteger {
261 #[doc(alias = "AVMovieWritingAddMovieHeaderToDestination")]
262 const AddMovieHeaderToDestination = 0;
263 #[doc(alias = "AVMovieWritingTruncateDestinationToMovieHeaderOnly")]
264 const TruncateDestinationToMovieHeaderOnly = 1<<0;
265 }
266}
267
268unsafe impl Encode for AVMovieWritingOptions {
269 const ENCODING: Encoding = NSUInteger::ENCODING;
270}
271
272unsafe impl RefEncode for AVMovieWritingOptions {
273 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
274}
275
276/// AVMovieMovieHeaderSupport.
277#[cfg(feature = "AVAsset")]
278impl AVMovie {
279 extern_methods!(
280 #[cfg(feature = "AVMediaFormat")]
281 /// Creates an NSData object containing the movie header of the AVMovie object.
282 ///
283 /// Parameter `fileType`: A UTI indicating the specific file format of the movie header (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
284 ///
285 /// Parameter `outError`: If an error occurs reading the movie header, describes the nature of the failure.
286 ///
287 /// Returns: An NSData object.
288 ///
289 /// The movie header will be a pure reference movie, with no base URL, suitable for use on the pasteboard.
290 #[unsafe(method(movieHeaderWithFileType:error:_))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn movieHeaderWithFileType_error(
293 &self,
294 file_type: &AVFileType,
295 ) -> Result<Retained<NSData>, Retained<NSError>>;
296
297 #[cfg(feature = "AVMediaFormat")]
298 /// Writes the movie header to a destination URL.
299 ///
300 /// Parameter `URL`: An NSURL object indicating where to write the movie header.
301 ///
302 /// Parameter `fileType`: A UTI indicating the specific file format (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
303 ///
304 /// Parameter `options`: An NSUInteger whose bits specify options for the writing of the movie header. See AVMovieWritingOptions above.
305 ///
306 /// Parameter `outError`: If an error occurs writing the movie header, describes the nature of the failure.
307 ///
308 /// Note that modifications to instances of AVMutableMovie, to their constituent AVMutableMovieTracks, or to their collections of metadata are committed to storage when their movie headers are written.
309 #[unsafe(method(writeMovieHeaderToURL:fileType:options:error:_))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn writeMovieHeaderToURL_fileType_options_error(
312 &self,
313 url: &NSURL,
314 file_type: &AVFileType,
315 options: AVMovieWritingOptions,
316 ) -> Result<(), Retained<NSError>>;
317
318 #[cfg(feature = "AVMediaFormat")]
319 /// Indicates whether a movie header for the AVMovie object can be created for the specified file type.
320 ///
321 /// Parameter `fileType`: A UTI indicating a movie file format (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
322 ///
323 /// This method returns a BOOL that indicates whether a movie header of the specified type can be created for the receiver. For example, this method returns NO if the movie contains tracks whose media types or media subtypes are not allowed by the specified file type.
324 #[unsafe(method(isCompatibleWithFileType:))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn isCompatibleWithFileType(&self, file_type: &AVFileType) -> bool;
327 );
328}
329
330/// AVMovieTrackInspection.
331#[cfg(feature = "AVAsset")]
332impl AVMovie {
333 extern_methods!(
334 #[cfg(all(
335 feature = "AVAssetTrack",
336 feature = "AVMovieTrack",
337 feature = "objc2-core-media"
338 ))]
339 /// Provides an instance of AVMovieTrack that represents the track of the specified trackID.
340 ///
341 /// Parameter `trackID`: The trackID of the requested AVMovieTrack.
342 ///
343 /// Returns: An instance of AVMovieTrack; may be nil if no track of the specified trackID is available.
344 ///
345 /// Becomes callable without blocking when the key
346 /// "
347 /// tracks" has been loaded
348 #[deprecated = "Use loadTrackWithTrackID:completionHandler: instead"]
349 #[unsafe(method(trackWithTrackID:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn trackWithTrackID(
352 &self,
353 track_id: CMPersistentTrackID,
354 ) -> Option<Retained<AVMovieTrack>>;
355
356 #[cfg(all(
357 feature = "AVAssetTrack",
358 feature = "AVMovieTrack",
359 feature = "block2",
360 feature = "objc2-core-media"
361 ))]
362 /// Loads an instance of AVMovieTrack that represents the track of the specified trackID.
363 ///
364 /// Parameter `trackID`: The trackID of the requested AVMovieTrack.
365 ///
366 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.
367 ///
368 /// # Safety
369 ///
370 /// `completion_handler` block must be sendable.
371 #[unsafe(method(loadTrackWithTrackID:completionHandler:))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn loadTrackWithTrackID_completionHandler(
374 &self,
375 track_id: CMPersistentTrackID,
376 completion_handler: &block2::DynBlock<dyn Fn(*mut AVMovieTrack, *mut NSError)>,
377 );
378
379 #[cfg(all(
380 feature = "AVAssetTrack",
381 feature = "AVMediaFormat",
382 feature = "AVMovieTrack"
383 ))]
384 /// Provides an array of AVMovieTracks of the asset that present media of the specified media type.
385 ///
386 /// Parameter `mediaType`: The media type according to which the receiver filters its AVMovieTracks. (Media types are defined in AVMediaFormat.h)
387 ///
388 /// Returns: An NSArray of AVMovieTracks; may be empty if no tracks of the specified media type are available.
389 ///
390 /// Becomes callable without blocking when the key
391 /// "
392 /// tracks" has been loaded
393 #[deprecated = "Use loadTracksWithMediaType:completionHandler: instead"]
394 #[unsafe(method(tracksWithMediaType:))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn tracksWithMediaType(
397 &self,
398 media_type: &AVMediaType,
399 ) -> Retained<NSArray<AVMovieTrack>>;
400
401 #[cfg(all(
402 feature = "AVAssetTrack",
403 feature = "AVMediaFormat",
404 feature = "AVMovieTrack",
405 feature = "block2"
406 ))]
407 /// Loads an array of AVMovieTracks of the asset that present media of the specified media type.
408 ///
409 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVMovieTracks. (Media types are defined in AVMediaFormat.h.)
410 ///
411 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.
412 ///
413 /// # Safety
414 ///
415 /// `completion_handler` block must be sendable.
416 #[unsafe(method(loadTracksWithMediaType:completionHandler:))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn loadTracksWithMediaType_completionHandler(
419 &self,
420 media_type: &AVMediaType,
421 completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>,
422 );
423
424 #[cfg(all(
425 feature = "AVAssetTrack",
426 feature = "AVMediaFormat",
427 feature = "AVMovieTrack"
428 ))]
429 /// Provides an array of AVMovieTracks of the asset that present media with the specified characteristic.
430 ///
431 /// Parameter `mediaCharacteristic`: The media characteristic according to which the receiver filters its AVMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
432 ///
433 /// Returns: An NSArray of AVMovieTracks; may be empty if no tracks with the specified characteristic are available.
434 ///
435 /// Becomes callable without blocking when the key
436 /// "
437 /// tracks" has been loaded
438 #[deprecated = "Use loadTracksWithMediaCharacteristic:completionHandler: instead"]
439 #[unsafe(method(tracksWithMediaCharacteristic:))]
440 #[unsafe(method_family = none)]
441 pub unsafe fn tracksWithMediaCharacteristic(
442 &self,
443 media_characteristic: &AVMediaCharacteristic,
444 ) -> Retained<NSArray<AVMovieTrack>>;
445
446 #[cfg(all(
447 feature = "AVAssetTrack",
448 feature = "AVMediaFormat",
449 feature = "AVMovieTrack",
450 feature = "block2"
451 ))]
452 /// Loads an array of AVMovieTracks of the asset that present media with the specified characteristic.
453 ///
454 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVMovieTracks. (Media characteristics are defined in AVMediaFormat.h.)
455 ///
456 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.
457 ///
458 /// # Safety
459 ///
460 /// `completion_handler` block must be sendable.
461 #[unsafe(method(loadTracksWithMediaCharacteristic:completionHandler:))]
462 #[unsafe(method_family = none)]
463 pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
464 &self,
465 media_characteristic: &AVMediaCharacteristic,
466 completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>,
467 );
468 );
469}
470
471extern_class!(
472 /// AVMutableMovie adds to its immutable superclass, AVMovie, several categories of methods for editing QuickTime movie files, e.g. inserting and removing time ranges of media, adding and removing tracks, and modifying the metadata collections stored therein.
473 ///
474 ///
475 /// By default, after creating an AVMutableMovie the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
476 ///
477 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutablemovie?language=objc)
478 #[unsafe(super(AVMovie, AVAsset, NSObject))]
479 #[derive(Debug, PartialEq, Eq, Hash)]
480 #[cfg(feature = "AVAsset")]
481 pub struct AVMutableMovie;
482);
483
484#[cfg(all(feature = "AVAsset", feature = "AVAsynchronousKeyValueLoading"))]
485extern_conformance!(
486 unsafe impl AVAsynchronousKeyValueLoading for AVMutableMovie {}
487);
488
489#[cfg(feature = "AVAsset")]
490extern_conformance!(
491 unsafe impl NSCopying for AVMutableMovie {}
492);
493
494#[cfg(feature = "AVAsset")]
495unsafe impl CopyingHelper for AVMutableMovie {
496 type Result = AVMovie;
497}
498
499#[cfg(feature = "AVAsset")]
500extern_conformance!(
501 unsafe impl NSMutableCopying for AVMutableMovie {}
502);
503
504#[cfg(feature = "AVAsset")]
505unsafe impl MutableCopyingHelper for AVMutableMovie {
506 type Result = Self;
507}
508
509#[cfg(feature = "AVAsset")]
510extern_conformance!(
511 unsafe impl NSObjectProtocol for AVMutableMovie {}
512);
513
514#[cfg(feature = "AVAsset")]
515impl AVMutableMovie {
516 extern_methods!(
517 /// Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
518 ///
519 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
520 ///
521 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
522 ///
523 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
524 ///
525 /// Returns: An AVMutableMovie object
526 ///
527 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil.
528 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
529 /// to indicate where the sample data should be written.
530 ///
531 /// # Safety
532 ///
533 /// `options` generic should be of the correct type.
534 #[unsafe(method(movieWithURL:options:error:_))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn movieWithURL_options_error(
537 url: &NSURL,
538 options: Option<&NSDictionary<NSString, AnyObject>>,
539 ) -> Result<Retained<Self>, Retained<NSError>>;
540
541 /// Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
542 ///
543 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
544 ///
545 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
546 ///
547 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
548 ///
549 /// Returns: An AVMutableMovie object
550 ///
551 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil.
552 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
553 /// to indicate where the sample data should be written.
554 ///
555 /// # Safety
556 ///
557 /// `options` generic should be of the correct type.
558 #[unsafe(method(initWithURL:options:error:_))]
559 #[unsafe(method_family = init)]
560 pub unsafe fn initWithURL_options_error(
561 this: Allocated<Self>,
562 url: &NSURL,
563 options: Option<&NSDictionary<NSString, AnyObject>>,
564 ) -> Result<Retained<Self>, Retained<NSError>>;
565
566 /// Creates an AVMutableMovie object from a movie header stored in an NSData object.
567 ///
568 /// Parameter `data`: An NSData object containing a movie header.
569 ///
570 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
571 ///
572 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
573 ///
574 /// Returns: An AVMutableMovie object
575 ///
576 /// You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
577 ///
578 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
579 ///
580 /// # Safety
581 ///
582 /// `options` generic should be of the correct type.
583 #[unsafe(method(movieWithData:options:error:_))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn movieWithData_options_error(
586 data: &NSData,
587 options: Option<&NSDictionary<NSString, AnyObject>>,
588 ) -> Result<Retained<Self>, Retained<NSError>>;
589
590 /// Creates an AVMutableMovie object from a movie header stored in an NSData object.
591 ///
592 /// Parameter `data`: An NSData object containing a movie header.
593 ///
594 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
595 ///
596 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
597 ///
598 /// Returns: An AVMutableMovie object
599 ///
600 /// You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
601 ///
602 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
603 ///
604 /// # Safety
605 ///
606 /// `options` generic should be of the correct type.
607 #[unsafe(method(initWithData:options:error:_))]
608 #[unsafe(method_family = init)]
609 pub unsafe fn initWithData_options_error(
610 this: Allocated<Self>,
611 data: &NSData,
612 options: Option<&NSDictionary<NSString, AnyObject>>,
613 ) -> Result<Retained<Self>, Retained<NSError>>;
614
615 /// Creates an AVMutableMovie object without tracks (and therefore without media).
616 ///
617 /// Parameter `movie`: If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
618 ///
619 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Pass nil for default initialization behavior.
620 ///
621 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
622 ///
623 /// Returns: An AVMutableMovie object
624 ///
625 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
626 /// If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
627 ///
628 /// # Safety
629 ///
630 /// `options` generic should be of the correct type.
631 #[unsafe(method(movieWithSettingsFromMovie:options:error:_))]
632 #[unsafe(method_family = none)]
633 pub unsafe fn movieWithSettingsFromMovie_options_error(
634 movie: Option<&AVMovie>,
635 options: Option<&NSDictionary<NSString, AnyObject>>,
636 ) -> Result<Retained<Self>, Retained<NSError>>;
637
638 /// Creates an AVMutableMovie object without tracks (and therefore without media).
639 ///
640 /// Parameter `movie`: If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
641 ///
642 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Pass nil for default initialization behavior.
643 ///
644 /// Parameter `outError`: If an error occurs creating a movie, describes the nature of the failure.
645 ///
646 /// Returns: An AVMutableMovie object
647 ///
648 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
649 /// If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
650 ///
651 /// # Safety
652 ///
653 /// `options` generic should be of the correct type.
654 #[unsafe(method(initWithSettingsFromMovie:options:error:_))]
655 #[unsafe(method_family = init)]
656 pub unsafe fn initWithSettingsFromMovie_options_error(
657 this: Allocated<Self>,
658 movie: Option<&AVMovie>,
659 options: Option<&NSDictionary<NSString, AnyObject>>,
660 ) -> Result<Retained<Self>, Retained<NSError>>;
661
662 /// The natural rate at which the movie is to be played; often but not always 1.0.
663 #[unsafe(method(preferredRate))]
664 #[unsafe(method_family = none)]
665 pub unsafe fn preferredRate(&self) -> c_float;
666
667 /// Setter for [`preferredRate`][Self::preferredRate].
668 #[unsafe(method(setPreferredRate:))]
669 #[unsafe(method_family = none)]
670 pub unsafe fn setPreferredRate(&self, preferred_rate: c_float);
671
672 /// The preferred volume of the audible media data of the movie; often but not always 1.0.
673 #[unsafe(method(preferredVolume))]
674 #[unsafe(method_family = none)]
675 pub unsafe fn preferredVolume(&self) -> c_float;
676
677 /// Setter for [`preferredVolume`][Self::preferredVolume].
678 #[unsafe(method(setPreferredVolume:))]
679 #[unsafe(method_family = none)]
680 pub unsafe fn setPreferredVolume(&self, preferred_volume: c_float);
681
682 #[cfg(feature = "objc2-core-foundation")]
683 /// A CGAffineTransform indicating the transform specified in the movie's storage container as the preferred transformation of the visual media data for display purposes; the value is often but not always CGAffineTransformIdentity.
684 #[unsafe(method(preferredTransform))]
685 #[unsafe(method_family = none)]
686 pub unsafe fn preferredTransform(&self) -> CGAffineTransform;
687
688 #[cfg(feature = "objc2-core-foundation")]
689 /// Setter for [`preferredTransform`][Self::preferredTransform].
690 #[unsafe(method(setPreferredTransform:))]
691 #[unsafe(method_family = none)]
692 pub unsafe fn setPreferredTransform(&self, preferred_transform: CGAffineTransform);
693
694 #[cfg(feature = "objc2-core-media")]
695 /// For file types that contain a 'moov' atom, such as QuickTime Movie files, specifies the time scale of the movie.
696 ///
697 /// The default movie time scale is 600. In certain cases, you may want to set this to a different value. For instance, a movie that
698 /// contains a single audio track should typically have the movie time scale set to the media time scale of that track.
699 ///
700 /// This property should be set on a new empty movie before any edits are performed on the movie.
701 #[unsafe(method(timescale))]
702 #[unsafe(method_family = none)]
703 pub unsafe fn timescale(&self) -> CMTimeScale;
704
705 #[cfg(feature = "objc2-core-media")]
706 /// Setter for [`timescale`][Self::timescale].
707 #[unsafe(method(setTimescale:))]
708 #[unsafe(method_family = none)]
709 pub unsafe fn setTimescale(&self, timescale: CMTimeScale);
710
711 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
712 /// The tracks in a mutable movie.
713 ///
714 /// The value of this property is an array of tracks the mutable movie contains; the tracks are of type AVMutableMovieTrack.
715 #[unsafe(method(tracks))]
716 #[unsafe(method_family = none)]
717 pub unsafe fn tracks(&self) -> Retained<NSArray<AVMutableMovieTrack>>;
718 );
719}
720
721/// Methods declared on superclass `AVMovie`.
722#[cfg(feature = "AVAsset")]
723impl AVMutableMovie {
724 extern_methods!(
725 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
726 ///
727 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
728 ///
729 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
730 ///
731 /// Returns: An AVMovie object
732 ///
733 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
734 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
735 /// to indicate where the sample data should be written.
736 ///
737 /// # Safety
738 ///
739 /// `options` generic should be of the correct type.
740 #[unsafe(method(movieWithURL:options:))]
741 #[unsafe(method_family = none)]
742 pub unsafe fn movieWithURL_options(
743 url: &NSURL,
744 options: Option<&NSDictionary<NSString, AnyObject>>,
745 ) -> Retained<Self>;
746
747 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
748 ///
749 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
750 ///
751 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
752 ///
753 /// Returns: An AVMovie object
754 ///
755 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
756 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
757 /// to indicate where the sample data should be written.
758 ///
759 /// # Safety
760 ///
761 /// `options` generic should be of the correct type.
762 #[unsafe(method(initWithURL:options:))]
763 #[unsafe(method_family = init)]
764 pub unsafe fn initWithURL_options(
765 this: Allocated<Self>,
766 url: &NSURL,
767 options: Option<&NSDictionary<NSString, AnyObject>>,
768 ) -> Retained<Self>;
769
770 /// Creates an AVMovie object from a movie header stored in an NSData object.
771 ///
772 /// Parameter `data`: An NSData object containing a movie header.
773 ///
774 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
775 ///
776 /// Returns: An AVMovie object
777 ///
778 /// You can use this method to operate on movie headers that are not stored in files; this might include movie headers on the pasteboard (which do not contain media data). In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
779 /// If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
780 ///
781 /// # Safety
782 ///
783 /// `options` generic should be of the correct type.
784 #[unsafe(method(movieWithData:options:))]
785 #[unsafe(method_family = none)]
786 pub unsafe fn movieWithData_options(
787 data: &NSData,
788 options: Option<&NSDictionary<NSString, AnyObject>>,
789 ) -> Retained<Self>;
790
791 /// Creates an AVMovie object from a movie header stored in an NSData object.
792 ///
793 /// Parameter `data`: An NSData object containing a movie header.
794 ///
795 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
796 ///
797 /// Returns: An AVMovie object
798 ///
799 /// You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
800 ///
801 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
802 ///
803 /// # Safety
804 ///
805 /// `options` generic should be of the correct type.
806 #[unsafe(method(initWithData:options:))]
807 #[unsafe(method_family = init)]
808 pub unsafe fn initWithData_options(
809 this: Allocated<Self>,
810 data: &NSData,
811 options: Option<&NSDictionary<NSString, AnyObject>>,
812 ) -> Retained<Self>;
813 );
814}
815
816/// Methods declared on superclass `AVAsset`.
817#[cfg(feature = "AVAsset")]
818impl AVMutableMovie {
819 extern_methods!(
820 /// Returns an instance of AVAsset for inspection of a media resource.
821 ///
822 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
823 ///
824 /// - Parameter URL: An instance of NSURL that references a media resource.
825 ///
826 /// - Returns: An instance of AVAsset.
827 #[unsafe(method(assetWithURL:))]
828 #[unsafe(method_family = none)]
829 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
830 );
831}
832
833/// Methods declared on superclass `NSObject`.
834#[cfg(feature = "AVAsset")]
835impl AVMutableMovie {
836 extern_methods!(
837 #[unsafe(method(init))]
838 #[unsafe(method_family = init)]
839 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
840
841 #[unsafe(method(new))]
842 #[unsafe(method_family = new)]
843 pub unsafe fn new() -> Retained<Self>;
844 );
845}
846
847/// AVMutableMovieMovieLevelEditing.
848#[cfg(feature = "AVAsset")]
849impl AVMutableMovie {
850 extern_methods!(
851 /// Whether a movie has been modified.
852 ///
853 /// The value of this property is a BOOL that indicates whether the AVMutableMovie object has been modified since it was created, was last written, or had its modified state cleared via a call to setModified:NO.
854 #[unsafe(method(isModified))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn isModified(&self) -> bool;
857
858 /// Setter for [`isModified`][Self::isModified].
859 #[unsafe(method(setModified:))]
860 #[unsafe(method_family = none)]
861 pub unsafe fn setModified(&self, modified: bool);
862
863 /// The default storage container for media data added to a movie.
864 ///
865 /// The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written, for any track for whose mediaDataStorage property is nil.
866 #[unsafe(method(defaultMediaDataStorage))]
867 #[unsafe(method_family = none)]
868 pub unsafe fn defaultMediaDataStorage(&self) -> Option<Retained<AVMediaDataStorage>>;
869
870 /// Setter for [`defaultMediaDataStorage`][Self::defaultMediaDataStorage].
871 ///
872 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
873 #[unsafe(method(setDefaultMediaDataStorage:))]
874 #[unsafe(method_family = none)]
875 pub unsafe fn setDefaultMediaDataStorage(
876 &self,
877 default_media_data_storage: Option<&AVMediaDataStorage>,
878 );
879
880 #[cfg(feature = "objc2-core-media")]
881 /// A CMTime that indicates the duration for interleaving runs of samples of each track.
882 ///
883 /// The default interleaving period is 0.5 seconds.
884 #[unsafe(method(interleavingPeriod))]
885 #[unsafe(method_family = none)]
886 pub unsafe fn interleavingPeriod(&self) -> CMTime;
887
888 #[cfg(feature = "objc2-core-media")]
889 /// Setter for [`interleavingPeriod`][Self::interleavingPeriod].
890 #[unsafe(method(setInterleavingPeriod:))]
891 #[unsafe(method_family = none)]
892 pub unsafe fn setInterleavingPeriod(&self, interleaving_period: CMTime);
893
894 #[cfg(feature = "objc2-core-media")]
895 /// Inserts all the tracks of a timeRange of an asset into a movie.
896 ///
897 /// Parameter `timeRange`: The time range of the asset to be inserted.
898 ///
899 /// Parameter `asset`: An AVAsset object indicating the source of the inserted media. Only instances of AVURLAsset and AVComposition are supported.
900 /// Must not be nil.
901 ///
902 /// Parameter `startTime`: The time in the target movie at which the media is to be inserted.
903 ///
904 /// Parameter `copySampleData`: A BOOL value that indicates whether sample data is to be copied from the source to the destination during edits.
905 /// If YES, the sample data is written to the location specified by the track property mediaDataStorage if non-nil,
906 /// or else by the movie property defaultMediaDataStorage if non-nil; if both are nil, the method will fail and return NO.
907 /// If NO, sample data will not be written and sample references to the samples in their original container will be added as necessary.
908 /// Note that in this case, this method will fail if the source AVAsset is not able to provide sample reference information for the original container.
909 ///
910 /// Parameter `outError`: If the insertion fails, an NSError object that describes the nature of the failure.
911 ///
912 /// Returns: A BOOL value that indicates the success of the insertion.
913 ///
914 /// This method may add new tracks to the target movie to ensure that all tracks of the asset are represented in the inserted timeRange.
915 /// Existing content at the specified startTime will be pushed out by the duration of timeRange.
916 /// Note that metadata will not be automatically copied.
917 #[unsafe(method(insertTimeRange:ofAsset:atTime:copySampleData:error:_))]
918 #[unsafe(method_family = none)]
919 pub unsafe fn insertTimeRange_ofAsset_atTime_copySampleData_error(
920 &self,
921 time_range: CMTimeRange,
922 asset: &AVAsset,
923 start_time: CMTime,
924 copy_sample_data: bool,
925 ) -> Result<(), Retained<NSError>>;
926
927 #[cfg(feature = "objc2-core-media")]
928 /// Adds an empty time range to the target movie.
929 ///
930 /// Parameter `timeRange`: The time range to be made empty. Note that you cannot add empty time ranges to the end of a movie.
931 #[unsafe(method(insertEmptyTimeRange:))]
932 #[unsafe(method_family = none)]
933 pub unsafe fn insertEmptyTimeRange(&self, time_range: CMTimeRange);
934
935 #[cfg(feature = "objc2-core-media")]
936 /// Removes a specified time range from a movie.
937 ///
938 /// Parameter `timeRange`: The time range to be removed.
939 #[unsafe(method(removeTimeRange:))]
940 #[unsafe(method_family = none)]
941 pub unsafe fn removeTimeRange(&self, time_range: CMTimeRange);
942
943 #[cfg(feature = "objc2-core-media")]
944 /// Changes the duration of a time range of a movie.
945 ///
946 /// Parameter `timeRange`: The time range to be scaled.
947 ///
948 /// Parameter `duration`: The new duration of the time range.
949 #[unsafe(method(scaleTimeRange:toDuration:))]
950 #[unsafe(method_family = none)]
951 pub unsafe fn scaleTimeRange_toDuration(&self, time_range: CMTimeRange, duration: CMTime);
952 );
953}
954
955/// AVMutableMovieTrackLevelEditing.
956#[cfg(feature = "AVAsset")]
957impl AVMutableMovie {
958 extern_methods!(
959 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
960 /// Provides a reference to a track of a mutable movie into which any time range of an AVAssetTrack
961 /// can be inserted (via -[AVMutableMovieTrack insertTimeRange:ofTrack:atTime:copySampleData:error:]).
962 ///
963 /// Parameter `track`: A reference to the AVAssetTrack from which a time range may be inserted.
964 ///
965 /// Returns: An AVMutableMovieTrack that can accommodate the insertion.
966 /// If no such track is available, the result is nil. A new track of the same media type
967 /// as the AVAssetTrack can be created via -addMutableTrackWithMediaType:copySettingsFromTrack:options:,
968 /// and this new track will be compatible.
969 ///
970 /// For best performance, the number of tracks in a movie should be kept to a minimum, corresponding to the
971 /// number for which media data must be presented in parallel. If media data of the same type is to be presented
972 /// serially, even from multiple assets, a single track of that media type should be used. This method,
973 /// -mutableTrackCompatibleWithTrack:, can help the client to identify an existing target track for an insertion.
974 #[unsafe(method(mutableTrackCompatibleWithTrack:))]
975 #[unsafe(method_family = none)]
976 pub unsafe fn mutableTrackCompatibleWithTrack(
977 &self,
978 track: &AVAssetTrack,
979 ) -> Option<Retained<AVMutableMovieTrack>>;
980
981 #[cfg(all(
982 feature = "AVAssetTrack",
983 feature = "AVMediaFormat",
984 feature = "AVMovieTrack"
985 ))]
986 /// Adds an empty track to the target movie.
987 ///
988 /// Parameter `mediaType`: The media type of the new track (e.g. AVMediaTypeVideo for a video track).
989 ///
990 /// Parameter `track`: If you wish to transfer settings from an existing track, including width, height, preferred volume, etc., pass a reference to an AVAssetTrack representing that track. Otherwise pass nil.
991 ///
992 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack object. Pass nil for default initialization behavior.
993 ///
994 /// Returns: An AVMutableMovieTrack object
995 ///
996 /// The trackID of the newly added track is a property of the returned instance of AVMutableMovieTrack.
997 /// This method throws an exception if media type is not equal to the track's media type, or if any option is invalid.
998 /// Note that metadata will not be automatically copied.
999 ///
1000 /// # Safety
1001 ///
1002 /// `options` generic should be of the correct type.
1003 #[unsafe(method(addMutableTrackWithMediaType:copySettingsFromTrack:options:))]
1004 #[unsafe(method_family = none)]
1005 pub unsafe fn addMutableTrackWithMediaType_copySettingsFromTrack_options(
1006 &self,
1007 media_type: &AVMediaType,
1008 track: Option<&AVAssetTrack>,
1009 options: Option<&NSDictionary<NSString, AnyObject>>,
1010 ) -> Option<Retained<AVMutableMovieTrack>>;
1011
1012 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
1013 /// Adds one or more empty tracks to the target movie, copying track settings from the source tracks.
1014 ///
1015 /// Parameter `existingTracks`: An array of AVAssetTrack objects.
1016 ///
1017 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack objects. Pass nil for default initialization behavior.
1018 ///
1019 /// Returns: An array of AVMutableMovieTrack objects; the index of a track in this array is the same as the index of its source track in the existingTracks array.
1020 ///
1021 /// This method creates one or more empty tracks in the target movie and configures those tracks with settings (such as track userdata and metadata, width, height, and preferred volume) copied from the source tracks in the existingTracks array. Also, properties involving pairs of tracks (such as track references) are copied from the source tracks to the target tracks.
1022 /// This method throws an exception if any option is invalid.
1023 ///
1024 /// # Safety
1025 ///
1026 /// `options` generic should be of the correct type.
1027 #[unsafe(method(addMutableTracksCopyingSettingsFromTracks:options:))]
1028 #[unsafe(method_family = none)]
1029 pub unsafe fn addMutableTracksCopyingSettingsFromTracks_options(
1030 &self,
1031 existing_tracks: &NSArray<AVAssetTrack>,
1032 options: Option<&NSDictionary<NSString, AnyObject>>,
1033 ) -> Retained<NSArray<AVMutableMovieTrack>>;
1034
1035 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
1036 /// Removes a track from the target movie.
1037 ///
1038 /// Parameter `track`: The track to be removed.
1039 #[unsafe(method(removeTrack:))]
1040 #[unsafe(method_family = none)]
1041 pub unsafe fn removeTrack(&self, track: &AVMovieTrack);
1042 );
1043}
1044
1045/// AVMutableMovieMetadataEditing.
1046#[cfg(feature = "AVAsset")]
1047impl AVMutableMovie {
1048 extern_methods!(
1049 #[cfg(feature = "AVMetadataItem")]
1050 /// A collection of metadata stored by the movie.
1051 ///
1052 /// The value of this property is an array of AVMetadataItem objects representing the collection of metadata stored by the movie.
1053 #[unsafe(method(metadata))]
1054 #[unsafe(method_family = none)]
1055 pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>;
1056
1057 #[cfg(feature = "AVMetadataItem")]
1058 /// Setter for [`metadata`][Self::metadata].
1059 ///
1060 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1061 #[unsafe(method(setMetadata:))]
1062 #[unsafe(method_family = none)]
1063 pub unsafe fn setMetadata(&self, metadata: &NSArray<AVMetadataItem>);
1064 );
1065}
1066
1067/// AVMutableMovieTrackInspection.
1068#[cfg(feature = "AVAsset")]
1069impl AVMutableMovie {
1070 extern_methods!(
1071 #[cfg(all(
1072 feature = "AVAssetTrack",
1073 feature = "AVMovieTrack",
1074 feature = "objc2-core-media"
1075 ))]
1076 /// Provides an instance of AVMutableMovieTrack that represents the track of the specified trackID.
1077 ///
1078 /// Parameter `trackID`: The trackID of the requested AVMutableMovieTrack.
1079 ///
1080 /// Returns: An instance of AVMutableMovieTrack; may be nil if no track of the specified trackID is available.
1081 ///
1082 /// Becomes callable without blocking when the key
1083 /// "
1084 /// tracks" has been loaded
1085 #[unsafe(method(trackWithTrackID:))]
1086 #[unsafe(method_family = none)]
1087 pub unsafe fn trackWithTrackID(
1088 &self,
1089 track_id: CMPersistentTrackID,
1090 ) -> Option<Retained<AVMutableMovieTrack>>;
1091
1092 #[cfg(all(
1093 feature = "AVAssetTrack",
1094 feature = "AVMovieTrack",
1095 feature = "block2",
1096 feature = "objc2-core-media"
1097 ))]
1098 /// Loads an instance of AVMutableMovieTrack that represents the track of the specified trackID.
1099 ///
1100 /// Parameter `trackID`: The trackID of the requested AVMutableMovieTrack.
1101 ///
1102 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.
1103 ///
1104 /// # Safety
1105 ///
1106 /// `completion_handler` block must be sendable.
1107 #[unsafe(method(loadTrackWithTrackID:completionHandler:))]
1108 #[unsafe(method_family = none)]
1109 pub unsafe fn loadTrackWithTrackID_completionHandler(
1110 &self,
1111 track_id: CMPersistentTrackID,
1112 completion_handler: &block2::DynBlock<dyn Fn(*mut AVMutableMovieTrack, *mut NSError)>,
1113 );
1114
1115 #[cfg(all(
1116 feature = "AVAssetTrack",
1117 feature = "AVMediaFormat",
1118 feature = "AVMovieTrack"
1119 ))]
1120 /// Provides an array of AVMutableMovieTracks of the asset that present media of the specified media type.
1121 ///
1122 /// Parameter `mediaType`: The media type according to which the receiver filters its AVMutableMovieTracks. (Media types are defined in AVMediaFormat.h)
1123 ///
1124 /// Returns: An NSArray of AVMutableMovieTracks; may be empty if no tracks of the specified media type are available.
1125 ///
1126 /// Becomes callable without blocking when the key
1127 /// "
1128 /// tracks" has been loaded
1129 #[unsafe(method(tracksWithMediaType:))]
1130 #[unsafe(method_family = none)]
1131 pub unsafe fn tracksWithMediaType(
1132 &self,
1133 media_type: &AVMediaType,
1134 ) -> Retained<NSArray<AVMutableMovieTrack>>;
1135
1136 #[cfg(all(
1137 feature = "AVAssetTrack",
1138 feature = "AVMediaFormat",
1139 feature = "AVMovieTrack",
1140 feature = "block2"
1141 ))]
1142 /// Loads an array of AVMutableMovieTracks of the asset that present media of the specified media type.
1143 ///
1144 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVMutableMovieTracks. (Media types are defined in AVMediaFormat.h.)
1145 ///
1146 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.
1147 ///
1148 /// # Safety
1149 ///
1150 /// `completion_handler` block must be sendable.
1151 #[unsafe(method(loadTracksWithMediaType:completionHandler:))]
1152 #[unsafe(method_family = none)]
1153 pub unsafe fn loadTracksWithMediaType_completionHandler(
1154 &self,
1155 media_type: &AVMediaType,
1156 completion_handler: &block2::DynBlock<
1157 dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError),
1158 >,
1159 );
1160
1161 #[cfg(all(
1162 feature = "AVAssetTrack",
1163 feature = "AVMediaFormat",
1164 feature = "AVMovieTrack"
1165 ))]
1166 /// Provides an array of AVMutableMovieTracks of the asset that present media with the specified characteristic.
1167 ///
1168 /// Parameter `mediaCharacteristic`: The media characteristic according to which the receiver filters its AVMutableMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
1169 ///
1170 /// Returns: An NSArray of AVMutableMovieTracks; may be empty if no tracks with the specified characteristic are available.
1171 ///
1172 /// Becomes callable without blocking when the key
1173 /// "
1174 /// tracks" has been loaded
1175 #[unsafe(method(tracksWithMediaCharacteristic:))]
1176 #[unsafe(method_family = none)]
1177 pub unsafe fn tracksWithMediaCharacteristic(
1178 &self,
1179 media_characteristic: &AVMediaCharacteristic,
1180 ) -> Retained<NSArray<AVMutableMovieTrack>>;
1181
1182 #[cfg(all(
1183 feature = "AVAssetTrack",
1184 feature = "AVMediaFormat",
1185 feature = "AVMovieTrack",
1186 feature = "block2"
1187 ))]
1188 /// Loads an array of AVMutableMovieTracks of the asset that present media with the specified characteristic.
1189 ///
1190 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVMutableMovieTracks. (Media characteristics are defined in AVMediaFormat.h.)
1191 ///
1192 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.
1193 ///
1194 /// # Safety
1195 ///
1196 /// `completion_handler` block must be sendable.
1197 #[unsafe(method(loadTracksWithMediaCharacteristic:completionHandler:))]
1198 #[unsafe(method_family = none)]
1199 pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
1200 &self,
1201 media_characteristic: &AVMediaCharacteristic,
1202 completion_handler: &block2::DynBlock<
1203 dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError),
1204 >,
1205 );
1206 );
1207}
1208
1209extern_class!(
1210 /// Media sample data storage file.
1211 ///
1212 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
1213 ///
1214 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediadatastorage?language=objc)
1215 #[unsafe(super(NSObject))]
1216 #[derive(Debug, PartialEq, Eq, Hash)]
1217 pub struct AVMediaDataStorage;
1218);
1219
1220unsafe impl Send for AVMediaDataStorage {}
1221
1222unsafe impl Sync for AVMediaDataStorage {}
1223
1224extern_conformance!(
1225 unsafe impl NSObjectProtocol for AVMediaDataStorage {}
1226);
1227
1228impl AVMediaDataStorage {
1229 extern_methods!(
1230 #[unsafe(method(init))]
1231 #[unsafe(method_family = init)]
1232 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1233
1234 #[unsafe(method(new))]
1235 #[unsafe(method_family = new)]
1236 pub unsafe fn new() -> Retained<Self>;
1237
1238 /// Creates an AVMediaDataStorage object associated with a file URL.
1239 ///
1240 /// Parameter `URL`: An NSURL object that specifies a file where sample data that is added to a movie or track should be written.
1241 ///
1242 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMediaDataStorage object. Currently no keys are defined.
1243 ///
1244 /// Returns: An AVMediaDataStorage object
1245 ///
1246 /// # Safety
1247 ///
1248 /// `options` generic should be of the correct type.
1249 #[unsafe(method(initWithURL:options:))]
1250 #[unsafe(method_family = init)]
1251 pub unsafe fn initWithURL_options(
1252 this: Allocated<Self>,
1253 url: &NSURL,
1254 options: Option<&NSDictionary<NSString, AnyObject>>,
1255 ) -> Retained<Self>;
1256
1257 /// The URL from which the receiver was initialized; may be nil.
1258 #[unsafe(method(URL))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
1261 );
1262}
1263
1264extern "C" {
1265 /// Posted after the value of
1266 /// "
1267 /// containsMovieFragments" has already been loaded and the AVFragmentedMovie is added to an AVFragmentedMovieMinder, either when 1) movie fragments are detected in the movie file on disk after it had previously contained none or when 2) no movie fragments are detected in the movie file on disk after it had previously contained one or more.
1268 ///
1269 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmoviecontainsmoviefragmentsdidchangenotification?language=objc)
1270 pub static AVFragmentedMovieContainsMovieFragmentsDidChangeNotification: &'static NSString;
1271}
1272
1273extern "C" {
1274 /// Posted when the duration of an AVFragmentedMovie changes while it's being minded by an AVFragmentedMovieMinder, but only for changes that occur after the status of the value of
1275 /// "
1276 /// duration" has reached AVKeyValueStatusLoaded.
1277 ///
1278 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmoviedurationdidchangenotification?language=objc)
1279 pub static AVFragmentedMovieDurationDidChangeNotification: &'static NSString;
1280}
1281
1282extern "C" {
1283 /// Posted when the movie file on disk is defragmented while an AVFragmentedMovie is being minded by an AVFragmentedMovieMinder, but only if the defragmentation occurs after the status of the value of
1284 /// "
1285 /// canContainMovieFragments" has reached AVKeyValueStatusLoaded.
1286 ///
1287 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmoviewasdefragmentednotification?language=objc)
1288 pub static AVFragmentedMovieWasDefragmentedNotification: &'static NSString;
1289}
1290
1291extern_class!(
1292 /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovie?language=objc)
1293 #[unsafe(super(AVMovie, AVAsset, NSObject))]
1294 #[derive(Debug, PartialEq, Eq, Hash)]
1295 #[cfg(feature = "AVAsset")]
1296 pub struct AVFragmentedMovie;
1297);
1298
1299#[cfg(feature = "AVAsset")]
1300unsafe impl Send for AVFragmentedMovie {}
1301
1302#[cfg(feature = "AVAsset")]
1303unsafe impl Sync for AVFragmentedMovie {}
1304
1305#[cfg(all(feature = "AVAsset", feature = "AVAsynchronousKeyValueLoading"))]
1306extern_conformance!(
1307 unsafe impl AVAsynchronousKeyValueLoading for AVFragmentedMovie {}
1308);
1309
1310#[cfg(feature = "AVAsset")]
1311extern_conformance!(
1312 unsafe impl AVFragmentMinding for AVFragmentedMovie {}
1313);
1314
1315#[cfg(feature = "AVAsset")]
1316extern_conformance!(
1317 unsafe impl NSObjectProtocol for AVFragmentedMovie {}
1318);
1319
1320#[cfg(feature = "AVAsset")]
1321impl AVFragmentedMovie {
1322 extern_methods!(
1323 #[cfg(all(feature = "AVAssetTrack", feature = "AVMovieTrack"))]
1324 /// The tracks in a movie.
1325 ///
1326 /// The value of this property is an array of tracks the movie contains; the tracks are of type AVFragmentedMovieTrack.
1327 ///
1328 /// This property is not atomic.
1329 ///
1330 /// # Safety
1331 ///
1332 /// This might not be thread-safe.
1333 #[unsafe(method(tracks))]
1334 #[unsafe(method_family = none)]
1335 pub unsafe fn tracks(&self) -> Retained<NSArray<AVFragmentedMovieTrack>>;
1336 );
1337}
1338
1339/// Methods declared on superclass `AVMovie`.
1340#[cfg(feature = "AVAsset")]
1341impl AVFragmentedMovie {
1342 extern_methods!(
1343 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
1344 ///
1345 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
1346 ///
1347 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
1348 ///
1349 /// Returns: An AVMovie object
1350 ///
1351 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
1352 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
1353 /// to indicate where the sample data should be written.
1354 ///
1355 /// # Safety
1356 ///
1357 /// `options` generic should be of the correct type.
1358 #[unsafe(method(movieWithURL:options:))]
1359 #[unsafe(method_family = none)]
1360 pub unsafe fn movieWithURL_options(
1361 url: &NSURL,
1362 options: Option<&NSDictionary<NSString, AnyObject>>,
1363 ) -> Retained<Self>;
1364
1365 /// Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
1366 ///
1367 /// Parameter `URL`: An NSURL object that specifies a file containing a movie header.
1368 ///
1369 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
1370 ///
1371 /// Returns: An AVMovie object
1372 ///
1373 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
1374 /// If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties
1375 /// to indicate where the sample data should be written.
1376 ///
1377 /// # Safety
1378 ///
1379 /// `options` generic should be of the correct type.
1380 #[unsafe(method(initWithURL:options:))]
1381 #[unsafe(method_family = init)]
1382 pub unsafe fn initWithURL_options(
1383 this: Allocated<Self>,
1384 url: &NSURL,
1385 options: Option<&NSDictionary<NSString, AnyObject>>,
1386 ) -> Retained<Self>;
1387
1388 /// Creates an AVMovie object from a movie header stored in an NSData object.
1389 ///
1390 /// Parameter `data`: An NSData object containing a movie header.
1391 ///
1392 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
1393 ///
1394 /// Returns: An AVMovie object
1395 ///
1396 /// You can use this method to operate on movie headers that are not stored in files; this might include movie headers on the pasteboard (which do not contain media data). In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil.
1397 /// If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
1398 ///
1399 /// # Safety
1400 ///
1401 /// `options` generic should be of the correct type.
1402 #[unsafe(method(movieWithData:options:))]
1403 #[unsafe(method_family = none)]
1404 pub unsafe fn movieWithData_options(
1405 data: &NSData,
1406 options: Option<&NSDictionary<NSString, AnyObject>>,
1407 ) -> Retained<Self>;
1408
1409 /// Creates an AVMovie object from a movie header stored in an NSData object.
1410 ///
1411 /// Parameter `data`: An NSData object containing a movie header.
1412 ///
1413 /// Parameter `options`: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
1414 ///
1415 /// Returns: An AVMovie object
1416 ///
1417 /// You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
1418 ///
1419 /// By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack's mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
1420 ///
1421 /// # Safety
1422 ///
1423 /// `options` generic should be of the correct type.
1424 #[unsafe(method(initWithData:options:))]
1425 #[unsafe(method_family = init)]
1426 pub unsafe fn initWithData_options(
1427 this: Allocated<Self>,
1428 data: &NSData,
1429 options: Option<&NSDictionary<NSString, AnyObject>>,
1430 ) -> Retained<Self>;
1431 );
1432}
1433
1434/// Methods declared on superclass `AVAsset`.
1435#[cfg(feature = "AVAsset")]
1436impl AVFragmentedMovie {
1437 extern_methods!(
1438 /// Returns an instance of AVAsset for inspection of a media resource.
1439 ///
1440 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
1441 ///
1442 /// - Parameter URL: An instance of NSURL that references a media resource.
1443 ///
1444 /// - Returns: An instance of AVAsset.
1445 #[unsafe(method(assetWithURL:))]
1446 #[unsafe(method_family = none)]
1447 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
1448 );
1449}
1450
1451/// Methods declared on superclass `NSObject`.
1452#[cfg(feature = "AVAsset")]
1453impl AVFragmentedMovie {
1454 extern_methods!(
1455 #[unsafe(method(init))]
1456 #[unsafe(method_family = init)]
1457 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1458
1459 #[unsafe(method(new))]
1460 #[unsafe(method_family = new)]
1461 pub unsafe fn new() -> Retained<Self>;
1462 );
1463}
1464
1465/// AVFragmentedMovieTrackInspection.
1466#[cfg(feature = "AVAsset")]
1467impl AVFragmentedMovie {
1468 extern_methods!(
1469 #[cfg(all(
1470 feature = "AVAssetTrack",
1471 feature = "AVMovieTrack",
1472 feature = "objc2-core-media"
1473 ))]
1474 /// Provides an instance of AVFragmentedMovieTrack that represents the track of the specified trackID.
1475 ///
1476 /// Parameter `trackID`: The trackID of the requested AVFragmentedMovieTrack.
1477 ///
1478 /// Returns: An instance of AVFragmentedMovieTrack; may be nil if no track of the specified trackID is available.
1479 ///
1480 /// Becomes callable without blocking when the key
1481 /// "
1482 /// tracks" has been loaded
1483 #[deprecated = "Use loadTrackWithTrackID:completionHandler: instead"]
1484 #[unsafe(method(trackWithTrackID:))]
1485 #[unsafe(method_family = none)]
1486 pub unsafe fn trackWithTrackID(
1487 &self,
1488 track_id: CMPersistentTrackID,
1489 ) -> Option<Retained<AVFragmentedMovieTrack>>;
1490
1491 #[cfg(all(
1492 feature = "AVAssetTrack",
1493 feature = "AVMovieTrack",
1494 feature = "block2",
1495 feature = "objc2-core-media"
1496 ))]
1497 /// Loads an instance of AVFragmentedMovieTrack that represents the track of the specified trackID.
1498 ///
1499 /// Parameter `trackID`: The trackID of the requested AVFragmentedMovieTrack.
1500 ///
1501 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.
1502 ///
1503 /// # Safety
1504 ///
1505 /// `completion_handler` block must be sendable.
1506 #[unsafe(method(loadTrackWithTrackID:completionHandler:))]
1507 #[unsafe(method_family = none)]
1508 pub unsafe fn loadTrackWithTrackID_completionHandler(
1509 &self,
1510 track_id: CMPersistentTrackID,
1511 completion_handler: &block2::DynBlock<
1512 dyn Fn(*mut AVFragmentedMovieTrack, *mut NSError),
1513 >,
1514 );
1515
1516 #[cfg(all(
1517 feature = "AVAssetTrack",
1518 feature = "AVMediaFormat",
1519 feature = "AVMovieTrack"
1520 ))]
1521 /// Provides an array of AVFragmentedMovieTracks of the asset that present media of the specified media type.
1522 ///
1523 /// Parameter `mediaType`: The media type according to which the receiver filters its AVFragmentedMovieTracks. (Media types are defined in AVMediaFormat.h)
1524 ///
1525 /// Returns: An NSArray of AVFragmentedMovieTracks; may be empty if no tracks of the specified media type are available.
1526 ///
1527 /// Becomes callable without blocking when the key
1528 /// "
1529 /// tracks" has been loaded
1530 #[deprecated = "Use loadTracksWithMediaType:completionHandler: instead"]
1531 #[unsafe(method(tracksWithMediaType:))]
1532 #[unsafe(method_family = none)]
1533 pub unsafe fn tracksWithMediaType(
1534 &self,
1535 media_type: &AVMediaType,
1536 ) -> Retained<NSArray<AVFragmentedMovieTrack>>;
1537
1538 #[cfg(all(
1539 feature = "AVAssetTrack",
1540 feature = "AVMediaFormat",
1541 feature = "AVMovieTrack",
1542 feature = "block2"
1543 ))]
1544 /// Loads an array of AVFragmentedMovieTracks of the asset that present media of the specified media type.
1545 ///
1546 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVFragmentedMovieTracks. (Media types are defined in AVMediaFormat.h.)
1547 ///
1548 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.
1549 ///
1550 /// # Safety
1551 ///
1552 /// `completion_handler` block must be sendable.
1553 #[unsafe(method(loadTracksWithMediaType:completionHandler:))]
1554 #[unsafe(method_family = none)]
1555 pub unsafe fn loadTracksWithMediaType_completionHandler(
1556 &self,
1557 media_type: &AVMediaType,
1558 completion_handler: &block2::DynBlock<
1559 dyn Fn(*mut NSArray<AVFragmentedMovieTrack>, *mut NSError),
1560 >,
1561 );
1562
1563 #[cfg(all(
1564 feature = "AVAssetTrack",
1565 feature = "AVMediaFormat",
1566 feature = "AVMovieTrack"
1567 ))]
1568 /// Provides an array of AVFragmentedMovieTracks of the asset that present media with the specified characteristic.
1569 ///
1570 /// Parameter `mediaCharacteristic`: The media characteristic according to which the receiver filters its AVFragmentedMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
1571 ///
1572 /// Returns: An NSArray of AVFragmentedMovieTracks; may be empty if no tracks with the specified characteristic are available.
1573 ///
1574 /// Becomes callable without blocking when the key
1575 /// "
1576 /// tracks" has been loaded
1577 #[deprecated = "loadTracksWithMediaCharacteristic:completionHandler:"]
1578 #[unsafe(method(tracksWithMediaCharacteristic:))]
1579 #[unsafe(method_family = none)]
1580 pub unsafe fn tracksWithMediaCharacteristic(
1581 &self,
1582 media_characteristic: &AVMediaCharacteristic,
1583 ) -> Retained<NSArray<AVFragmentedMovieTrack>>;
1584
1585 #[cfg(all(
1586 feature = "AVAssetTrack",
1587 feature = "AVMediaFormat",
1588 feature = "AVMovieTrack",
1589 feature = "block2"
1590 ))]
1591 /// Loads an array of AVFragmentedMovieTracks of the asset that present media with the specified characteristic.
1592 ///
1593 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVFragmentedMovieTracks. (Media characteristics are defined in AVMediaFormat.h.)
1594 ///
1595 /// Parameter `completionHandler`: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.
1596 ///
1597 /// # Safety
1598 ///
1599 /// `completion_handler` block must be sendable.
1600 #[unsafe(method(loadTracksWithMediaCharacteristic:completionHandler:))]
1601 #[unsafe(method_family = none)]
1602 pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
1603 &self,
1604 media_characteristic: &AVMediaCharacteristic,
1605 completion_handler: &block2::DynBlock<
1606 dyn Fn(*mut NSArray<AVFragmentedMovieTrack>, *mut NSError),
1607 >,
1608 );
1609 );
1610}
1611
1612extern_class!(
1613 /// A class that periodically checks whether additional movie fragments have been appended to fragmented movie files.
1614 ///
1615 /// AVFragmentedMovieMinder is identical to AVFragmentedAssetMinder except that it's capable of minding only assets of class AVFragmentedMovie.
1616 ///
1617 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovieminder?language=objc)
1618 #[unsafe(super(AVFragmentedAssetMinder, NSObject))]
1619 #[derive(Debug, PartialEq, Eq, Hash)]
1620 #[cfg(feature = "AVAsset")]
1621 pub struct AVFragmentedMovieMinder;
1622);
1623
1624#[cfg(feature = "AVAsset")]
1625extern_conformance!(
1626 unsafe impl NSObjectProtocol for AVFragmentedMovieMinder {}
1627);
1628
1629#[cfg(feature = "AVAsset")]
1630impl AVFragmentedMovieMinder {
1631 extern_methods!(
1632 /// Creates an AVFragmentedMovieMinder, adds the specified movie to it, and sets the mindingInterval to the specified value.
1633 ///
1634 /// Parameter `movie`: An instance of AVFragmentedMovie to add to the AVFragmentedMovieMinder
1635 ///
1636 /// Parameter `mindingInterval`: The initial minding interval of the AVFragmentedMovieMinder.
1637 ///
1638 /// Returns: A new instance of AVFragmentedMovieMinder.
1639 #[unsafe(method(fragmentedMovieMinderWithMovie:mindingInterval:))]
1640 #[unsafe(method_family = none)]
1641 pub unsafe fn fragmentedMovieMinderWithMovie_mindingInterval(
1642 movie: &AVFragmentedMovie,
1643 minding_interval: NSTimeInterval,
1644 ) -> Retained<Self>;
1645
1646 /// Creates an AVFragmentedMovieMinder, adds the specified movie to it, and sets the mindingInterval to the specified value.
1647 ///
1648 /// Parameter `movie`: An instance of AVFragmentedMovie to add to the AVFragmentedMovieMinder
1649 ///
1650 /// Parameter `mindingInterval`: The initial minding interval of the AVFragmentedMovieMinder.
1651 ///
1652 /// Returns: A new instance of AVFragmentedMovieMinder.
1653 #[unsafe(method(initWithMovie:mindingInterval:))]
1654 #[unsafe(method_family = init)]
1655 pub unsafe fn initWithMovie_mindingInterval(
1656 this: Allocated<Self>,
1657 movie: &AVFragmentedMovie,
1658 minding_interval: NSTimeInterval,
1659 ) -> Retained<Self>;
1660
1661 /// An NSTimeInterval indicating how often a check for additional movie fragments should be performed. The default interval is 10.0.
1662 #[unsafe(method(mindingInterval))]
1663 #[unsafe(method_family = none)]
1664 pub unsafe fn mindingInterval(&self) -> NSTimeInterval;
1665
1666 /// Setter for [`mindingInterval`][Self::mindingInterval].
1667 #[unsafe(method(setMindingInterval:))]
1668 #[unsafe(method_family = none)]
1669 pub unsafe fn setMindingInterval(&self, minding_interval: NSTimeInterval);
1670
1671 /// An NSArray of the AVFragmentedMovie objects being minded.
1672 #[unsafe(method(movies))]
1673 #[unsafe(method_family = none)]
1674 pub unsafe fn movies(&self) -> Retained<NSArray<AVFragmentedMovie>>;
1675
1676 /// Adds a fragmented movie to the array of movies being minded.
1677 ///
1678 /// Parameter `movie`: The fragmented movie to add to the minder.
1679 #[unsafe(method(addFragmentedMovie:))]
1680 #[unsafe(method_family = none)]
1681 pub unsafe fn addFragmentedMovie(&self, movie: &AVFragmentedMovie);
1682
1683 /// Removes a fragmented movie from the array of movies being minded.
1684 ///
1685 /// Parameter `movie`: The fragmented movie to remove from the minder.
1686 #[unsafe(method(removeFragmentedMovie:))]
1687 #[unsafe(method_family = none)]
1688 pub unsafe fn removeFragmentedMovie(&self, movie: &AVFragmentedMovie);
1689 );
1690}
1691
1692/// Methods declared on superclass `AVFragmentedAssetMinder`.
1693#[cfg(feature = "AVAsset")]
1694impl AVFragmentedMovieMinder {
1695 extern_methods!(
1696 /// Creates an AVFragmentedAssetMinder, adds the specified asset to it, and sets the mindingInterval to the specified value.
1697 ///
1698 /// - Parameter asset: An instance of AVFragmentedAsset to add to the AVFragmentedAssetMinder
1699 /// - Parameter mindingInterval: The initial minding interval of the AVFragmentedAssetMinder.
1700 ///
1701 /// - Returns: A new instance of AVFragmentedAssetMinder.
1702 ///
1703 /// # Safety
1704 ///
1705 /// `asset` must implement AVFragmentMinding.
1706 #[unsafe(method(fragmentedAssetMinderWithAsset:mindingInterval:))]
1707 #[unsafe(method_family = none)]
1708 pub unsafe fn fragmentedAssetMinderWithAsset_mindingInterval(
1709 asset: &AVAsset,
1710 minding_interval: NSTimeInterval,
1711 ) -> Retained<Self>;
1712
1713 /// Creates an AVFragmentedAssetMinder, adds the specified asset to it, and sets the mindingInterval to the specified value.
1714 ///
1715 /// - Parameter asset: An instance of AVFragmentedAsset to add to the AVFragmentedAssetMinder
1716 /// - Parameter mindingInterval: The initial minding interval of the AVFragmentedAssetMinder.
1717 ///
1718 /// - Returns: A new instance of AVFragmentedAssetMinder.
1719 ///
1720 /// # Safety
1721 ///
1722 /// `asset` must implement AVFragmentMinding.
1723 #[unsafe(method(initWithAsset:mindingInterval:))]
1724 #[unsafe(method_family = init)]
1725 pub unsafe fn initWithAsset_mindingInterval(
1726 this: Allocated<Self>,
1727 asset: &AVAsset,
1728 minding_interval: NSTimeInterval,
1729 ) -> Retained<Self>;
1730 );
1731}
1732
1733/// Methods declared on superclass `NSObject`.
1734#[cfg(feature = "AVAsset")]
1735impl AVFragmentedMovieMinder {
1736 extern_methods!(
1737 #[unsafe(method(init))]
1738 #[unsafe(method_family = init)]
1739 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1740
1741 #[unsafe(method(new))]
1742 #[unsafe(method_family = new)]
1743 pub unsafe fn new() -> Retained<Self>;
1744 );
1745}
1746
1747/// SynchronousAssetInterface.
1748///
1749/// Redeclarations of async-only AVAsset interfaces to allow synchronous usage in the synchronous subclass.
1750///
1751/// See AVAsset's interface for more information about these interfaces.
1752#[cfg(feature = "AVAsset")]
1753impl AVMutableMovie {
1754 extern_methods!(
1755 #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataItem"))]
1756 #[unsafe(method(metadataForFormat:))]
1757 #[unsafe(method_family = none)]
1758 pub unsafe fn metadataForFormat(
1759 &self,
1760 format: &AVMetadataFormat,
1761 ) -> Retained<NSArray<AVMetadataItem>>;
1762
1763 #[cfg(all(feature = "AVMetadataFormat", feature = "AVTimedMetadataGroup"))]
1764 #[unsafe(method(chapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:))]
1765 #[unsafe(method_family = none)]
1766 pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys(
1767 &self,
1768 locale: &NSLocale,
1769 common_keys: Option<&NSArray<AVMetadataKey>>,
1770 ) -> Retained<NSArray<AVTimedMetadataGroup>>;
1771
1772 #[cfg(feature = "AVTimedMetadataGroup")]
1773 #[unsafe(method(chapterMetadataGroupsBestMatchingPreferredLanguages:))]
1774 #[unsafe(method_family = none)]
1775 pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages(
1776 &self,
1777 preferred_languages: &NSArray<NSString>,
1778 ) -> Retained<NSArray<AVTimedMetadataGroup>>;
1779
1780 #[cfg(all(feature = "AVMediaFormat", feature = "AVMediaSelectionGroup"))]
1781 #[unsafe(method(mediaSelectionGroupForMediaCharacteristic:))]
1782 #[unsafe(method_family = none)]
1783 pub unsafe fn mediaSelectionGroupForMediaCharacteristic(
1784 &self,
1785 media_characteristic: &AVMediaCharacteristic,
1786 ) -> Option<Retained<AVMediaSelectionGroup>>;
1787
1788 #[cfg(feature = "objc2-core-media")]
1789 #[unsafe(method(unusedTrackID))]
1790 #[unsafe(method_family = none)]
1791 pub unsafe fn unusedTrackID(&self) -> CMPersistentTrackID;
1792 );
1793}