objc2_av_foundation/generated/
AVCompositionTrackSegment.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::*;
5#[cfg(feature = "objc2-core-media")]
6use objc2_core_media::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcompositiontracksegment?language=objc)
13    #[unsafe(super(AVAssetTrackSegment, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "AVAssetTrackSegment")]
16    pub struct AVCompositionTrackSegment;
17);
18
19#[cfg(feature = "AVAssetTrackSegment")]
20unsafe impl Send for AVCompositionTrackSegment {}
21
22#[cfg(feature = "AVAssetTrackSegment")]
23unsafe impl Sync for AVCompositionTrackSegment {}
24
25#[cfg(feature = "AVAssetTrackSegment")]
26unsafe impl NSObjectProtocol for AVCompositionTrackSegment {}
27
28#[cfg(feature = "AVAssetTrackSegment")]
29impl AVCompositionTrackSegment {
30    extern_methods!(
31        #[cfg(feature = "objc2-core-media")]
32        /// Returns an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
33        ///
34        /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
35        ///
36        /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
37        ///
38        /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
39        ///
40        /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
41        ///
42        /// Returns: An instance of AVCompositionTrackSegment.
43        ///
44        /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
45        /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
46        #[unsafe(method(compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn compositionTrackSegmentWithURL_trackID_sourceTimeRange_targetTimeRange(
49            url: &NSURL,
50            track_id: CMPersistentTrackID,
51            source_time_range: CMTimeRange,
52            target_time_range: CMTimeRange,
53        ) -> Retained<Self>;
54
55        #[cfg(feature = "objc2-core-media")]
56        /// Returns an instance of AVCompositionTrackSegment that presents an empty track segment.
57        ///
58        /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
59        ///
60        /// Returns: An instance of AVCompositionTrackSegment.
61        #[unsafe(method(compositionTrackSegmentWithTimeRange:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn compositionTrackSegmentWithTimeRange(
64            time_range: CMTimeRange,
65        ) -> Retained<Self>;
66
67        #[cfg(feature = "objc2-core-media")]
68        /// Initializes an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
69        ///
70        /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
71        ///
72        /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
73        ///
74        /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
75        ///
76        /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
77        ///
78        /// Returns: An instance of AVCompositionTrackSegment.
79        ///
80        /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
81        /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
82        #[unsafe(method(initWithURL:trackID:sourceTimeRange:targetTimeRange:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithURL_trackID_sourceTimeRange_targetTimeRange(
85            this: Allocated<Self>,
86            url: &NSURL,
87            track_id: CMPersistentTrackID,
88            source_time_range: CMTimeRange,
89            target_time_range: CMTimeRange,
90        ) -> Retained<Self>;
91
92        #[cfg(feature = "objc2-core-media")]
93        /// Initializes an instance of AVCompositionTrackSegment that presents an empty track segment.
94        ///
95        /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
96        ///
97        /// Returns: An instance of AVCompositionTrackSegment.
98        #[unsafe(method(initWithTimeRange:))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn initWithTimeRange(
101            this: Allocated<Self>,
102            time_range: CMTimeRange,
103        ) -> Retained<Self>;
104
105        #[unsafe(method(isEmpty))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn isEmpty(&self) -> bool;
108
109        #[unsafe(method(sourceURL))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn sourceURL(&self) -> Option<Retained<NSURL>>;
112
113        #[cfg(feature = "objc2-core-media")]
114        #[unsafe(method(sourceTrackID))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn sourceTrackID(&self) -> CMPersistentTrackID;
117    );
118}
119
120/// Methods declared on superclass `AVAssetTrackSegment`.
121#[cfg(feature = "AVAssetTrackSegment")]
122impl AVCompositionTrackSegment {
123    extern_methods!(
124        #[unsafe(method(init))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new() -> Retained<Self>;
131    );
132}