objc2_av_foundation/generated/
AVAssetSegmentReport.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
11/// Indicates the type of segment.
12///
13///
14/// Indicates that the segment is a initialization segment.
15///
16/// Indicates that the segment is a separable segment.
17///
18/// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmenttype?language=objc)
19// NS_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct AVAssetSegmentType(pub NSInteger);
23impl AVAssetSegmentType {
24    #[doc(alias = "AVAssetSegmentTypeInitialization")]
25    pub const Initialization: Self = Self(1);
26    #[doc(alias = "AVAssetSegmentTypeSeparable")]
27    pub const Separable: Self = Self(2);
28}
29
30unsafe impl Encode for AVAssetSegmentType {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for AVAssetSegmentType {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern_class!(
39    /// This class provides information on a segment data.
40    ///
41    /// Clients may get an instance of AVAssetSegmentReport through the -assetWriter:didOutputSegmentData:segmentType:segmentReport: delegate method, which is defined in AVAssetWriter.h. Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
42    ///
43    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmentreport?language=objc)
44    #[unsafe(super(NSObject))]
45    #[derive(Debug, PartialEq, Eq, Hash)]
46    pub struct AVAssetSegmentReport;
47);
48
49unsafe impl Send for AVAssetSegmentReport {}
50
51unsafe impl Sync for AVAssetSegmentReport {}
52
53extern_conformance!(
54    unsafe impl NSObjectProtocol for AVAssetSegmentReport {}
55);
56
57impl AVAssetSegmentReport {
58    extern_methods!(
59        #[unsafe(method(init))]
60        #[unsafe(method_family = init)]
61        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
62
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub unsafe fn new() -> Retained<Self>;
66
67        /// A segment type of the segment data.
68        ///
69        /// This property is not atomic.
70        ///
71        /// # Safety
72        ///
73        /// This might not be thread-safe.
74        #[unsafe(method(segmentType))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn segmentType(&self) -> AVAssetSegmentType;
77
78        /// Provides an array of AVAssetSegmentTrackReport in the segment data.
79        ///
80        /// This property is not atomic.
81        ///
82        /// # Safety
83        ///
84        /// This might not be thread-safe.
85        #[unsafe(method(trackReports))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn trackReports(&self) -> Retained<NSArray<AVAssetSegmentTrackReport>>;
88    );
89}
90
91extern_class!(
92    /// This class is vended by AVAssetSegmentReport. It will provide information on a track in a segment data.
93    ///
94    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
95    ///
96    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport?language=objc)
97    #[unsafe(super(NSObject))]
98    #[derive(Debug, PartialEq, Eq, Hash)]
99    pub struct AVAssetSegmentTrackReport;
100);
101
102unsafe impl Send for AVAssetSegmentTrackReport {}
103
104unsafe impl Sync for AVAssetSegmentTrackReport {}
105
106extern_conformance!(
107    unsafe impl NSObjectProtocol for AVAssetSegmentTrackReport {}
108);
109
110impl AVAssetSegmentTrackReport {
111    extern_methods!(
112        #[unsafe(method(init))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new() -> Retained<Self>;
119
120        #[cfg(feature = "objc2-core-media")]
121        /// Indicates the persistent unique identifier for this track.
122        ///
123        /// This property is not atomic.
124        ///
125        /// # Safety
126        ///
127        /// This might not be thread-safe.
128        #[unsafe(method(trackID))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn trackID(&self) -> CMPersistentTrackID;
131
132        #[cfg(feature = "AVMediaFormat")]
133        /// Indicates the media type for this track. Media types are declared in AVMediaFormat.h.
134        ///
135        /// This property is not atomic.
136        ///
137        /// # Safety
138        ///
139        /// This might not be thread-safe.
140        #[unsafe(method(mediaType))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn mediaType(&self) -> Retained<AVMediaType>;
143
144        #[cfg(feature = "objc2-core-media")]
145        /// Indicates the earliest presentation timestamp (PTS) for this track. The value is kCMTimeInvalid if there is no information available.
146        ///
147        /// This property is not atomic.
148        ///
149        /// # Safety
150        ///
151        /// This might not be thread-safe.
152        #[unsafe(method(earliestPresentationTimeStamp))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn earliestPresentationTimeStamp(&self) -> CMTime;
155
156        #[cfg(feature = "objc2-core-media")]
157        /// Indicates the duration for this track. The value is kCMTimeInvalid if there is no information available.
158        ///
159        /// This property is not atomic.
160        ///
161        /// # Safety
162        ///
163        /// This might not be thread-safe.
164        #[unsafe(method(duration))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn duration(&self) -> CMTime;
167
168        /// Provides information on the first video sample in this track. The value is nil if this track is not video track or no information available.
169        ///
170        /// This property is not atomic.
171        ///
172        /// # Safety
173        ///
174        /// This might not be thread-safe.
175        #[unsafe(method(firstVideoSampleInformation))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn firstVideoSampleInformation(
178            &self,
179        ) -> Option<Retained<AVAssetSegmentReportSampleInformation>>;
180    );
181}
182
183extern_class!(
184    /// This class is vended by AVAssetSegmentTrackReport. It will provide information on a sample in a track.
185    ///
186    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
187    ///
188    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation?language=objc)
189    #[unsafe(super(NSObject))]
190    #[derive(Debug, PartialEq, Eq, Hash)]
191    pub struct AVAssetSegmentReportSampleInformation;
192);
193
194unsafe impl Send for AVAssetSegmentReportSampleInformation {}
195
196unsafe impl Sync for AVAssetSegmentReportSampleInformation {}
197
198extern_conformance!(
199    unsafe impl NSObjectProtocol for AVAssetSegmentReportSampleInformation {}
200);
201
202impl AVAssetSegmentReportSampleInformation {
203    extern_methods!(
204        #[unsafe(method(init))]
205        #[unsafe(method_family = init)]
206        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
207
208        #[unsafe(method(new))]
209        #[unsafe(method_family = new)]
210        pub unsafe fn new() -> Retained<Self>;
211
212        #[cfg(feature = "objc2-core-media")]
213        /// The presentation timestamp (PTS) of the sample.
214        ///
215        /// This timestamp may be different from the earliestPresentationTimeStamp if the video is encoded using frame reordering.
216        ///
217        /// This property is not atomic.
218        ///
219        /// # Safety
220        ///
221        /// This might not be thread-safe.
222        #[unsafe(method(presentationTimeStamp))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn presentationTimeStamp(&self) -> CMTime;
225
226        /// The offset of the sample in the segment.
227        ///
228        /// This property is not atomic.
229        ///
230        /// # Safety
231        ///
232        /// This might not be thread-safe.
233        #[unsafe(method(offset))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn offset(&self) -> NSInteger;
236
237        /// The length of the sample.
238        ///
239        /// This property is not atomic.
240        ///
241        /// # Safety
242        ///
243        /// This might not be thread-safe.
244        #[unsafe(method(length))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn length(&self) -> NSInteger;
247
248        /// Indicates whether the sample is a sync sample.
249        ///
250        /// This property is not atomic.
251        ///
252        /// # Safety
253        ///
254        /// This might not be thread-safe.
255        #[unsafe(method(isSyncSample))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn isSyncSample(&self) -> bool;
258    );
259}