objc2_av_foundation/generated/AVAsset.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/avasset?language=objc)
16 #[unsafe(super(NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 pub struct AVAsset;
19);
20
21#[cfg(feature = "AVAsynchronousKeyValueLoading")]
22extern_conformance!(
23 unsafe impl AVAsynchronousKeyValueLoading for AVAsset {}
24);
25
26extern_conformance!(
27 unsafe impl NSCopying for AVAsset {}
28);
29
30unsafe impl CopyingHelper for AVAsset {
31 type Result = Self;
32}
33
34extern_conformance!(
35 unsafe impl NSObjectProtocol for AVAsset {}
36);
37
38impl AVAsset {
39 extern_methods!(
40 /// Returns an instance of AVAsset for inspection of a media resource.
41 ///
42 /// Parameter `URL`: An instance of NSURL that references a media resource.
43 ///
44 /// Returns: An instance of AVAsset.
45 ///
46 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
47 #[unsafe(method(assetWithURL:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
50
51 #[cfg(feature = "objc2-core-media")]
52 #[unsafe(method(duration))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn duration(&self) -> CMTime;
55
56 #[unsafe(method(preferredRate))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn preferredRate(&self) -> c_float;
59
60 #[unsafe(method(preferredVolume))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn preferredVolume(&self) -> c_float;
63
64 #[cfg(feature = "objc2-core-foundation")]
65 #[unsafe(method(preferredTransform))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn preferredTransform(&self) -> CGAffineTransform;
68
69 #[cfg(feature = "objc2-core-foundation")]
70 #[deprecated = "Use the naturalSize and preferredTransform, as appropriate, of the receiver's video tracks. See -tracksWithMediaType:"]
71 #[unsafe(method(naturalSize))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn naturalSize(&self) -> CGSize;
74
75 #[cfg(feature = "objc2-core-media")]
76 /// Indicates how close to the latest content in a live stream playback can be sustained.
77 ///
78 /// For non-live assets this value is kCMTimeInvalid.
79 #[unsafe(method(minimumTimeOffsetFromLive))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn minimumTimeOffsetFromLive(&self) -> CMTime;
82 );
83}
84
85/// Methods declared on superclass `NSObject`.
86impl AVAsset {
87 extern_methods!(
88 #[unsafe(method(init))]
89 #[unsafe(method_family = init)]
90 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new() -> Retained<Self>;
95 );
96}
97
98/// AVAssetAsynchronousLoading.
99impl AVAsset {
100 extern_methods!(
101 #[unsafe(method(providesPreciseDurationAndTiming))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn providesPreciseDurationAndTiming(&self) -> bool;
104
105 /// Cancels the loading of all values for all observers.
106 ///
107 /// Deallocation or finalization of an instance of AVAsset will implicitly cancel loading if any loading requests are still outstanding.
108 #[unsafe(method(cancelLoading))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn cancelLoading(&self);
111 );
112}
113
114/// These constants can be passed in to AVURLAssetReferenceRestrictionsKey to control the resolution of references to external media data.
115///
116///
117/// Indicates that all types of references should be followed.
118///
119/// Indicates that references from a remote asset (e.g. referenced via http URL) to local media data (e.g. stored in a local file) should not be followed.
120///
121/// Indicates that references from a local asset to remote media data should not be followed.
122///
123/// Indicates that references from a remote asset to remote media data stored at a different site should not be followed.
124///
125/// Indicates that references from a local asset to local media data stored outside the asset's container file should not be followed.
126///
127/// Indicates that only references to media data stored within the asset's container file should be allowed.
128///
129/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetreferencerestrictions?language=objc)
130// NS_OPTIONS
131#[repr(transparent)]
132#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
133pub struct AVAssetReferenceRestrictions(pub NSUInteger);
134bitflags::bitflags! {
135 impl AVAssetReferenceRestrictions: NSUInteger {
136 #[doc(alias = "AVAssetReferenceRestrictionForbidNone")]
137 const ForbidNone = 0;
138 #[doc(alias = "AVAssetReferenceRestrictionForbidRemoteReferenceToLocal")]
139 const ForbidRemoteReferenceToLocal = 1<<0;
140 #[doc(alias = "AVAssetReferenceRestrictionForbidLocalReferenceToRemote")]
141 const ForbidLocalReferenceToRemote = 1<<1;
142 #[doc(alias = "AVAssetReferenceRestrictionForbidCrossSiteReference")]
143 const ForbidCrossSiteReference = 1<<2;
144 #[doc(alias = "AVAssetReferenceRestrictionForbidLocalReferenceToLocal")]
145 const ForbidLocalReferenceToLocal = 1<<3;
146 #[doc(alias = "AVAssetReferenceRestrictionForbidAll")]
147 const ForbidAll = 0xFFFF;
148 #[doc(alias = "AVAssetReferenceRestrictionDefaultPolicy")]
149 const DefaultPolicy = AVAssetReferenceRestrictions::ForbidLocalReferenceToRemote.0;
150 }
151}
152
153unsafe impl Encode for AVAssetReferenceRestrictions {
154 const ENCODING: Encoding = NSUInteger::ENCODING;
155}
156
157unsafe impl RefEncode for AVAssetReferenceRestrictions {
158 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
159}
160
161/// AVAssetReferenceRestrictions.
162impl AVAsset {
163 extern_methods!(
164 /// Indicates the reference restrictions being used by the receiver.
165 ///
166 /// For AVURLAsset, this property reflects the value passed in for AVURLAssetReferenceRestrictionsKey, if any. See AVURLAssetReferenceRestrictionsKey below for a full discussion of reference restrictions. The default value for this property is AVAssetReferenceRestrictionForbidLocalReferenceToRemote.
167 #[unsafe(method(referenceRestrictions))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn referenceRestrictions(&self) -> AVAssetReferenceRestrictions;
170 );
171}
172
173/// AVAssetTrackInspection.
174impl AVAsset {
175 extern_methods!(
176 #[cfg(feature = "AVAssetTrack")]
177 /// Provides the array of AVAssetTracks contained by the asset
178 #[unsafe(method(tracks))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn tracks(&self) -> Retained<NSArray<AVAssetTrack>>;
181
182 #[cfg(all(feature = "AVAssetTrack", feature = "objc2-core-media"))]
183 /// Provides an instance of AVAssetTrack that represents the track of the specified trackID.
184 ///
185 /// Parameter `trackID`: The trackID of the requested AVAssetTrack.
186 ///
187 /// Returns: An instance of AVAssetTrack; may be nil if no track of the specified trackID is available.
188 ///
189 /// Becomes callable without blocking when the key
190 /// "
191 /// tracks" has been loaded
192 #[deprecated = "Use loadTrackWithTrackID:completionHandler: instead"]
193 #[unsafe(method(trackWithTrackID:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn trackWithTrackID(
196 &self,
197 track_id: CMPersistentTrackID,
198 ) -> Option<Retained<AVAssetTrack>>;
199
200 #[cfg(all(
201 feature = "AVAssetTrack",
202 feature = "block2",
203 feature = "objc2-core-media"
204 ))]
205 /// Loads an instance of AVAssetTrack that represents the track of the specified trackID.
206 ///
207 /// Parameter `trackID`: The trackID of the requested AVAssetTrack.
208 ///
209 /// 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.
210 #[unsafe(method(loadTrackWithTrackID:completionHandler:))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn loadTrackWithTrackID_completionHandler(
213 &self,
214 track_id: CMPersistentTrackID,
215 completion_handler: &block2::DynBlock<dyn Fn(*mut AVAssetTrack, *mut NSError)>,
216 );
217
218 #[cfg(all(feature = "AVAssetTrack", feature = "AVMediaFormat"))]
219 /// Provides an array of AVAssetTracks of the asset that present media of the specified media type.
220 ///
221 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)
222 ///
223 /// Returns: An NSArray of AVAssetTracks; may be empty if no tracks of the specified media type are available.
224 ///
225 /// Becomes callable without blocking when the key
226 /// "
227 /// tracks" has been loaded
228 #[deprecated = "Use loadTracksWithMediaType:completionHandler: instead"]
229 #[unsafe(method(tracksWithMediaType:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn tracksWithMediaType(
232 &self,
233 media_type: &AVMediaType,
234 ) -> Retained<NSArray<AVAssetTrack>>;
235
236 #[cfg(all(
237 feature = "AVAssetTrack",
238 feature = "AVMediaFormat",
239 feature = "block2"
240 ))]
241 /// Loads an array of AVAssetTracks of the asset that present media of the specified media type.
242 ///
243 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)
244 ///
245 /// 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.
246 #[unsafe(method(loadTracksWithMediaType:completionHandler:))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn loadTracksWithMediaType_completionHandler(
249 &self,
250 media_type: &AVMediaType,
251 completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>,
252 );
253
254 #[cfg(all(feature = "AVAssetTrack", feature = "AVMediaFormat"))]
255 /// Provides an array of AVAssetTracks of the asset that present media with the specified characteristic.
256 ///
257 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)
258 ///
259 /// Returns: An NSArray of AVAssetTracks; may be empty if no tracks with the specified characteristic are available.
260 ///
261 /// Becomes callable without blocking when the key
262 /// "
263 /// tracks" has been loaded
264 #[deprecated = "Use loadTracksWithMediaCharacteristic:completionHandler: instead"]
265 #[unsafe(method(tracksWithMediaCharacteristic:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn tracksWithMediaCharacteristic(
268 &self,
269 media_characteristic: &AVMediaCharacteristic,
270 ) -> Retained<NSArray<AVAssetTrack>>;
271
272 #[cfg(all(
273 feature = "AVAssetTrack",
274 feature = "AVMediaFormat",
275 feature = "block2"
276 ))]
277 /// Loads an array of AVAssetTracks of the asset that present media with the specified characteristic.
278 ///
279 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)
280 ///
281 /// 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.
282 #[unsafe(method(loadTracksWithMediaCharacteristic:completionHandler:))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
285 &self,
286 media_characteristic: &AVMediaCharacteristic,
287 completion_handler: &block2::DynBlock<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>,
288 );
289
290 #[cfg(feature = "AVAssetTrackGroup")]
291 /// All track groups in the receiver.
292 ///
293 ///
294 /// The value of this property is an NSArray of AVAssetTrackGroups, each representing a different grouping of tracks in the receiver.
295 #[unsafe(method(trackGroups))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn trackGroups(&self) -> Retained<NSArray<AVAssetTrackGroup>>;
298 );
299}
300
301/// AVAssetMetadataReading.
302impl AVAsset {
303 extern_methods!(
304 #[cfg(feature = "AVMetadataItem")]
305 #[unsafe(method(creationDate))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn creationDate(&self) -> Option<Retained<AVMetadataItem>>;
308
309 #[unsafe(method(lyrics))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn lyrics(&self) -> Option<Retained<NSString>>;
312
313 #[cfg(feature = "AVMetadataItem")]
314 #[unsafe(method(commonMetadata))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn commonMetadata(&self) -> Retained<NSArray<AVMetadataItem>>;
317
318 #[cfg(feature = "AVMetadataItem")]
319 #[unsafe(method(metadata))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>;
322
323 #[cfg(feature = "AVMetadataFormat")]
324 #[unsafe(method(availableMetadataFormats))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn availableMetadataFormats(&self) -> Retained<NSArray<AVMetadataFormat>>;
327
328 #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataItem"))]
329 /// Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].
330 ///
331 /// Parameter `format`: The metadata format for which items are requested.
332 ///
333 /// Returns: An NSArray containing AVMetadataItems; may be empty if there is no metadata of the specified format.
334 ///
335 /// Becomes callable without blocking when the key
336 /// "
337 /// availableMetadataFormats" has been loaded
338 #[deprecated = "Use loadMetadataForFormat:completionHandler: instead"]
339 #[unsafe(method(metadataForFormat:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn metadataForFormat(
342 &self,
343 format: &AVMetadataFormat,
344 ) -> Retained<NSArray<AVMetadataItem>>;
345
346 #[cfg(all(
347 feature = "AVMetadataFormat",
348 feature = "AVMetadataItem",
349 feature = "block2"
350 ))]
351 /// Loads an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].
352 ///
353 /// Parameter `format`: The metadata format for which items are requested.
354 ///
355 /// Parameter `completionHandler`: A block that is invoked when loading is complete, vending the array of metadata items (which may be empty if there is no metadata of the specified format) or an error.
356 #[unsafe(method(loadMetadataForFormat:completionHandler:))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn loadMetadataForFormat_completionHandler(
359 &self,
360 format: &AVMetadataFormat,
361 completion_handler: &block2::DynBlock<
362 dyn Fn(*mut NSArray<AVMetadataItem>, *mut NSError),
363 >,
364 );
365 );
366}
367
368/// AVAssetChapterInspection.
369impl AVAsset {
370 extern_methods!(
371 #[unsafe(method(availableChapterLocales))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn availableChapterLocales(&self) -> Retained<NSArray<NSLocale>>;
374
375 #[cfg(all(feature = "AVMetadataFormat", feature = "AVTimedMetadataGroup"))]
376 /// Provides an array of chapters.
377 ///
378 /// Parameter `locale`: Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).
379 ///
380 /// Parameter `commonKeys`: Array of common keys of AVMetadataItem to be included; can be nil.
381 /// AVMetadataCommonKeyArtwork is the only supported key for now.
382 ///
383 /// Returns: An NSArray of AVTimedMetadataGroup.
384 ///
385 /// This method returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
386 ///
387 /// An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.
388 ///
389 /// Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
390 #[deprecated = "Use loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler: instead"]
391 #[unsafe(method(chapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys(
394 &self,
395 locale: &NSLocale,
396 common_keys: Option<&NSArray<AVMetadataKey>>,
397 ) -> Retained<NSArray<AVTimedMetadataGroup>>;
398
399 #[cfg(all(
400 feature = "AVMetadataFormat",
401 feature = "AVTimedMetadataGroup",
402 feature = "block2"
403 ))]
404 /// Loads an array of chapters.
405 ///
406 /// Parameter `locale`: Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).
407 ///
408 /// Parameter `commonKeys`: Array of common keys of AVMetadataItem to be included; if no common keys are required, send an empty list.
409 /// AVMetadataCommonKeyArtwork is the only supported key for now.
410 ///
411 /// Parameter `completionHandler`: A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.
412 ///
413 /// This method vends an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
414 ///
415 /// An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.
416 ///
417 /// Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
418 #[unsafe(method(loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler:))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn loadChapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys_completionHandler(
421 &self,
422 locale: &NSLocale,
423 common_keys: &NSArray<AVMetadataKey>,
424 completion_handler: &block2::DynBlock<
425 dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError),
426 >,
427 );
428
429 #[cfg(feature = "AVTimedMetadataGroup")]
430 /// Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and returns the array of chapters corresponding to the first match that's found.
431 ///
432 /// Parameter `preferredLanguages`: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user's list of preferred languages.
433 ///
434 /// Returns: An NSArray of AVTimedMetadataGroup.
435 ///
436 /// Safe to call without blocking when the AVAsset key availableChapterLocales has status AVKeyValueStatusLoaded.
437 ///
438 /// Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
439 ///
440 /// All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.
441 ///
442 /// Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
443 /// .
444 #[deprecated = "Use loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler: instead"]
445 #[unsafe(method(chapterMetadataGroupsBestMatchingPreferredLanguages:))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages(
448 &self,
449 preferred_languages: &NSArray<NSString>,
450 ) -> Retained<NSArray<AVTimedMetadataGroup>>;
451
452 #[cfg(all(feature = "AVTimedMetadataGroup", feature = "block2"))]
453 /// Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and loads the array of chapters corresponding to the first match that's found.
454 ///
455 /// Parameter `preferredLanguages`: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user's list of preferred languages.
456 ///
457 /// Parameter `completionHandler`: A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.
458 ///
459 /// Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.
460 ///
461 /// All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.
462 ///
463 /// Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].
464 #[unsafe(method(loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler:))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn loadChapterMetadataGroupsBestMatchingPreferredLanguages_completionHandler(
467 &self,
468 preferred_languages: &NSArray<NSString>,
469 completion_handler: &block2::DynBlock<
470 dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError),
471 >,
472 );
473 );
474}
475
476/// AVAssetMediaSelection.
477impl AVAsset {
478 extern_methods!(
479 #[cfg(feature = "AVMediaFormat")]
480 #[unsafe(method(availableMediaCharacteristicsWithMediaSelectionOptions))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn availableMediaCharacteristicsWithMediaSelectionOptions(
483 &self,
484 ) -> Retained<NSArray<AVMediaCharacteristic>>;
485
486 #[cfg(all(feature = "AVMediaFormat", feature = "AVMediaSelectionGroup"))]
487 /// Provides an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
488 ///
489 /// Parameter `mediaCharacteristic`: A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported.
490 ///
491 /// Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio.
492 /// Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes.
493 /// Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.
494 ///
495 /// Returns: An instance of AVMediaSelectionGroup. May be nil.
496 ///
497 /// Becomes callable without blocking when the key
498 /// "
499 /// availableMediaCharacteristicsWithMediaSelectionOptions" has been loaded.
500 ///
501 /// If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.
502 ///
503 /// Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.
504 #[deprecated = "Use loadMediaSelectionGroupForMediaCharacteristic:completionHandler: instead"]
505 #[unsafe(method(mediaSelectionGroupForMediaCharacteristic:))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn mediaSelectionGroupForMediaCharacteristic(
508 &self,
509 media_characteristic: &AVMediaCharacteristic,
510 ) -> Option<Retained<AVMediaSelectionGroup>>;
511
512 #[cfg(all(
513 feature = "AVMediaFormat",
514 feature = "AVMediaSelectionGroup",
515 feature = "block2"
516 ))]
517 /// Loads an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
518 ///
519 /// Parameter `mediaCharacteristic`: A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported.
520 ///
521 /// Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio.
522 /// Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes.
523 /// Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.
524 ///
525 /// Parameter `completionHandler`: A block that is invoked when loading is complete, vending an instance of AVMediaSelectionGroup (which may be nil) or an error.
526 ///
527 /// If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.
528 ///
529 /// Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.
530 #[unsafe(method(loadMediaSelectionGroupForMediaCharacteristic:completionHandler:))]
531 #[unsafe(method_family = none)]
532 pub unsafe fn loadMediaSelectionGroupForMediaCharacteristic_completionHandler(
533 &self,
534 media_characteristic: &AVMediaCharacteristic,
535 completion_handler: &block2::DynBlock<dyn Fn(*mut AVMediaSelectionGroup, *mut NSError)>,
536 );
537
538 #[cfg(feature = "AVMediaSelection")]
539 /// Provides an instance of AVMediaSelection with default selections for each of the receiver's media selection groups.
540 #[unsafe(method(preferredMediaSelection))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn preferredMediaSelection(&self) -> Retained<AVMediaSelection>;
543
544 #[cfg(feature = "AVMediaSelection")]
545 /// Provides an array of all permutations of AVMediaSelection for this asset.
546 #[unsafe(method(allMediaSelections))]
547 #[unsafe(method_family = none)]
548 pub unsafe fn allMediaSelections(&self) -> Retained<NSArray<AVMediaSelection>>;
549 );
550}
551
552/// AVAssetProtectedContent.
553impl AVAsset {
554 extern_methods!(
555 /// Indicates whether or not the asset has protected content.
556 ///
557 /// Assets containing protected content may not be playable without successful authorization, even if the value of the "playable" property is YES. See the properties in the AVAssetUsability category for details on how such an asset may be used. On macOS, clients can use the interfaces in AVPlayerItemProtectedContentAdditions.h to request authorization to play the asset.
558 #[unsafe(method(hasProtectedContent))]
559 #[unsafe(method_family = none)]
560 pub unsafe fn hasProtectedContent(&self) -> bool;
561 );
562}
563
564/// AVAssetFragments.
565impl AVAsset {
566 extern_methods!(
567 /// Indicates whether the asset is capable of being extended by fragments.
568 ///
569 /// For QuickTime movie files and MPEG-4 files, the value of canContainFragments is YES if an 'mvex' box is present in the 'moov' box. For those types, the 'mvex' box signals the possible presence of later 'moof' boxes.
570 #[unsafe(method(canContainFragments))]
571 #[unsafe(method_family = none)]
572 pub unsafe fn canContainFragments(&self) -> bool;
573
574 /// Indicates whether the asset is extended by at least one fragment.
575 ///
576 /// For QuickTime movie files and MPEG-4 files, the value of this property is YES if canContainFragments is YES and at least one 'moof' box is present after the 'moov' box.
577 #[unsafe(method(containsFragments))]
578 #[unsafe(method_family = none)]
579 pub unsafe fn containsFragments(&self) -> bool;
580
581 #[cfg(feature = "objc2-core-media")]
582 /// Indicates the total duration of fragments that either exist now or may be appended in the future in order to extend the duration of the asset.
583 ///
584 /// For QuickTime movie files and MPEG-4 files, the value of this property is obtained from the 'mehd' box of the 'mvex' box, if present. If no total fragment duration hint is available, the value of this property is kCMTimeInvalid.
585 #[unsafe(method(overallDurationHint))]
586 #[unsafe(method_family = none)]
587 pub unsafe fn overallDurationHint(&self) -> CMTime;
588 );
589}
590
591/// AVAssetUsability.
592impl AVAsset {
593 extern_methods!(
594 /// Indicates whether an AVPlayer can play the contents of the asset in a manner that meets user expectations.
595 ///
596 /// A client can attempt playback when playable is NO, this however may lead to a substandard playback experience.
597 #[unsafe(method(isPlayable))]
598 #[unsafe(method_family = none)]
599 pub unsafe fn isPlayable(&self) -> bool;
600
601 #[unsafe(method(isExportable))]
602 #[unsafe(method_family = none)]
603 pub unsafe fn isExportable(&self) -> bool;
604
605 #[unsafe(method(isReadable))]
606 #[unsafe(method_family = none)]
607 pub unsafe fn isReadable(&self) -> bool;
608
609 #[unsafe(method(isComposable))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn isComposable(&self) -> bool;
612
613 #[unsafe(method(isCompatibleWithSavedPhotosAlbum))]
614 #[unsafe(method_family = none)]
615 pub unsafe fn isCompatibleWithSavedPhotosAlbum(&self) -> bool;
616
617 /// Indicates whether the asset is compatible with AirPlay Video.
618 ///
619 /// YES if an AVPlayerItem initialized with the receiver can be played by an external device via AirPlay Video.
620 #[unsafe(method(isCompatibleWithAirPlayVideo))]
621 #[unsafe(method_family = none)]
622 pub unsafe fn isCompatibleWithAirPlayVideo(&self) -> bool;
623 );
624}
625
626extern "C" {
627 /// Indicates whether the asset should be prepared to indicate a precise duration and provide precise random access by time.
628 /// The value for this key is a boolean NSNumber.
629 ///
630 /// If nil is passed as the value of the options parameter to -[AVURLAsset initWithURL:options:], or if a dictionary that lacks a value for the key AVURLAssetPreferPreciseDurationAndTimingKey is passed instead, a default value of NO is assumed. If the asset is intended to be played only, because AVPlayer will support approximate random access by time when full precision isn't available, the default value of NO will suffice.
631 /// Pass YES if longer loading times are acceptable in cases in which precise timing is required. If the asset is intended to be inserted into an AVMutableComposition, precise random access is typically desirable and the value of YES is recommended.
632 /// Note that such precision may require additional parsing of the resource in advance of operations that make use of any portion of it, depending on the specifics of its container format. Many container formats provide sufficient summary information for precise timing and do not require additional parsing to prepare for it; QuickTime movie files and MPEG-4 files are examples of such formats. Other formats do not provide sufficient summary information, and precise random access for them is possible only after a preliminary examination of a file's contents.
633 /// If you pass YES for an asset that you intend to play via an instance of AVPlayerItem and you are prepared for playback to commence before the value of -[AVPlayerItem duration] becomes available, you can omit the key
634 /// "
635 /// duration" from the array of AVAsset keys you pass to -[AVPlayerItem initWithAsset:automaticallyLoadedAssetKeys:] in order to prevent AVPlayerItem from automatically loading the value of duration while the item becomes ready to play.
636 /// If precise duration and timing is not possible for the timed media resource referenced by the asset's URL, AVAsset.providesPreciseDurationAndTiming will be NO even if precise timing is requested via the use of this key.
637 ///
638 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetpreferprecisedurationandtimingkey?language=objc)
639 pub static AVURLAssetPreferPreciseDurationAndTimingKey: &'static NSString;
640}
641
642extern "C" {
643 /// Indicates the MIME type that should be used to identify the format of the media resource.
644 ///
645 /// When a value for this key is provided, only the specified MIME type is considered in determining how to handle or parse the media resource. Any other information that may be available, such as the URL path extension or a server-provided MIME type, is ignored.
646 ///
647 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetoverridemimetypekey?language=objc)
648 pub static AVURLAssetOverrideMIMETypeKey: &'static NSString;
649}
650
651extern "C" {
652 /// Indicates the restrictions used by the asset 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.
653 ///
654 /// Some assets can contain references to media data stored outside the asset's container file, for example in another file. This key can be used to specify a policy to use when these references are encountered. If an asset contains one or more references of a type that is forbidden by the reference restrictions, loading of asset properties will fail. In addition, such an asset cannot be used with other AVFoundation modules, such as AVPlayerItem or AVAssetExportSession.
655 ///
656 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetreferencerestrictionskey?language=objc)
657 pub static AVURLAssetReferenceRestrictionsKey: &'static NSString;
658}
659
660extern "C" {
661 /// HTTP cookies that the AVURLAsset may send with HTTP requests
662 /// Standard cross-site policy still applies: cookies will only be sent to domains to which they apply.
663 ///
664 /// By default, an AVURLAsset will only have access to cookies in the client's default cookie storage
665 /// that apply to the AVURLAsset's URL. You can supplement the cookies available to the asset
666 /// via use of this initialization option
667 ///
668 /// HTTP cookies do not apply to non-HTTP(S) URLS.
669 /// In HLS, many HTTP requests (e.g., media, crypt key, variant index) might be issued to different paths or hosts.
670 /// In both of these cases, HTTP requests will be missing any cookies that do not apply to the AVURLAsset's URL.
671 /// This init option allows the AVURLAsset to use additional HTTP cookies for those HTTP(S) requests.
672 ///
673 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassethttpcookieskey?language=objc)
674 pub static AVURLAssetHTTPCookiesKey: &'static NSString;
675}
676
677extern "C" {
678 /// Indicates whether network requests on behalf of this asset are allowed to use the cellular interface.
679 ///
680 /// Default is YES.
681 ///
682 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetallowscellularaccesskey?language=objc)
683 pub static AVURLAssetAllowsCellularAccessKey: &'static NSString;
684}
685
686extern "C" {
687 /// Indicates whether network requests on behalf of this asset are allowed to use the expensive interface (e.g. cellular, tethered, constrained).
688 ///
689 /// Default is YES.
690 ///
691 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetallowsexpensivenetworkaccesskey?language=objc)
692 pub static AVURLAssetAllowsExpensiveNetworkAccessKey: &'static NSString;
693}
694
695extern "C" {
696 /// Indicates whether network requests on behalf of this asset are allowed to use the constrained interface (e.g. interfaces marked as being in data saver mode).
697 ///
698 /// Default is YES.
699 ///
700 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetallowsconstrainednetworkaccesskey?language=objc)
701 pub static AVURLAssetAllowsConstrainedNetworkAccessKey: &'static NSString;
702}
703
704extern "C" {
705 /// Indicates whether alias data references in the asset should be parsed and resolved.
706 ///
707 /// 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 AVURLAsset initialization option is appropriate.
708 ///
709 /// If you provide a value for AVURLAssetReferenceRestrictionsKey, restrictions will be observed for resolved alias references just as they are for URL references.
710 ///
711 /// For more details about alias resolution, consult documentation of the bookmark-related interfaces of NSURL.
712 ///
713 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetshouldsupportaliasdatareferenceskey?language=objc)
714 pub static AVURLAssetShouldSupportAliasDataReferencesKey: &'static NSString;
715}
716
717extern "C" {
718 /// Specifies the attribution of the URLs requested by this asset.
719 ///
720 /// Value is an NSNumber whose value is an NSURLRequestAttribution (see NSURLRequest.h).
721 /// Default value is NSURLRequestAttributionDeveloper.
722 /// All NSURLRequests issed on behalf of this AVURLAsset will be attributed with this value and follow the App Privacy Policy accordingly.
723 ///
724 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlasseturlrequestattributionkey?language=objc)
725 pub static AVURLAssetURLRequestAttributionKey: &'static NSString;
726}
727
728extern "C" {
729 /// Specifies the value of the User-Agent header to add to HTTP requests made by this asset.
730 ///
731 /// Value is an NSString
732 /// Default value is the systems's default User-Agent.
733 ///
734 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassethttpuseragentkey?language=objc)
735 pub static AVURLAssetHTTPUserAgentKey: &'static NSString;
736}
737
738extern "C" {
739 /// Specifies a UUID to append as the value of the query parameter "_HLS_primary_id" to selected HTTP requests issued on behalf of the asset. Supported for HLS assets only.
740 ///
741 /// Value is an NSUUID. Its UUID string value will be used as the query parameter.
742 /// If you create AVURLAssets for the templateItems of AVPlayerInterstitialEvents and you want the instances of AVURLAsset that you create to be used during interstitial playback rather than equivalent AVURLAssets with the same URL, you must provide a value for this key that's equal to the httpSessionIdentifier of the primary AVPlayerItem's asset. See AVPlayerInterstitialEventController.h. This is especially useful if you require the use of a custom AVAssetResourceLoader delegate for interstitial assets.
743 ///
744 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlassetprimarysessionidentifierkey?language=objc)
745 pub static AVURLAssetPrimarySessionIdentifierKey: &'static NSString;
746}
747
748extern_class!(
749 /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avurlasset?language=objc)
750 #[unsafe(super(AVAsset, NSObject))]
751 #[derive(Debug, PartialEq, Eq, Hash)]
752 pub struct AVURLAsset;
753);
754
755unsafe impl Send for AVURLAsset {}
756
757unsafe impl Sync for AVURLAsset {}
758
759#[cfg(feature = "AVAsynchronousKeyValueLoading")]
760extern_conformance!(
761 unsafe impl AVAsynchronousKeyValueLoading for AVURLAsset {}
762);
763
764extern_conformance!(
765 unsafe impl NSCopying for AVURLAsset {}
766);
767
768unsafe impl CopyingHelper for AVURLAsset {
769 type Result = Self;
770}
771
772extern_conformance!(
773 unsafe impl NSObjectProtocol for AVURLAsset {}
774);
775
776impl AVURLAsset {
777 extern_methods!(
778 #[unsafe(method(init))]
779 #[unsafe(method_family = init)]
780 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
781
782 #[unsafe(method(new))]
783 #[unsafe(method_family = new)]
784 pub unsafe fn new() -> Retained<Self>;
785
786 #[cfg(feature = "AVMediaFormat")]
787 /// Provides the file types the AVURLAsset class understands.
788 ///
789 /// Returns: An NSArray of UTIs identifying the file types the AVURLAsset class understands.
790 #[unsafe(method(audiovisualTypes))]
791 #[unsafe(method_family = none)]
792 pub unsafe fn audiovisualTypes() -> Retained<NSArray<AVFileType>>;
793
794 /// Provides the MIME types the AVURLAsset class understands.
795 ///
796 /// Returns: An NSArray of NSStrings containing MIME types the AVURLAsset class understands.
797 #[unsafe(method(audiovisualMIMETypes))]
798 #[unsafe(method_family = none)]
799 pub unsafe fn audiovisualMIMETypes() -> Retained<NSArray<NSString>>;
800
801 /// Returns YES if asset is playable with the codec(s) and container type specified in extendedMIMEType. Returns NO otherwise.
802 ///
803 /// Parameter `extendedMIMEType`:
804 /// Returns: YES or NO.
805 ///
806 /// On releases prior to macOS 14, iOS 17, tvOS 17, and watchOS 10, regardless of the specified MIME type this method interprets all codecs parameters according to the ISO family syntax defined by RFC 6381 and evaluates playability according to whether the indicated codecs are supported when carried in container formats that conform to the ISO BMFF specification, such as the MPEG-4 file format.
807 /// On releases starting with macOS 14, iOS 17, tvOS 17, and watchOS 10, this method interprets codecs parameters according to the syntax and namespace determined by the specified MIME type and evaluates playability according to whether the indicated codecs are supported when carried in the container format indicated by that MIME type. Codecs parameters for each of the following MIME types are supported: video/mp4 (per RFC 6381, ISO/IEC 14496-15 Annex E, et al), video/quicktime (RFC 6381 et al), video/mp2t (ISO/IEC 13818-1), audio/vnd.wave (RFC 2361), audio/aiff (using the CoreAudio AudioFormatID namespace), audio/x-caf (also using the CoreAudio AudioFormatID namespace), and audio/mpeg (e.g. codecs="mp3"). MIME types supported as alternatives for the same container formats, e.g audio/mp4, are equivalently treated. If the indicated MIME type defines no supported syntax and namespace for codecs parameters, when any codecs parameter is present this method returns NO.
808 #[unsafe(method(isPlayableExtendedMIMEType:))]
809 #[unsafe(method_family = none)]
810 pub unsafe fn isPlayableExtendedMIMEType(extended_mime_type: &NSString) -> bool;
811
812 /// Returns an instance of AVURLAsset for inspection of a media resource.
813 ///
814 /// Parameter `URL`: An instance of NSURL that references a media resource.
815 ///
816 /// Parameter `options`: An instance of NSDictionary that contains keys for specifying options for the initialization of the AVURLAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above.
817 ///
818 /// Returns: An instance of AVURLAsset.
819 #[unsafe(method(URLAssetWithURL:options:))]
820 #[unsafe(method_family = none)]
821 pub unsafe fn URLAssetWithURL_options(
822 url: &NSURL,
823 options: Option<&NSDictionary<NSString, AnyObject>>,
824 ) -> Retained<Self>;
825
826 /// Initializes an instance of AVURLAsset for inspection of a media resource.
827 ///
828 /// Parameter `URL`: An instance of NSURL that references a media resource.
829 ///
830 /// Parameter `options`: An instance of NSDictionary that contains keys for specifying options for the initialization of the AVURLAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above.
831 ///
832 /// Returns: An instance of AVURLAsset.
833 #[unsafe(method(initWithURL:options:))]
834 #[unsafe(method_family = init)]
835 pub unsafe fn initWithURL_options(
836 this: Allocated<Self>,
837 url: &NSURL,
838 options: Option<&NSDictionary<NSString, AnyObject>>,
839 ) -> Retained<Self>;
840
841 /// Indicates the URL with which the instance of AVURLAsset was initialized.
842 #[unsafe(method(URL))]
843 #[unsafe(method_family = none)]
844 pub unsafe fn URL(&self) -> Retained<NSURL>;
845
846 /// Provides the identifier that's automatically included in any HTTP request issued on behalf of this asset in the HTTP header field "X-Playback-Session-Id".
847 ///
848 /// The value is an NSUUID from which the UUID string can be obtained.
849 /// Note that copies of an AVURLAsset vend an equivalent httpSessionIdentifier.
850 #[unsafe(method(httpSessionIdentifier))]
851 #[unsafe(method_family = none)]
852 pub unsafe fn httpSessionIdentifier(&self) -> Retained<NSUUID>;
853 );
854}
855
856/// Methods declared on superclass `AVAsset`.
857impl AVURLAsset {
858 extern_methods!(
859 /// Returns an instance of AVAsset for inspection of a media resource.
860 ///
861 /// Parameter `URL`: An instance of NSURL that references a media resource.
862 ///
863 /// Returns: An instance of AVAsset.
864 ///
865 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
866 #[unsafe(method(assetWithURL:))]
867 #[unsafe(method_family = none)]
868 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
869 );
870}
871
872/// AVURLAssetURLHandling.
873impl AVURLAsset {
874 extern_methods!(
875 #[cfg(feature = "AVAssetResourceLoader")]
876 /// Provides access to an instance of AVAssetResourceLoader, which offers limited control over the handling of URLs that may be loaded in the course of performing operations on the asset, such as playback.
877 /// The loading of file URLs cannot be mediated via use of AVAssetResourceLoader.
878 /// Note that copies of an AVAsset will vend the same instance of AVAssetResourceLoader.
879 #[unsafe(method(resourceLoader))]
880 #[unsafe(method_family = none)]
881 pub unsafe fn resourceLoader(&self) -> Retained<AVAssetResourceLoader>;
882 );
883}
884
885/// AVURLAssetCache.
886impl AVURLAsset {
887 extern_methods!(
888 #[cfg(feature = "AVAssetCache")]
889 /// Provides access to an instance of AVAssetCache to use for inspection of locally cached media data. Will be nil if an asset has not been configured to store or access media data from disk.
890 #[unsafe(method(assetCache))]
891 #[unsafe(method_family = none)]
892 pub unsafe fn assetCache(&self) -> Option<Retained<AVAssetCache>>;
893 );
894}
895
896/// AVAssetCompositionUtility.
897impl AVURLAsset {
898 extern_methods!(
899 #[cfg(all(feature = "AVAssetTrack", feature = "AVCompositionTrack"))]
900 /// Provides a reference to an AVAssetTrack of the target from which any timeRange
901 /// can be inserted into a mutable composition track (via -[AVMutableCompositionTrack insertTimeRange:ofTrack:atTime:error:]).
902 ///
903 /// Parameter `compositionTrack`: The composition track for which a compatible AVAssetTrack is requested.
904 ///
905 /// Returns: an instance of AVAssetTrack
906 ///
907 /// Finds a track of the target with content that can be accommodated by the specified composition track.
908 /// The logical complement of -[AVMutableComposition mutableTrackCompatibleWithTrack:].
909 #[deprecated = "Use findCompatibleTrackForCompositionTrack:completionHandler: instead"]
910 #[unsafe(method(compatibleTrackForCompositionTrack:))]
911 #[unsafe(method_family = none)]
912 pub unsafe fn compatibleTrackForCompositionTrack(
913 &self,
914 composition_track: &AVCompositionTrack,
915 ) -> Option<Retained<AVAssetTrack>>;
916
917 #[cfg(all(
918 feature = "AVAssetTrack",
919 feature = "AVCompositionTrack",
920 feature = "block2"
921 ))]
922 /// Loads a reference to an AVAssetTrack of the target from which any timeRange
923 /// can be inserted into a mutable composition track (via -[AVMutableCompositionTrack insertTimeRange:ofTrack:atTime:error:]).
924 ///
925 /// Parameter `compositionTrack`: The composition track for which a compatible AVAssetTrack is requested.
926 ///
927 /// Parameter `completionHandler`: A block that is invoked when loading is complete, vending an instance of AVAssetTrack or an error.
928 ///
929 /// Finds a track of the target with content that can be accommodated by the specified composition track.
930 /// The logical complement of -[AVMutableComposition mutableTrackCompatibleWithTrack:].
931 #[unsafe(method(findCompatibleTrackForCompositionTrack:completionHandler:))]
932 #[unsafe(method_family = none)]
933 pub unsafe fn findCompatibleTrackForCompositionTrack_completionHandler(
934 &self,
935 composition_track: &AVCompositionTrack,
936 completion_handler: &block2::DynBlock<dyn Fn(*mut AVAssetTrack, *mut NSError)>,
937 );
938 );
939}
940
941/// AVAssetVariantInspection.
942impl AVURLAsset {
943 extern_methods!(
944 #[cfg(feature = "AVAssetVariant")]
945 /// Provides an array of AVAssetVariants contained in the asset
946 ///
947 /// Some variants may not be playable according to the current device configuration.
948 #[unsafe(method(variants))]
949 #[unsafe(method_family = none)]
950 pub unsafe fn variants(&self) -> Retained<NSArray<AVAssetVariant>>;
951 );
952}
953
954/// AVURLAssetNSItemProvider.
955/// AVURLAssets can be shared through any interface that supports passing NSItemProviders. Note that only AVURLAssets with file URLs can be added to NSItemProviders. Attempting to share assets with non file URLs will result in an error.
956///
957/// AVURLAssets can be retrieved from NSItemProviders by directly requesting an AVURLAsset through -[NSItemProvider loadObjectOfClass:completionHandler:]. Requesting data representations of AVURLAssets is not supported. File representations of AVURLAssets will be sent without copying the underlying media and the receiver will be extended readonly sandbox access to the sender's original URL until the AVURLAsset is deallocated. Use of NSFileCoordinator and NSFilePresenter is recommended for both the sender and receive to coordinate possible changes in the file's state once sharing has been completed.
958impl AVURLAsset {
959 extern_methods!();
960}
961
962extern_conformance!(
963 unsafe impl NSItemProviderReading for AVURLAsset {}
964);
965
966extern_conformance!(
967 unsafe impl NSItemProviderWriting for AVURLAsset {}
968);
969
970extern_class!(
971 /// A class incorporating properties for a MediaExtension
972 ///
973 /// AVMediaExtensionProperties objects are returned from property queries on AVAsset, AVPlayerItemTrack, AVSampleBufferDisplayLayer, or AVSampleBufferVideoRenderer.
974 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
975 ///
976 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmediaextensionproperties?language=objc)
977 #[unsafe(super(NSObject))]
978 #[derive(Debug, PartialEq, Eq, Hash)]
979 pub struct AVMediaExtensionProperties;
980);
981
982unsafe impl Send for AVMediaExtensionProperties {}
983
984unsafe impl Sync for AVMediaExtensionProperties {}
985
986extern_conformance!(
987 unsafe impl NSCopying for AVMediaExtensionProperties {}
988);
989
990unsafe impl CopyingHelper for AVMediaExtensionProperties {
991 type Result = Self;
992}
993
994extern_conformance!(
995 unsafe impl NSObjectProtocol for AVMediaExtensionProperties {}
996);
997
998impl AVMediaExtensionProperties {
999 extern_methods!(
1000 #[unsafe(method(init))]
1001 #[unsafe(method_family = init)]
1002 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1003
1004 #[unsafe(method(new))]
1005 #[unsafe(method_family = new)]
1006 pub unsafe fn new() -> Retained<Self>;
1007
1008 /// The identifier of the Media Extension.
1009 ///
1010 /// The extension identifier string, corresponding to the ClassImplementationID value from the EXAppExtensionAttributes dictionary in the Info.plist file.
1011 #[unsafe(method(extensionIdentifier))]
1012 #[unsafe(method_family = none)]
1013 pub unsafe fn extensionIdentifier(&self) -> Retained<NSString>;
1014
1015 /// The name of the MediaExtension.
1016 ///
1017 /// The localized name of the MediaExtension format reader or video decoder, corresponding to the CFBundleDisplayName.
1018 #[unsafe(method(extensionName))]
1019 #[unsafe(method_family = none)]
1020 pub unsafe fn extensionName(&self) -> Retained<NSString>;
1021
1022 /// The name of the containing application bundle.
1023 ///
1024 /// The localized name of the application that hosts the MediaExtension.
1025 #[unsafe(method(containingBundleName))]
1026 #[unsafe(method_family = none)]
1027 pub unsafe fn containingBundleName(&self) -> Retained<NSString>;
1028
1029 /// The file URL of the MediaExtension bundle.
1030 #[unsafe(method(extensionURL))]
1031 #[unsafe(method_family = none)]
1032 pub unsafe fn extensionURL(&self) -> Retained<NSURL>;
1033
1034 /// The file URL of the host application for the MediaExtension.
1035 #[unsafe(method(containingBundleURL))]
1036 #[unsafe(method_family = none)]
1037 pub unsafe fn containingBundleURL(&self) -> Retained<NSURL>;
1038 );
1039}
1040
1041/// AVMediaExtension.
1042impl AVURLAsset {
1043 extern_methods!(
1044 /// The properties of the MediaExtension format reader for the asset.
1045 ///
1046 /// If the asset is being decoded using a MediaExtension format reader, this property will return a AVMediaExtensionProperties object describing the extension. If the asset is not being decoded with a MediaExtension format reader, this property will return nil.
1047 #[unsafe(method(mediaExtensionProperties))]
1048 #[unsafe(method_family = none)]
1049 pub unsafe fn mediaExtensionProperties(
1050 &self,
1051 ) -> Option<Retained<AVMediaExtensionProperties>>;
1052 );
1053}
1054
1055extern "C" {
1056 /// Posted when the duration of an AVFragmentedAsset changes while it's being minded by an AVFragmentedAssetMinder, but only for changes that occur after the status of the value of
1057 /// "
1058 /// duration" has reached AVKeyValueStatusLoaded.
1059 ///
1060 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetdurationdidchangenotification?language=objc)
1061 pub static AVAssetDurationDidChangeNotification: &'static NSString;
1062}
1063
1064extern "C" {
1065 /// Posted after the value of
1066 /// "
1067 /// containsFragments" has already been loaded and the AVFragmentedAsset is added to an AVFragmentedAssetMinder, either when 1) fragments are detected in the asset on disk after it had previously contained none or when 2) no fragments are detected in the asset on disk after it had previously contained one or more.
1068 ///
1069 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetcontainsfragmentsdidchangenotification?language=objc)
1070 pub static AVAssetContainsFragmentsDidChangeNotification: &'static NSString;
1071}
1072
1073extern "C" {
1074 /// Posted when the asset on disk is defragmented while an AVFragmentedAsset is being minded by an AVFragmentedAssetMinder, but only if the defragmentation occurs after the status of the value of
1075 /// "
1076 /// canContainFragments" has reached AVKeyValueStatusLoaded.
1077 ///
1078 /// After this notification is posted, the value of the asset properties canContainFragments and containsFragments will both be NO.
1079 ///
1080 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetwasdefragmentednotification?language=objc)
1081 pub static AVAssetWasDefragmentedNotification: &'static NSString;
1082}
1083
1084extern "C" {
1085 /// Posted when the collection of arrays of timed metadata groups representing chapters of an AVAsset change and when any of the contents of the timed metadata groups change, but only for changes that occur after the status of the value of
1086 /// "
1087 /// availableChapterLocales" has reached AVKeyValueStatusLoaded.
1088 ///
1089 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetchaptermetadatagroupsdidchangenotification?language=objc)
1090 pub static AVAssetChapterMetadataGroupsDidChangeNotification: &'static NSString;
1091}
1092
1093extern "C" {
1094 /// Posted when the collection of media selection groups provided by an AVAsset changes and when any of the contents of its media selection groups change, but only for changes that occur after the status of the value of
1095 /// "
1096 /// availableMediaCharacteristicsWithMediaSelectionOptions" has reached AVKeyValueStatusLoaded.
1097 ///
1098 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetmediaselectiongroupsdidchangenotification?language=objc)
1099 pub static AVAssetMediaSelectionGroupsDidChangeNotification: &'static NSString;
1100}
1101
1102extern_protocol!(
1103 /// A subclass of AVURLAsset that represents media resources that can be extended in total duration without modifying previously existing data structures.
1104 /// Such media resources include QuickTime movie files and MPEG-4 files that indicate, via an 'mvex' box in their 'moov' box, that they accommodate additional fragments. Media resources of other types may also be supported. To check whether a given instance of AVFragmentedAsset can be used to monitor the addition of fragments, check the value of the AVURLAsset property canContainFragments.
1105 /// An AVFragmentedAsset is capable of changing the values of certain of its properties and those of its tracks, while an operation that appends fragments to the underlying media resource in in progress, if the AVFragmentedAsset is associated with an instance of AVFragmentedAssetMinder.
1106 ///
1107 /// While associated with an AVFragmentedAssetMinder, AVFragmentedAsset posts AVAssetDurationDidChangeNotification whenever new fragments are detected, as appropriate. It may also post AVAssetContainsFragmentsDidChangeNotification and AVAssetWasDefragmentedNotification, as discussed in documentation of those notifications.
1108 /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
1109 ///
1110 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentminding?language=objc)
1111 pub unsafe trait AVFragmentMinding {
1112 /// Indicates whether an AVAsset that supports fragment minding is currently associated with a fragment minder, e.g. an instance of AVFragmentedAssetMinder.
1113 ///
1114 /// AVAssets that support fragment minding post change notifications only while associated with a fragment minder.
1115 #[unsafe(method(isAssociatedWithFragmentMinder))]
1116 #[unsafe(method_family = none)]
1117 unsafe fn isAssociatedWithFragmentMinder(&self) -> bool;
1118 }
1119);
1120
1121extern_class!(
1122 /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedasset?language=objc)
1123 #[unsafe(super(AVURLAsset, AVAsset, NSObject))]
1124 #[derive(Debug, PartialEq, Eq, Hash)]
1125 pub struct AVFragmentedAsset;
1126);
1127
1128unsafe impl Send for AVFragmentedAsset {}
1129
1130unsafe impl Sync for AVFragmentedAsset {}
1131
1132#[cfg(feature = "AVAsynchronousKeyValueLoading")]
1133extern_conformance!(
1134 unsafe impl AVAsynchronousKeyValueLoading for AVFragmentedAsset {}
1135);
1136
1137extern_conformance!(
1138 unsafe impl AVFragmentMinding for AVFragmentedAsset {}
1139);
1140
1141extern_conformance!(
1142 unsafe impl NSCopying for AVFragmentedAsset {}
1143);
1144
1145unsafe impl CopyingHelper for AVFragmentedAsset {
1146 type Result = Self;
1147}
1148
1149extern_conformance!(
1150 unsafe impl NSObjectProtocol for AVFragmentedAsset {}
1151);
1152
1153impl AVFragmentedAsset {
1154 extern_methods!(
1155 /// Returns an instance of AVFragmentedAsset for inspection of a fragmented media resource.
1156 ///
1157 /// Parameter `URL`: An instance of NSURL that references a media resource.
1158 ///
1159 /// Parameter `options`: An instance of NSDictionary that contains keys for specifying options for the initialization of the AVFragmentedAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above.
1160 ///
1161 /// Returns: An instance of AVFragmentedAsset.
1162 #[unsafe(method(fragmentedAssetWithURL:options:))]
1163 #[unsafe(method_family = none)]
1164 pub unsafe fn fragmentedAssetWithURL_options(
1165 url: &NSURL,
1166 options: Option<&NSDictionary<NSString, AnyObject>>,
1167 ) -> Retained<Self>;
1168
1169 #[cfg(feature = "AVAssetTrack")]
1170 /// The tracks in an asset.
1171 ///
1172 /// The value of this property is an array of tracks the asset contains; the tracks are of type AVFragmentedAssetTrack.
1173 #[unsafe(method(tracks))]
1174 #[unsafe(method_family = none)]
1175 pub unsafe fn tracks(&self) -> Retained<NSArray<AVFragmentedAssetTrack>>;
1176 );
1177}
1178
1179/// Methods declared on superclass `AVURLAsset`.
1180impl AVFragmentedAsset {
1181 extern_methods!(
1182 #[unsafe(method(init))]
1183 #[unsafe(method_family = init)]
1184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1185
1186 #[unsafe(method(new))]
1187 #[unsafe(method_family = new)]
1188 pub unsafe fn new() -> Retained<Self>;
1189
1190 /// Returns an instance of AVURLAsset for inspection of a media resource.
1191 ///
1192 /// Parameter `URL`: An instance of NSURL that references a media resource.
1193 ///
1194 /// Parameter `options`: An instance of NSDictionary that contains keys for specifying options for the initialization of the AVURLAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above.
1195 ///
1196 /// Returns: An instance of AVURLAsset.
1197 #[unsafe(method(URLAssetWithURL:options:))]
1198 #[unsafe(method_family = none)]
1199 pub unsafe fn URLAssetWithURL_options(
1200 url: &NSURL,
1201 options: Option<&NSDictionary<NSString, AnyObject>>,
1202 ) -> Retained<Self>;
1203
1204 /// Initializes an instance of AVURLAsset for inspection of a media resource.
1205 ///
1206 /// Parameter `URL`: An instance of NSURL that references a media resource.
1207 ///
1208 /// Parameter `options`: An instance of NSDictionary that contains keys for specifying options for the initialization of the AVURLAsset. See AVURLAssetPreferPreciseDurationAndTimingKey and AVURLAssetReferenceRestrictionsKey above.
1209 ///
1210 /// Returns: An instance of AVURLAsset.
1211 #[unsafe(method(initWithURL:options:))]
1212 #[unsafe(method_family = init)]
1213 pub unsafe fn initWithURL_options(
1214 this: Allocated<Self>,
1215 url: &NSURL,
1216 options: Option<&NSDictionary<NSString, AnyObject>>,
1217 ) -> Retained<Self>;
1218 );
1219}
1220
1221/// Methods declared on superclass `AVAsset`.
1222impl AVFragmentedAsset {
1223 extern_methods!(
1224 /// Returns an instance of AVAsset for inspection of a media resource.
1225 ///
1226 /// Parameter `URL`: An instance of NSURL that references a media resource.
1227 ///
1228 /// Returns: An instance of AVAsset.
1229 ///
1230 /// Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
1231 #[unsafe(method(assetWithURL:))]
1232 #[unsafe(method_family = none)]
1233 pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>;
1234 );
1235}
1236
1237/// AVFragmentedAssetTrackInspection.
1238impl AVFragmentedAsset {
1239 extern_methods!(
1240 #[cfg(all(feature = "AVAssetTrack", feature = "objc2-core-media"))]
1241 /// Provides an instance of AVFragmentedAssetTrack that represents the track of the specified trackID.
1242 ///
1243 /// Parameter `trackID`: The trackID of the requested AVFragmentedAssetTrack.
1244 ///
1245 /// Returns: An instance of AVFragmentedAssetTrack; may be nil if no track of the specified trackID is available.
1246 ///
1247 /// Becomes callable without blocking when the key
1248 /// "
1249 /// tracks" has been loaded
1250 #[deprecated = "Use loadTrackWithTrackID:completionHandler: instead"]
1251 #[unsafe(method(trackWithTrackID:))]
1252 #[unsafe(method_family = none)]
1253 pub unsafe fn trackWithTrackID(
1254 &self,
1255 track_id: CMPersistentTrackID,
1256 ) -> Option<Retained<AVFragmentedAssetTrack>>;
1257
1258 #[cfg(all(
1259 feature = "AVAssetTrack",
1260 feature = "block2",
1261 feature = "objc2-core-media"
1262 ))]
1263 /// Loads an instance of AVFragmentedAssetTrack that represents the track of the specified trackID.
1264 ///
1265 /// Parameter `trackID`: The trackID of the requested AVFragmentedAssetTrack.
1266 ///
1267 /// 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.
1268 #[unsafe(method(loadTrackWithTrackID:completionHandler:))]
1269 #[unsafe(method_family = none)]
1270 pub unsafe fn loadTrackWithTrackID_completionHandler(
1271 &self,
1272 track_id: CMPersistentTrackID,
1273 completion_handler: &block2::DynBlock<
1274 dyn Fn(*mut AVFragmentedAssetTrack, *mut NSError),
1275 >,
1276 );
1277
1278 #[cfg(all(feature = "AVAssetTrack", feature = "AVMediaFormat"))]
1279 /// Provides an array of AVFragmentedAssetTracks of the asset that present media of the specified media type.
1280 ///
1281 /// Parameter `mediaType`: The media type according to which the receiver filters its AVFragmentedAssetTracks. (Media types are defined in AVMediaFormat.h)
1282 ///
1283 /// Returns: An NSArray of AVFragmentedAssetTracks; may be empty if no tracks of the specified media type are available.
1284 ///
1285 /// Becomes callable without blocking when the key
1286 /// "
1287 /// tracks" has been loaded
1288 #[deprecated = "Use loadTracksWithMediaType:completionHandler: instead"]
1289 #[unsafe(method(tracksWithMediaType:))]
1290 #[unsafe(method_family = none)]
1291 pub unsafe fn tracksWithMediaType(
1292 &self,
1293 media_type: &AVMediaType,
1294 ) -> Retained<NSArray<AVFragmentedAssetTrack>>;
1295
1296 #[cfg(all(
1297 feature = "AVAssetTrack",
1298 feature = "AVMediaFormat",
1299 feature = "block2"
1300 ))]
1301 /// Loads an array of AVFragmentedAssetTracks of the asset that present media of the specified media type.
1302 ///
1303 /// Parameter `mediaType`: The media type according to which AVAsset filters its AVFragmentedAssetTracks. (Media types are defined in AVMediaFormat.h.)
1304 ///
1305 /// 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.
1306 #[unsafe(method(loadTracksWithMediaType:completionHandler:))]
1307 #[unsafe(method_family = none)]
1308 pub unsafe fn loadTracksWithMediaType_completionHandler(
1309 &self,
1310 media_type: &AVMediaType,
1311 completion_handler: &block2::DynBlock<
1312 dyn Fn(*mut NSArray<AVFragmentedAssetTrack>, *mut NSError),
1313 >,
1314 );
1315
1316 #[cfg(all(feature = "AVAssetTrack", feature = "AVMediaFormat"))]
1317 /// Provides an array of AVFragmentedAssetTracks of the asset that present media with the specified characteristic.
1318 ///
1319 /// Parameter `mediaCharacteristic`: The media characteristic according to which the receiver filters its AVFragmentedAssetTracks. (Media characteristics are defined in AVMediaFormat.h)
1320 ///
1321 /// Returns: An NSArray of AVFragmentedAssetTracks; may be empty if no tracks with the specified characteristic are available.
1322 ///
1323 /// Becomes callable without blocking when the key
1324 /// "
1325 /// tracks" has been loaded
1326 #[deprecated = "Use loadTracksWithMediaCharacteristic:completionHandler: instead"]
1327 #[unsafe(method(tracksWithMediaCharacteristic:))]
1328 #[unsafe(method_family = none)]
1329 pub unsafe fn tracksWithMediaCharacteristic(
1330 &self,
1331 media_characteristic: &AVMediaCharacteristic,
1332 ) -> Retained<NSArray<AVFragmentedAssetTrack>>;
1333
1334 #[cfg(all(
1335 feature = "AVAssetTrack",
1336 feature = "AVMediaFormat",
1337 feature = "block2"
1338 ))]
1339 /// Loads an array of AVFragmentedAssetTracks of the asset that present media with the specified characteristic.
1340 ///
1341 /// Parameter `mediaCharacteristic`: The media characteristic according to which AVAsset filters its AVFragmentedAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)
1342 ///
1343 /// 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.
1344 #[unsafe(method(loadTracksWithMediaCharacteristic:completionHandler:))]
1345 #[unsafe(method_family = none)]
1346 pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
1347 &self,
1348 media_characteristic: &AVMediaCharacteristic,
1349 completion_handler: &block2::DynBlock<
1350 dyn Fn(*mut NSArray<AVFragmentedAssetTrack>, *mut NSError),
1351 >,
1352 );
1353 );
1354}
1355
1356extern_class!(
1357 /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avfragmentedassetminder?language=objc)
1358 #[unsafe(super(NSObject))]
1359 #[derive(Debug, PartialEq, Eq, Hash)]
1360 pub struct AVFragmentedAssetMinder;
1361);
1362
1363extern_conformance!(
1364 unsafe impl NSObjectProtocol for AVFragmentedAssetMinder {}
1365);
1366
1367impl AVFragmentedAssetMinder {
1368 extern_methods!(
1369 /// Creates an AVFragmentedAssetMinder, adds the specified asset to it, and sets the mindingInterval to the specified value.
1370 ///
1371 /// Parameter `asset`: An instance of AVFragmentedAsset to add to the AVFragmentedAssetMinder
1372 ///
1373 /// Parameter `mindingInterval`: The initial minding interval of the AVFragmentedAssetMinder.
1374 ///
1375 /// Returns: A new instance of AVFragmentedAssetMinder.
1376 #[unsafe(method(fragmentedAssetMinderWithAsset:mindingInterval:))]
1377 #[unsafe(method_family = none)]
1378 pub unsafe fn fragmentedAssetMinderWithAsset_mindingInterval(
1379 asset: &AVAsset,
1380 minding_interval: NSTimeInterval,
1381 ) -> Retained<Self>;
1382
1383 /// Creates an AVFragmentedAssetMinder, adds the specified asset to it, and sets the mindingInterval to the specified value.
1384 ///
1385 /// Parameter `asset`: An instance of AVFragmentedAsset to add to the AVFragmentedAssetMinder
1386 ///
1387 /// Parameter `mindingInterval`: The initial minding interval of the AVFragmentedAssetMinder.
1388 ///
1389 /// Returns: A new instance of AVFragmentedAssetMinder.
1390 #[unsafe(method(initWithAsset:mindingInterval:))]
1391 #[unsafe(method_family = init)]
1392 pub unsafe fn initWithAsset_mindingInterval(
1393 this: Allocated<Self>,
1394 asset: &AVAsset,
1395 minding_interval: NSTimeInterval,
1396 ) -> Retained<Self>;
1397
1398 /// An NSTimeInterval indicating how often a check for additional fragments should be performed. The default interval is 10.0.
1399 ///
1400 /// This property throws an excepion if a value is set less than one millisecond (0.001) in duration.
1401 #[unsafe(method(mindingInterval))]
1402 #[unsafe(method_family = none)]
1403 pub unsafe fn mindingInterval(&self) -> NSTimeInterval;
1404
1405 /// Setter for [`mindingInterval`][Self::mindingInterval].
1406 #[unsafe(method(setMindingInterval:))]
1407 #[unsafe(method_family = none)]
1408 pub unsafe fn setMindingInterval(&self, minding_interval: NSTimeInterval);
1409
1410 /// An NSArray of the AVFragmentedAsset objects being minded.
1411 #[unsafe(method(assets))]
1412 #[unsafe(method_family = none)]
1413 pub unsafe fn assets(&self) -> Retained<NSArray<AVAsset>>;
1414
1415 /// Adds a fragmented asset to the array of assets being minded.
1416 ///
1417 /// Parameter `asset`: The fragmented asset to add to the minder.
1418 ///
1419 /// This method throws an exception if the asset is not a supported type (AVFragmentedAsset, AVFragmentedMovie), or if the asset is already being minded by another fragment minder.
1420 #[unsafe(method(addFragmentedAsset:))]
1421 #[unsafe(method_family = none)]
1422 pub unsafe fn addFragmentedAsset(&self, asset: &AVAsset);
1423
1424 /// Removes a fragmented asset from the array of assets being minded.
1425 ///
1426 /// Parameter `asset`: The fragmented asset to remove from the minder.
1427 ///
1428 /// This method throws an exception if the asset is not a supported type (AVFragmentedAsset, AVFragmentedMovie).
1429 #[unsafe(method(removeFragmentedAsset:))]
1430 #[unsafe(method_family = none)]
1431 pub unsafe fn removeFragmentedAsset(&self, asset: &AVAsset);
1432 );
1433}
1434
1435/// Methods declared on superclass `NSObject`.
1436impl AVFragmentedAssetMinder {
1437 extern_methods!(
1438 #[unsafe(method(init))]
1439 #[unsafe(method_family = init)]
1440 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1441
1442 #[unsafe(method(new))]
1443 #[unsafe(method_family = new)]
1444 pub unsafe fn new() -> Retained<Self>;
1445 );
1446}
1447
1448/// AVURLAssetContentKeyEligibility.
1449impl AVURLAsset {
1450 extern_methods!(
1451 /// Allows AVURLAsset to be added as a content key recipient to an AVContentKeySession.
1452 #[unsafe(method(mayRequireContentKeysForMediaDataProcessing))]
1453 #[unsafe(method_family = none)]
1454 pub unsafe fn mayRequireContentKeysForMediaDataProcessing(&self) -> bool;
1455 );
1456}
1457
1458#[cfg(feature = "AVContentKeySession")]
1459extern_conformance!(
1460 unsafe impl AVContentKeyRecipient for AVURLAsset {}
1461);