objc2_av_foundation/generated/
AVAssetCache.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// AVAssetCache is a class vended by an AVAsset used for the inspection of locally available media data.
11    ///
12    /// AVAssetCaches are vended by AVURLAsset's assetCache property.
13    ///
14    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetcache?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct AVAssetCache;
20);
21
22unsafe impl Send for AVAssetCache {}
23
24unsafe impl Sync for AVAssetCache {}
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for AVAssetCache {}
28);
29
30impl AVAssetCache {
31    extern_methods!(
32        /// Returns YES if a complete rendition of an AVAsset is available to be played without a network connection.
33        ///
34        /// An answer of YES does not indicate that any given media selection is available for offline playback. To determine if a specific media selection is available offline, see mediaSelectionOptionsInMediaSelectionGroup:.
35        ///
36        /// This property is not atomic.
37        ///
38        /// # Safety
39        ///
40        /// This might not be thread-safe.
41        #[unsafe(method(isPlayableOffline))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn isPlayableOffline(&self) -> bool;
44
45        #[cfg(feature = "AVMediaSelectionGroup")]
46        /// Returns an array of AVMediaSelectionOptions in an AVMediaSelectionGroup that are available for offline operations, e.g. playback.
47        #[unsafe(method(mediaSelectionOptionsInMediaSelectionGroup:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn mediaSelectionOptionsInMediaSelectionGroup(
50            &self,
51            media_selection_group: &AVMediaSelectionGroup,
52        ) -> Retained<NSArray<AVMediaSelectionOption>>;
53
54        #[unsafe(method(init))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58        #[unsafe(method(new))]
59        #[unsafe(method_family = new)]
60        pub unsafe fn new() -> Retained<Self>;
61    );
62}
63
64/// AVAssetCacheCustomMediaSelectionScheme.
65impl AVAssetCache {
66    extern_methods!(
67        #[cfg(feature = "AVMediaSelectionGroup")]
68        /// For each AVMediaPresentationSelector defined by the AVCustomMediaSelectionScheme of an AVMediaSelectionGroup, returns the AVMediaPresentationSettings that can be satisfied for offline operations, e.g. playback.
69        #[unsafe(method(mediaPresentationSettingsForMediaSelectionGroup:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn mediaPresentationSettingsForMediaSelectionGroup(
72            &self,
73            media_selection_group: &AVMediaSelectionGroup,
74        ) -> Retained<NSDictionary<AVMediaPresentationSelector, NSArray<AVMediaPresentationSetting>>>;
75
76        #[cfg(feature = "AVMediaSelectionGroup")]
77        /// Returns an array of extended language tags for languages that can be selected for offline operations via use of the AVMediaSelectionGroup's AVCustomMediaSelectionScheme.
78        #[unsafe(method(mediaPresentationLanguagesForMediaSelectionGroup:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn mediaPresentationLanguagesForMediaSelectionGroup(
81            &self,
82            media_selection_group: &AVMediaSelectionGroup,
83        ) -> Retained<NSArray<NSString>>;
84    );
85}