objc2_av_foundation/generated/
AVMovieTrack.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-media")]
9use objc2_core_media::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmovietrack?language=objc)
16    #[unsafe(super(AVAssetTrack, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "AVAssetTrack")]
19    pub struct AVMovieTrack;
20);
21
22#[cfg(all(feature = "AVAssetTrack", feature = "AVAsynchronousKeyValueLoading"))]
23extern_conformance!(
24    unsafe impl AVAsynchronousKeyValueLoading for AVMovieTrack {}
25);
26
27#[cfg(feature = "AVAssetTrack")]
28extern_conformance!(
29    unsafe impl NSCopying for AVMovieTrack {}
30);
31
32#[cfg(feature = "AVAssetTrack")]
33unsafe impl CopyingHelper for AVMovieTrack {
34    type Result = Self;
35}
36
37#[cfg(feature = "AVAssetTrack")]
38extern_conformance!(
39    unsafe impl NSObjectProtocol for AVMovieTrack {}
40);
41
42#[cfg(feature = "AVAssetTrack")]
43impl AVMovieTrack {
44    extern_methods!(
45        #[cfg(feature = "objc2-core-media")]
46        /// A CMTimeRange indicating the range of presentation times for the track's media.
47        #[unsafe(method(mediaPresentationTimeRange))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn mediaPresentationTimeRange(&self) -> CMTimeRange;
50
51        #[cfg(feature = "objc2-core-media")]
52        /// A CMTimeRange indicating the range of decode times for the track's media.
53        #[unsafe(method(mediaDecodeTimeRange))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn mediaDecodeTimeRange(&self) -> CMTimeRange;
56
57        #[unsafe(method(alternateGroupID))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn alternateGroupID(&self) -> NSInteger;
60    );
61}
62
63/// Methods declared on superclass `AVAssetTrack`.
64#[cfg(feature = "AVAssetTrack")]
65impl AVMovieTrack {
66    extern_methods!(
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}
76
77/// AVMovieTrackMediaDataStorage.
78#[cfg(feature = "AVAssetTrack")]
79impl AVMovieTrack {
80    extern_methods!(
81        #[cfg(feature = "AVMovie")]
82        /// The storage container for media data added to a track.
83        ///
84        /// The value of this property is an AVMediaDataStorage object that indicates the location at which media data inserted or appended to the track will be written.
85        #[unsafe(method(mediaDataStorage))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn mediaDataStorage(&self) -> Option<Retained<AVMediaDataStorage>>;
88    );
89}
90
91extern_class!(
92    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutablemovietrack?language=objc)
93    #[unsafe(super(AVMovieTrack, AVAssetTrack, NSObject))]
94    #[derive(Debug, PartialEq, Eq, Hash)]
95    #[cfg(feature = "AVAssetTrack")]
96    pub struct AVMutableMovieTrack;
97);
98
99#[cfg(all(feature = "AVAssetTrack", feature = "AVAsynchronousKeyValueLoading"))]
100extern_conformance!(
101    unsafe impl AVAsynchronousKeyValueLoading for AVMutableMovieTrack {}
102);
103
104#[cfg(feature = "AVAssetTrack")]
105extern_conformance!(
106    unsafe impl NSCopying for AVMutableMovieTrack {}
107);
108
109#[cfg(feature = "AVAssetTrack")]
110unsafe impl CopyingHelper for AVMutableMovieTrack {
111    type Result = Self;
112}
113
114#[cfg(feature = "AVAssetTrack")]
115extern_conformance!(
116    unsafe impl NSObjectProtocol for AVMutableMovieTrack {}
117);
118
119#[cfg(feature = "AVAssetTrack")]
120impl AVMutableMovieTrack {
121    extern_methods!(
122        #[cfg(feature = "AVMovie")]
123        /// The storage container for media data added to a track.
124        ///
125        /// The value of this property is an AVMediaDataStorage object that indicates the location at which media data inserted or appended to the track will be written.
126        #[unsafe(method(mediaDataStorage))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn mediaDataStorage(&self) -> Option<Retained<AVMediaDataStorage>>;
129
130        #[cfg(feature = "AVMovie")]
131        /// Setter for [`mediaDataStorage`][Self::mediaDataStorage].
132        #[unsafe(method(setMediaDataStorage:))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn setMediaDataStorage(&self, media_data_storage: Option<&AVMediaDataStorage>);
135
136        /// For file types that support writing sample references, such as QuickTime Movie files, specifies the base URL that sample references are relative to; may be nil.
137        ///
138        /// If the value of this property can be resolved as an absolute URL, the sample locations written to the file when appending sample references to this track will be relative to this URL. The URL must point to a location contained by any common parent directory of the locations that will be referenced. For example, setting the sampleReferenceBaseURL property to "file:///Users/johnappleseed/Movies/" and appending sample buffers that refer to "file:///Users/johnappleseed/Movies/data/movie1.mov" will cause the sample reference "data/movie1.mov" to be written to the movie file.
139        ///
140        /// If the value of the property cannot be resolved as an absolute URL or if it points to a location that is not contained by any common parent directory of the locations that will be referenced, the location will be written unmodified.
141        ///
142        /// The default value is nil, which means that the location will be written unmodified.
143        #[unsafe(method(sampleReferenceBaseURL))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn sampleReferenceBaseURL(&self) -> Option<Retained<NSURL>>;
146
147        /// Setter for [`sampleReferenceBaseURL`][Self::sampleReferenceBaseURL].
148        #[unsafe(method(setSampleReferenceBaseURL:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn setSampleReferenceBaseURL(&self, sample_reference_base_url: Option<&NSURL>);
151
152        /// A BOOL value indicating whether the track is enabled by default for presentation.
153        #[unsafe(method(isEnabled))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn isEnabled(&self) -> bool;
156
157        /// Setter for [`isEnabled`][Self::isEnabled].
158        #[unsafe(method(setEnabled:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setEnabled(&self, enabled: bool);
161
162        /// An integer indicating the track as a member of a particular alternate group.
163        #[unsafe(method(alternateGroupID))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn alternateGroupID(&self) -> NSInteger;
166
167        /// Setter for [`alternateGroupID`][Self::alternateGroupID].
168        #[unsafe(method(setAlternateGroupID:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setAlternateGroupID(&self, alternate_group_id: NSInteger);
171
172        /// Whether a track has been modified.
173        ///
174        /// The value of this property is a BOOL that indicates whether the AVMutableMovieTrack object has been modified since it was created, was last written, or had its modified state cleared via a call to setModified:NO.
175        #[unsafe(method(isModified))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn isModified(&self) -> bool;
178
179        /// Setter for [`isModified`][Self::isModified].
180        #[unsafe(method(setModified:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn setModified(&self, modified: bool);
183
184        /// Whether a track contains protected content.
185        ///
186        /// The value of this property is a BOOL that indicates whether the track contains protected content.
187        #[unsafe(method(hasProtectedContent))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn hasProtectedContent(&self) -> bool;
190
191        #[cfg(feature = "objc2-core-media")]
192        /// For file types that contain a 'moov' atom, such as QuickTime Movie files, specifies the time scale of the track's media.
193        ///
194        /// The default media time scale is 0.
195        ///
196        /// This property should be set on a new empty track before any edits are performed on the track.
197        #[unsafe(method(timescale))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn timescale(&self) -> CMTimeScale;
200
201        #[cfg(feature = "objc2-core-media")]
202        /// Setter for [`timescale`][Self::timescale].
203        #[unsafe(method(setTimescale:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn setTimescale(&self, timescale: CMTimeScale);
206    );
207}
208
209/// Methods declared on superclass `AVAssetTrack`.
210#[cfg(feature = "AVAssetTrack")]
211impl AVMutableMovieTrack {
212    extern_methods!(
213        #[unsafe(method(init))]
214        #[unsafe(method_family = init)]
215        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
216
217        #[unsafe(method(new))]
218        #[unsafe(method_family = new)]
219        pub unsafe fn new() -> Retained<Self>;
220    );
221}
222
223/// AVMutableMovieTrackLanguageProperties.
224#[cfg(feature = "AVAssetTrack")]
225impl AVMutableMovieTrack {
226    extern_methods!(
227        /// The language associated with the track.
228        ///
229        /// The value of this property is an ISO 639-2/T language code indicating the language associated with the track; may be nil if no language is indicated.
230        #[unsafe(method(languageCode))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn languageCode(&self) -> Option<Retained<NSString>>;
233
234        /// Setter for [`languageCode`][Self::languageCode].
235        #[unsafe(method(setLanguageCode:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn setLanguageCode(&self, language_code: Option<&NSString>);
238
239        /// The language tag associated with the track.
240        ///
241        /// The value of this property is an IETF BCP 47 (RFC 4646) language identifier indicating the language tag associated with the track; may be nil if no language tag is indicated.
242        #[unsafe(method(extendedLanguageTag))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;
245
246        /// Setter for [`extendedLanguageTag`][Self::extendedLanguageTag].
247        #[unsafe(method(setExtendedLanguageTag:))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn setExtendedLanguageTag(&self, extended_language_tag: Option<&NSString>);
250    );
251}
252
253/// AVMutableMovieTrackVisualProperties.
254#[cfg(feature = "AVAssetTrack")]
255impl AVMutableMovieTrack {
256    extern_methods!(
257        #[cfg(feature = "objc2-core-foundation")]
258        /// A CGSize indicating the dimensions at which the visual media data of the track should be displayed.
259        #[unsafe(method(naturalSize))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn naturalSize(&self) -> CGSize;
262
263        #[cfg(feature = "objc2-core-foundation")]
264        /// Setter for [`naturalSize`][Self::naturalSize].
265        #[unsafe(method(setNaturalSize:))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn setNaturalSize(&self, natural_size: CGSize);
268
269        #[cfg(feature = "objc2-core-foundation")]
270        /// A CGAffineTransform indicating the transform specified in the track's storage container as the preferred transformation of the visual media data for display purposes; the value is often but not always CGAffineTransformIdentity.
271        #[unsafe(method(preferredTransform))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn preferredTransform(&self) -> CGAffineTransform;
274
275        #[cfg(feature = "objc2-core-foundation")]
276        /// Setter for [`preferredTransform`][Self::preferredTransform].
277        #[unsafe(method(setPreferredTransform:))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn setPreferredTransform(&self, preferred_transform: CGAffineTransform);
280
281        /// The layer level of the visual media data of the track.
282        #[unsafe(method(layer))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn layer(&self) -> NSInteger;
285
286        /// Setter for [`layer`][Self::layer].
287        #[unsafe(method(setLayer:))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn setLayer(&self, layer: NSInteger);
290
291        #[cfg(feature = "objc2-core-foundation")]
292        /// A CGSize indicating the clean aperture dimensions of the track.
293        #[unsafe(method(cleanApertureDimensions))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn cleanApertureDimensions(&self) -> CGSize;
296
297        #[cfg(feature = "objc2-core-foundation")]
298        /// Setter for [`cleanApertureDimensions`][Self::cleanApertureDimensions].
299        #[unsafe(method(setCleanApertureDimensions:))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn setCleanApertureDimensions(&self, clean_aperture_dimensions: CGSize);
302
303        #[cfg(feature = "objc2-core-foundation")]
304        /// A CGSize indicating the production aperture dimensions of the track.
305        #[unsafe(method(productionApertureDimensions))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn productionApertureDimensions(&self) -> CGSize;
308
309        #[cfg(feature = "objc2-core-foundation")]
310        /// Setter for [`productionApertureDimensions`][Self::productionApertureDimensions].
311        #[unsafe(method(setProductionApertureDimensions:))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn setProductionApertureDimensions(
314            &self,
315            production_aperture_dimensions: CGSize,
316        );
317
318        #[cfg(feature = "objc2-core-foundation")]
319        /// A CGSize indicating the dimensions encoded pixels dimensions of the track.
320        #[unsafe(method(encodedPixelsDimensions))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn encodedPixelsDimensions(&self) -> CGSize;
323
324        #[cfg(feature = "objc2-core-foundation")]
325        /// Setter for [`encodedPixelsDimensions`][Self::encodedPixelsDimensions].
326        #[unsafe(method(setEncodedPixelsDimensions:))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn setEncodedPixelsDimensions(&self, encoded_pixels_dimensions: CGSize);
329    );
330}
331
332/// AVMutableMovieTrackAudibleProperties.
333#[cfg(feature = "AVAssetTrack")]
334impl AVMutableMovieTrack {
335    extern_methods!(
336        /// The preferred volume of the audible media data of the track; often but not always 1.0.
337        #[unsafe(method(preferredVolume))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn preferredVolume(&self) -> c_float;
340
341        /// Setter for [`preferredVolume`][Self::preferredVolume].
342        #[unsafe(method(setPreferredVolume:))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn setPreferredVolume(&self, preferred_volume: c_float);
345    );
346}
347
348/// AVMutableMovieTrackChunkProperties.
349#[cfg(feature = "AVAssetTrack")]
350impl AVMutableMovieTrack {
351    extern_methods!(
352        /// For file types that support media chunk sizes, the maximum size (in bytes) to be used for each chunk of sample data written to the file.
353        ///
354        /// The total size of the samples in a chunk will be no larger than this preferred chunk size, or the size of a single sample if the sample is larger than this preferred chunk size.
355        ///
356        /// The default media chunk size is 1024 * 1024 bytes. It is an error to set a negative chunk size.
357        #[unsafe(method(preferredMediaChunkSize))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn preferredMediaChunkSize(&self) -> NSInteger;
360
361        /// Setter for [`preferredMediaChunkSize`][Self::preferredMediaChunkSize].
362        #[unsafe(method(setPreferredMediaChunkSize:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn setPreferredMediaChunkSize(&self, preferred_media_chunk_size: NSInteger);
365
366        #[cfg(feature = "objc2-core-media")]
367        /// For file types that support media chunk durations, the maximum duration to be used for each chunk of sample data written to the file.
368        ///
369        ///
370        /// The total duration of the samples in a chunk will be no greater than this preferred chunk duration, or the duration of a single sample if the sample's duration is greater than this preferred chunk duration.
371        ///
372        /// The default media chunk duration is 1.0 second. It is an error to set a chunk duration that is negative or non-numeric.
373        #[unsafe(method(preferredMediaChunkDuration))]
374        #[unsafe(method_family = none)]
375        pub unsafe fn preferredMediaChunkDuration(&self) -> CMTime;
376
377        #[cfg(feature = "objc2-core-media")]
378        /// Setter for [`preferredMediaChunkDuration`][Self::preferredMediaChunkDuration].
379        #[unsafe(method(setPreferredMediaChunkDuration:))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn setPreferredMediaChunkDuration(&self, preferred_media_chunk_duration: CMTime);
382
383        /// For file types that support media chunk alignment, the boundary for media chunk alignment (in bytes).
384        ///
385        ///
386        /// The default value is 0, which means that no padding should be used to achieve chunk alignment. It is an error to set a negative value for chunk alignment.
387        #[unsafe(method(preferredMediaChunkAlignment))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn preferredMediaChunkAlignment(&self) -> NSInteger;
390
391        /// Setter for [`preferredMediaChunkAlignment`][Self::preferredMediaChunkAlignment].
392        #[unsafe(method(setPreferredMediaChunkAlignment:))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn setPreferredMediaChunkAlignment(
395            &self,
396            preferred_media_chunk_alignment: NSInteger,
397        );
398    );
399}
400
401/// AVMutableMovieTrackTrackLevelEditing.
402#[cfg(feature = "AVAssetTrack")]
403impl AVMutableMovieTrack {
404    extern_methods!(
405        #[cfg(feature = "objc2-core-media")]
406        /// Inserts a portion of an AVAssetTrack object into the target movie.
407        ///
408        /// Parameter `timeRange`: The time range from the track from which media is to be inserted.
409        ///
410        /// Parameter `track`: An AVAssetTrack object indicating the source of the inserted media. Only AVAssetTracks of AVURLAssets and AVCompositions are supported.
411        /// Must not be nil.
412        ///
413        /// Parameter `startTime`: The time in the target track at which the media is to be inserted.
414        ///
415        /// Parameter `copySampleData`: A BOOL value that indicates whether sample data is to be copied from the source to the destination during edits.
416        /// If YES, the sample data is written to the file specified by the track property mediaDataStorage if non-nil,
417        /// or else by the movie property defaultMediaDataStorage if non-nil; if both are nil, the method will fail and return NO.
418        /// If NO, sample data will not be written and sample references to the samples in their original container will be added
419        /// as necessary. Note that in this case, this method will fail if the original samples are fragmented.
420        ///
421        /// Parameter `outError`: If the insertion fails, describes the nature of the failure.
422        ///
423        /// Returns: A BOOL value that indicates the success of the insertion.
424        #[unsafe(method(insertTimeRange:ofTrack:atTime:copySampleData:error:_))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn insertTimeRange_ofTrack_atTime_copySampleData_error(
427            &self,
428            time_range: CMTimeRange,
429            track: &AVAssetTrack,
430            start_time: CMTime,
431            copy_sample_data: bool,
432        ) -> Result<(), Retained<NSError>>;
433
434        #[cfg(feature = "objc2-core-media")]
435        /// Adds an empty time range to the target track.
436        ///
437        /// Parameter `timeRange`: The time range to be made empty. Note that you cannot add empty time ranges to the end of a track.
438        #[unsafe(method(insertEmptyTimeRange:))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn insertEmptyTimeRange(&self, time_range: CMTimeRange);
441
442        #[cfg(feature = "objc2-core-media")]
443        /// Removes a specified time range from a track.
444        ///
445        /// Parameter `timeRange`: The time range to be removed.
446        #[unsafe(method(removeTimeRange:))]
447        #[unsafe(method_family = none)]
448        pub unsafe fn removeTimeRange(&self, time_range: CMTimeRange);
449
450        #[cfg(feature = "objc2-core-media")]
451        /// Changes the duration of a time range of a track.
452        ///
453        /// Parameter `timeRange`: The time range to be scaled.
454        ///
455        /// Parameter `duration`: The new duration of the time range.
456        #[unsafe(method(scaleTimeRange:toDuration:))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn scaleTimeRange_toDuration(&self, time_range: CMTimeRange, duration: CMTime);
459    );
460}
461
462/// AVMutableMovieTrackMetadataEditing.
463#[cfg(feature = "AVAssetTrack")]
464impl AVMutableMovieTrack {
465    extern_methods!(
466        #[cfg(feature = "AVMetadataItem")]
467        /// A collection of metadata stored by the track.
468        ///
469        /// The value of this property is an array of AVMetadataItem objects representing the collection of metadata stored by the track.
470        #[unsafe(method(metadata))]
471        #[unsafe(method_family = none)]
472        pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>;
473
474        #[cfg(feature = "AVMetadataItem")]
475        /// Setter for [`metadata`][Self::metadata].
476        #[unsafe(method(setMetadata:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn setMetadata(&self, metadata: &NSArray<AVMetadataItem>);
479    );
480}
481
482/// AVMutableMovieTrackTrackAssociations.
483#[cfg(feature = "AVAssetTrack")]
484impl AVMutableMovieTrack {
485    extern_methods!(
486        /// Establishes a track association of a specific type between two tracks.
487        ///
488        /// Parameter `movieTrack`: An AVMovieTrack object that is to be associated with the receiver.
489        ///
490        /// Parameter `trackAssociationType`: The type of track association to add between the receiver and the specified movieTrack (for instance, AVTrackAssociationTypeChapterList).
491        ///
492        /// This method throws an exception if the movie track belongs to a different movie.
493        #[unsafe(method(addTrackAssociationToTrack:type:))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn addTrackAssociationToTrack_type(
496            &self,
497            movie_track: &AVMovieTrack,
498            track_association_type: &AVTrackAssociationType,
499        );
500
501        /// Removes a track association of a specific type between two tracks.
502        ///
503        /// Parameter `movieTrack`: An AVMovieTrack object that is associated with the receiver.
504        ///
505        /// Parameter `trackAssociationType`: The type of track association to remove between the receiver and the specified movieTrack (for instance, AVTrackAssociationTypeChapterList).
506        ///
507        /// This method throws an exception if the movie track belongs to a different movie.
508        #[unsafe(method(removeTrackAssociationToTrack:type:))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn removeTrackAssociationToTrack_type(
511            &self,
512            movie_track: &AVMovieTrack,
513            track_association_type: &AVTrackAssociationType,
514        );
515    );
516}
517
518/// AVMutableMovieTrackFormatDescriptions.
519#[cfg(feature = "AVAssetTrack")]
520impl AVMutableMovieTrack {
521    extern_methods!(
522        #[cfg(feature = "objc2-core-media")]
523        /// Replaces one of the receiver's format descriptions with another format description
524        ///
525        /// Parameter `formatDescription`: A CMFormatDescription occurring in the array returned by the -formatDescriptions method.
526        ///
527        /// Parameter `newFormatDescription`: A CMFormatDescription to replace the specified format description.
528        ///
529        /// You can use this method to make surgical changes to a track's format descriptions, such as adding format description extensions to a format description or changing the audio channel layout of an audio track. You should note that a format description can have extensions of type kCMFormatDescriptionExtension_VerbatimSampleDescription and kCMFormatDescriptionExtension_VerbatimISOSampleEntry; if you modify a copy of a format description, you should delete those extensions from the copy or your changes might be ignored.
530        ///
531        /// This method throws an exception if the media type of the new format description does not match the media type of the receiver.
532        #[unsafe(method(replaceFormatDescription:withFormatDescription:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn replaceFormatDescription_withFormatDescription(
535            &self,
536            format_description: &CMFormatDescription,
537            new_format_description: &CMFormatDescription,
538        );
539    );
540}
541
542/// AVMutableMovieTrackSampleLevelEditing.
543#[cfg(feature = "AVAssetTrack")]
544impl AVMutableMovieTrack {
545    extern_methods!(
546        #[cfg(feature = "objc2-core-media")]
547        /// Appends sample data to a media file and adds sample references for the added data to a track's media sample tables.
548        ///
549        /// Parameter `sampleBuffer`: The CMSampleBuffer to be appended; this may be obtained from an instance of AVAssetReader.
550        ///
551        /// Parameter `outDecodeTime`: A pointer to a CMTime structure to receive the decode time in the media of the first sample appended from the sample buffer. Pass NULL if you do not need this information.
552        ///
553        /// Parameter `outPresentationTime`: A pointer to a CMTime structure to receive the presentation time in the media of the first sample appended from the sample buffer. Pass NULL if you do not need this information.
554        ///
555        /// Parameter `outError`: If the appending fails, describes the nature of the failure. For example, if the device containing the track's media data storage is full, AVErrorDiskFull is returned.
556        ///
557        /// Returns: A BOOL value indicating the success of the operation.
558        ///
559        /// If the sample buffer carries sample data, the sample data is written to the container specified by the track property mediaDataStorage if non-nil,
560        /// or else by the movie property defaultMediaDataStorage if non-nil, and sample references will be appended to the track's media.
561        /// If both media data storage properties are nil, the method will fail and return NO.
562        /// If the sample buffer carries sample references only, sample data will not be written and sample references to the samples in their
563        /// original container will be appended to the track's media as necessary.
564        ///
565        /// Note regarding sample timing: in a track's media, the first sample's decode timestamp must always be zero.
566        /// For an audio track, each sample buffer's duration is used as the sample decode duration.
567        /// For other track types, difference between a sample's decode timestamp and the following
568        /// sample's decode timestamp is used as the first sample's decode duration, so as to preserve the relative timing.
569        ///
570        /// Note that this method does not modify the track's sourceTimeMappings but only appends sample references and sample data to the track's media.
571        /// To make the new samples appear in the track's timeline, invoke -insertMediaTimeRange:intoTimeRange:.
572        /// You can retrieve the mediaPresentationTimeRange property before and after appending a sequence of samples,
573        /// using CMTimeRangeGetEnd on each to calculate the media TimeRange for -insertMediaTimeRange:intoTimeRange:.
574        ///
575        /// It's safe for multiple threads to call this method on different tracks at once.
576        ///
577        /// This method throws an exception for any of the following reasons:
578        /// - the sample buffer's media type does not match the track's media type
579        /// - the sample buffer contains image buffers (must contain encoded video)
580        /// - the sample buffer contains caption groups (must contain encoded media data)
581        #[unsafe(method(appendSampleBuffer:decodeTime:presentationTime:error:_))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn appendSampleBuffer_decodeTime_presentationTime_error(
584            &self,
585            sample_buffer: &CMSampleBuffer,
586            out_decode_time: *mut CMTime,
587            out_presentation_time: *mut CMTime,
588        ) -> Result<(), Retained<NSError>>;
589
590        #[cfg(feature = "objc2-core-media")]
591        /// Inserts a reference to a media time range into a track.
592        ///
593        /// Parameter `mediaTimeRange`: The presentation time range of the media to be inserted.
594        ///
595        /// Parameter `trackTimeRange`: The time range of the track into which the media is to be inserted.
596        ///
597        /// Returns: A BOOL value indicating the success of the operation.
598        ///
599        /// Use this method after you have appended samples or sample references to a track's media.
600        ///
601        /// To specify that the media time range be played at its natural rate, pass mediaTimeRange.duration == trackTimeRange.duration;
602        /// otherwise, the ratio between these is used to determine the playback rate.
603        ///
604        /// Pass kCMTimeInvalid for trackTimeRange.start to indicate that the segment should be appended to the end of the track.
605        #[unsafe(method(insertMediaTimeRange:intoTimeRange:))]
606        #[unsafe(method_family = none)]
607        pub unsafe fn insertMediaTimeRange_intoTimeRange(
608            &self,
609            media_time_range: CMTimeRange,
610            track_time_range: CMTimeRange,
611        ) -> bool;
612    );
613}
614
615extern "C" {
616    /// Posted when the timeRange of an AVFragmentedMovieTrack changes while the associated instance of AVFragmentedMovie is being minded by an AVFragmentedMovieMinder, but only for changes that occur after the status of the value of
617    /// "
618    /// timeRange" has reached AVKeyValueStatusLoaded.
619    ///
620    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovietracktimerangedidchangenotification?language=objc)
621    pub static AVFragmentedMovieTrackTimeRangeDidChangeNotification: &'static NSString;
622}
623
624extern "C" {
625    /// Posted when the array of segments of an AVFragmentedMovieTrack changes while the associated instance of AVFragmentedMovie is being minded by an AVFragmentedMovieMinder, but only for changes that occur after the status of the value of
626    /// "
627    /// segments" has reached AVKeyValueStatusLoaded.
628    ///
629    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovietracksegmentsdidchangenotification?language=objc)
630    pub static AVFragmentedMovieTrackSegmentsDidChangeNotification: &'static NSString;
631}
632
633extern "C" {
634    /// This notification name has been deprecated. Use either AVFragmentedMovieTrackTimeRangeDidChangeNotification or AVFragmentedMovieTrackSegmentsDidChangeNotification instead; in either case, you can assume that timing changes to fragmented tracks result in changes to the total length of the sample data used by the track.
635    ///
636    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovietracktotalsampledatalengthdidchangenotification?language=objc)
637    pub static AVFragmentedMovieTrackTotalSampleDataLengthDidChangeNotification: &'static NSString;
638}
639
640extern_class!(
641    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedmovietrack?language=objc)
642    #[unsafe(super(AVMovieTrack, AVAssetTrack, NSObject))]
643    #[derive(Debug, PartialEq, Eq, Hash)]
644    #[cfg(feature = "AVAssetTrack")]
645    pub struct AVFragmentedMovieTrack;
646);
647
648#[cfg(feature = "AVAssetTrack")]
649unsafe impl Send for AVFragmentedMovieTrack {}
650
651#[cfg(feature = "AVAssetTrack")]
652unsafe impl Sync for AVFragmentedMovieTrack {}
653
654#[cfg(all(feature = "AVAssetTrack", feature = "AVAsynchronousKeyValueLoading"))]
655extern_conformance!(
656    unsafe impl AVAsynchronousKeyValueLoading for AVFragmentedMovieTrack {}
657);
658
659#[cfg(feature = "AVAssetTrack")]
660extern_conformance!(
661    unsafe impl NSCopying for AVFragmentedMovieTrack {}
662);
663
664#[cfg(feature = "AVAssetTrack")]
665unsafe impl CopyingHelper for AVFragmentedMovieTrack {
666    type Result = Self;
667}
668
669#[cfg(feature = "AVAssetTrack")]
670extern_conformance!(
671    unsafe impl NSObjectProtocol for AVFragmentedMovieTrack {}
672);
673
674#[cfg(feature = "AVAssetTrack")]
675impl AVFragmentedMovieTrack {
676    extern_methods!();
677}
678
679/// Methods declared on superclass `AVAssetTrack`.
680#[cfg(feature = "AVAssetTrack")]
681impl AVFragmentedMovieTrack {
682    extern_methods!(
683        #[unsafe(method(init))]
684        #[unsafe(method_family = init)]
685        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
686
687        #[unsafe(method(new))]
688        #[unsafe(method_family = new)]
689        pub unsafe fn new() -> Retained<Self>;
690    );
691}
692
693/// SynchronousTrackInterface.
694/// Redeclarations of async-only AVAssetTrack interfaces to allow synchronous usage in the synchronous subclass.
695///
696/// See AVAssetTrack's interface for more information about these interfaces.
697#[cfg(feature = "AVAssetTrack")]
698impl AVMutableMovieTrack {
699    extern_methods!(
700        #[cfg(feature = "AVMediaFormat")]
701        #[unsafe(method(hasMediaCharacteristic:))]
702        #[unsafe(method_family = none)]
703        pub unsafe fn hasMediaCharacteristic(
704            &self,
705            media_characteristic: &AVMediaCharacteristic,
706        ) -> bool;
707
708        #[cfg(all(feature = "AVAssetTrackSegment", feature = "objc2-core-media"))]
709        #[unsafe(method(segmentForTrackTime:))]
710        #[unsafe(method_family = none)]
711        pub unsafe fn segmentForTrackTime(
712            &self,
713            track_time: CMTime,
714        ) -> Option<Retained<AVAssetTrackSegment>>;
715
716        #[cfg(feature = "objc2-core-media")]
717        #[unsafe(method(samplePresentationTimeForTrackTime:))]
718        #[unsafe(method_family = none)]
719        pub unsafe fn samplePresentationTimeForTrackTime(&self, track_time: CMTime) -> CMTime;
720
721        #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataItem"))]
722        #[unsafe(method(metadataForFormat:))]
723        #[unsafe(method_family = none)]
724        pub unsafe fn metadataForFormat(
725            &self,
726            format: &AVMetadataFormat,
727        ) -> Retained<NSArray<AVMetadataItem>>;
728
729        #[unsafe(method(associatedTracksOfType:))]
730        #[unsafe(method_family = none)]
731        pub unsafe fn associatedTracksOfType(
732            &self,
733            track_association_type: &AVTrackAssociationType,
734        ) -> Retained<NSArray<AVAssetTrack>>;
735    );
736}