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")]
26extern_conformance!(
27 unsafe impl NSObjectProtocol for AVCompositionTrackSegment {}
28);
29
30#[cfg(feature = "AVAssetTrackSegment")]
31impl AVCompositionTrackSegment {
32 extern_methods!(
33 #[cfg(feature = "objc2-core-media")]
34 /// Returns an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
35 ///
36 /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
37 ///
38 /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
39 ///
40 /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
41 ///
42 /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
43 ///
44 /// Returns: An instance of AVCompositionTrackSegment.
45 ///
46 /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
47 /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
48 #[unsafe(method(compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn compositionTrackSegmentWithURL_trackID_sourceTimeRange_targetTimeRange(
51 url: &NSURL,
52 track_id: CMPersistentTrackID,
53 source_time_range: CMTimeRange,
54 target_time_range: CMTimeRange,
55 ) -> Retained<Self>;
56
57 #[cfg(feature = "objc2-core-media")]
58 /// Returns an instance of AVCompositionTrackSegment that presents an empty track segment.
59 ///
60 /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
61 ///
62 /// Returns: An instance of AVCompositionTrackSegment.
63 #[unsafe(method(compositionTrackSegmentWithTimeRange:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn compositionTrackSegmentWithTimeRange(
66 time_range: CMTimeRange,
67 ) -> Retained<Self>;
68
69 #[cfg(feature = "objc2-core-media")]
70 /// Initializes an instance of AVCompositionTrackSegment that presents a portion of a file referenced by URL.
71 ///
72 /// Parameter `URL`: An instance of NSURL that references the container file to be presented by the AVCompositionTrackSegment.
73 ///
74 /// Parameter `trackID`: The track identifier that specifies the track of the container file to be presented by the AVCompositionTrackSegment.
75 ///
76 /// Parameter `sourceTimeRange`: The timeRange of the track of the container file to be presented by the AVCompositionTrackSegment.
77 ///
78 /// Parameter `targetTimeRange`: The timeRange of the composition track during which the AVCompositionTrackSegment is to be presented.
79 ///
80 /// Returns: An instance of AVCompositionTrackSegment.
81 ///
82 /// To specify that the segment be played at the asset's normal rate, set source.duration == target.duration in the timeMapping.
83 /// Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
84 #[unsafe(method(initWithURL:trackID:sourceTimeRange:targetTimeRange:))]
85 #[unsafe(method_family = init)]
86 pub unsafe fn initWithURL_trackID_sourceTimeRange_targetTimeRange(
87 this: Allocated<Self>,
88 url: &NSURL,
89 track_id: CMPersistentTrackID,
90 source_time_range: CMTimeRange,
91 target_time_range: CMTimeRange,
92 ) -> Retained<Self>;
93
94 #[cfg(feature = "objc2-core-media")]
95 /// Initializes an instance of AVCompositionTrackSegment that presents an empty track segment.
96 ///
97 /// Parameter `timeRange`: The timeRange of the empty AVCompositionTrackSegment.
98 ///
99 /// Returns: An instance of AVCompositionTrackSegment.
100 #[unsafe(method(initWithTimeRange:))]
101 #[unsafe(method_family = init)]
102 pub unsafe fn initWithTimeRange(
103 this: Allocated<Self>,
104 time_range: CMTimeRange,
105 ) -> Retained<Self>;
106
107 /// This property is not atomic.
108 ///
109 /// # Safety
110 ///
111 /// This might not be thread-safe.
112 #[unsafe(method(isEmpty))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn isEmpty(&self) -> bool;
115
116 /// This property is not atomic.
117 ///
118 /// # Safety
119 ///
120 /// This might not be thread-safe.
121 #[unsafe(method(sourceURL))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn sourceURL(&self) -> Option<Retained<NSURL>>;
124
125 #[cfg(feature = "objc2-core-media")]
126 /// This property is not atomic.
127 ///
128 /// # Safety
129 ///
130 /// This might not be thread-safe.
131 #[unsafe(method(sourceTrackID))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn sourceTrackID(&self) -> CMPersistentTrackID;
134 );
135}
136
137/// Methods declared on superclass `AVAssetTrackSegment`.
138#[cfg(feature = "AVAssetTrackSegment")]
139impl AVCompositionTrackSegment {
140 extern_methods!(
141 #[unsafe(method(init))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
144
145 #[unsafe(method(new))]
146 #[unsafe(method_family = new)]
147 pub unsafe fn new() -> Retained<Self>;
148 );
149}