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 #[unsafe(method(isEmpty))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn isEmpty(&self) -> bool;
110
111 #[unsafe(method(sourceURL))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn sourceURL(&self) -> Option<Retained<NSURL>>;
114
115 #[cfg(feature = "objc2-core-media")]
116 #[unsafe(method(sourceTrackID))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn sourceTrackID(&self) -> CMPersistentTrackID;
119 );
120}
121
122/// Methods declared on superclass `AVAssetTrackSegment`.
123#[cfg(feature = "AVAssetTrackSegment")]
124impl AVCompositionTrackSegment {
125 extern_methods!(
126 #[unsafe(method(init))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130 #[unsafe(method(new))]
131 #[unsafe(method_family = new)]
132 pub unsafe fn new() -> Retained<Self>;
133 );
134}