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.
42    ///
43    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmentreport?language=objc)
46    #[unsafe(super(NSObject))]
47    #[derive(Debug, PartialEq, Eq, Hash)]
48    pub struct AVAssetSegmentReport;
49);
50
51unsafe impl Send for AVAssetSegmentReport {}
52
53unsafe impl Sync for AVAssetSegmentReport {}
54
55unsafe impl NSObjectProtocol for AVAssetSegmentReport {}
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        #[unsafe(method(segmentType))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn segmentType(&self) -> AVAssetSegmentType;
71
72        /// Provides an array of AVAssetSegmentTrackReport in the segment data.
73        #[unsafe(method(trackReports))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn trackReports(&self) -> Retained<NSArray<AVAssetSegmentTrackReport>>;
76    );
77}
78
79extern_class!(
80    /// This class is vended by AVAssetSegmentReport. It will provide information on a track in a segment data.
81    ///
82    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
83    ///
84    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmenttrackreport?language=objc)
85    #[unsafe(super(NSObject))]
86    #[derive(Debug, PartialEq, Eq, Hash)]
87    pub struct AVAssetSegmentTrackReport;
88);
89
90unsafe impl Send for AVAssetSegmentTrackReport {}
91
92unsafe impl Sync for AVAssetSegmentTrackReport {}
93
94unsafe impl NSObjectProtocol for AVAssetSegmentTrackReport {}
95
96impl AVAssetSegmentTrackReport {
97    extern_methods!(
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105
106        #[cfg(feature = "objc2-core-media")]
107        /// Indicates the persistent unique identifier for this track.
108        #[unsafe(method(trackID))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn trackID(&self) -> CMPersistentTrackID;
111
112        #[cfg(feature = "AVMediaFormat")]
113        /// Indicates the media type for this track. Media types are declared in AVMediaFormat.h.
114        #[unsafe(method(mediaType))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn mediaType(&self) -> Retained<AVMediaType>;
117
118        #[cfg(feature = "objc2-core-media")]
119        /// Indicates the earliest presentation timestamp (PTS) for this track. The value is kCMTimeInvalid if there is no information available.
120        #[unsafe(method(earliestPresentationTimeStamp))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn earliestPresentationTimeStamp(&self) -> CMTime;
123
124        #[cfg(feature = "objc2-core-media")]
125        /// Indicates the duration for this track. The value is kCMTimeInvalid if there is no information available.
126        #[unsafe(method(duration))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn duration(&self) -> CMTime;
129
130        /// 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.
131        #[unsafe(method(firstVideoSampleInformation))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn firstVideoSampleInformation(
134            &self,
135        ) -> Option<Retained<AVAssetSegmentReportSampleInformation>>;
136    );
137}
138
139extern_class!(
140    /// This class is vended by AVAssetSegmentTrackReport. It will provide information on a sample in a track.
141    ///
142    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
143    ///
144    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avassetsegmentreportsampleinformation?language=objc)
145    #[unsafe(super(NSObject))]
146    #[derive(Debug, PartialEq, Eq, Hash)]
147    pub struct AVAssetSegmentReportSampleInformation;
148);
149
150unsafe impl Send for AVAssetSegmentReportSampleInformation {}
151
152unsafe impl Sync for AVAssetSegmentReportSampleInformation {}
153
154unsafe impl NSObjectProtocol for AVAssetSegmentReportSampleInformation {}
155
156impl AVAssetSegmentReportSampleInformation {
157    extern_methods!(
158        #[unsafe(method(init))]
159        #[unsafe(method_family = init)]
160        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161
162        #[unsafe(method(new))]
163        #[unsafe(method_family = new)]
164        pub unsafe fn new() -> Retained<Self>;
165
166        #[cfg(feature = "objc2-core-media")]
167        /// The presentation timestamp (PTS) of the sample.
168        ///
169        /// This timestamp may be different from the earliestPresentationTimeStamp if the video is encoded using frame reordering.
170        #[unsafe(method(presentationTimeStamp))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn presentationTimeStamp(&self) -> CMTime;
173
174        /// The offset of the sample in the segment.
175        #[unsafe(method(offset))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn offset(&self) -> NSInteger;
178
179        /// The length of the sample.
180        #[unsafe(method(length))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn length(&self) -> NSInteger;
183
184        /// Indicates whether the sample is a sync sample.
185        #[unsafe(method(isSyncSample))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn isSyncSample(&self) -> bool;
188    );
189}