objc2_av_foundation/generated/
AVTimedMetadataGroup.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// AVMetadataGroup is the common superclass for AVTimedMetadataGroup and AVDateRangeMetadataGroup; each represents a collection of metadata items associated with a segment of a timeline. AVTimedMetadataGroup is typically used with content that defines an independent timeline, while AVDateRangeMetadataGroup is typically used with content that's associated with a specific range of dates.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadatagroup?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct AVMetadataGroup;
19);
20
21unsafe impl NSObjectProtocol for AVMetadataGroup {}
22
23impl AVMetadataGroup {
24    extern_methods!(
25        #[cfg(feature = "AVMetadataItem")]
26        #[unsafe(method(items))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
29    );
30}
31
32/// Methods declared on superclass `NSObject`.
33impl AVMetadataGroup {
34    extern_methods!(
35        #[unsafe(method(init))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39        #[unsafe(method(new))]
40        #[unsafe(method_family = new)]
41        pub unsafe fn new() -> Retained<Self>;
42    );
43}
44
45/// AVMetadataGroupIdentification.
46impl AVMetadataGroup {
47    extern_methods!(
48        #[unsafe(method(classifyingLabel))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn classifyingLabel(&self) -> Option<Retained<NSString>>;
51
52        #[unsafe(method(uniqueID))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn uniqueID(&self) -> Option<Retained<NSString>>;
55    );
56}
57
58extern_class!(
59    /// AVTimedMetadataGroup is used to represent a collection of metadata items that are valid for use during a specific range of time. For example, AVTimedMetadataGroups are used to represent chapters, optionally containing metadata items for chapter titles and chapter images.
60    ///
61    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avtimedmetadatagroup?language=objc)
62    #[unsafe(super(AVMetadataGroup, NSObject))]
63    #[derive(Debug, PartialEq, Eq, Hash)]
64    pub struct AVTimedMetadataGroup;
65);
66
67unsafe impl NSCopying for AVTimedMetadataGroup {}
68
69unsafe impl CopyingHelper for AVTimedMetadataGroup {
70    type Result = Self;
71}
72
73unsafe impl NSMutableCopying for AVTimedMetadataGroup {}
74
75unsafe impl MutableCopyingHelper for AVTimedMetadataGroup {
76    type Result = AVMutableTimedMetadataGroup;
77}
78
79unsafe impl NSObjectProtocol for AVTimedMetadataGroup {}
80
81impl AVTimedMetadataGroup {
82    extern_methods!(
83        #[cfg(all(feature = "AVMetadataItem", feature = "objc2-core-media"))]
84        /// Initializes an instance of AVTimedMetadataGroup with a collection of metadata items.
85        ///
86        /// Parameter `items`: An NSArray of AVMetadataItems.
87        ///
88        /// Parameter `timeRange`: The timeRange of the collection of AVMetadataItems.
89        ///
90        /// Returns: An instance of AVTimedMetadataGroup.
91        #[unsafe(method(initWithItems:timeRange:))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn initWithItems_timeRange(
94            this: Allocated<Self>,
95            items: &NSArray<AVMetadataItem>,
96            time_range: CMTimeRange,
97        ) -> Retained<Self>;
98
99        #[cfg(feature = "objc2-core-media")]
100        /// Initializes an instance of AVTimedMetadataGroup with a sample buffer.
101        ///
102        /// Parameter `sampleBuffer`: A CMSampleBuffer with media type kCMMediaType_Metadata.
103        ///
104        /// Returns: An instance of AVTimedMetadataGroup.
105        #[unsafe(method(initWithSampleBuffer:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithSampleBuffer(
108            this: Allocated<Self>,
109            sample_buffer: &CMSampleBuffer,
110        ) -> Option<Retained<Self>>;
111
112        #[cfg(feature = "objc2-core-media")]
113        #[unsafe(method(timeRange))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn timeRange(&self) -> CMTimeRange;
116
117        #[cfg(feature = "AVMetadataItem")]
118        #[unsafe(method(items))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
121    );
122}
123
124/// Methods declared on superclass `NSObject`.
125impl AVTimedMetadataGroup {
126    extern_methods!(
127        #[unsafe(method(init))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
130
131        #[unsafe(method(new))]
132        #[unsafe(method_family = new)]
133        pub unsafe fn new() -> Retained<Self>;
134    );
135}
136
137/// AVTimedMetadataGroupSerializationSupport.
138impl AVTimedMetadataGroup {
139    extern_methods!(
140        #[cfg(feature = "objc2-core-media")]
141        /// Creates a format description based on the receiver's items.
142        ///
143        /// Returns: An instance of CMMetadataFormatDescription sufficient to describe the contents of all the items referenced by the receiver.
144        ///
145        /// The returned format description is suitable for use as the format hint parameter when creating an instance of AVAssetWriterInput.
146        ///
147        /// Each item referenced by the receiver must carry a non-nil value for its dataType property.  An exception will be thrown if any item does not have a data type.
148        #[unsafe(method(copyFormatDescription))]
149        #[unsafe(method_family = copy)]
150        pub unsafe fn copyFormatDescription(&self)
151            -> Option<Retained<CMMetadataFormatDescription>>;
152    );
153}
154
155extern_class!(
156    /// AVMutableTimedMetadataGroup is used to represent a mutable collection of metadata items that are valid for use during a specific range of time.
157    ///
158    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutabletimedmetadatagroup?language=objc)
159    #[unsafe(super(AVTimedMetadataGroup, AVMetadataGroup, NSObject))]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    pub struct AVMutableTimedMetadataGroup;
162);
163
164unsafe impl NSCopying for AVMutableTimedMetadataGroup {}
165
166unsafe impl CopyingHelper for AVMutableTimedMetadataGroup {
167    type Result = AVTimedMetadataGroup;
168}
169
170unsafe impl NSMutableCopying for AVMutableTimedMetadataGroup {}
171
172unsafe impl MutableCopyingHelper for AVMutableTimedMetadataGroup {
173    type Result = Self;
174}
175
176unsafe impl NSObjectProtocol for AVMutableTimedMetadataGroup {}
177
178impl AVMutableTimedMetadataGroup {
179    extern_methods!(
180        #[cfg(feature = "objc2-core-media")]
181        #[unsafe(method(timeRange))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn timeRange(&self) -> CMTimeRange;
184
185        #[cfg(feature = "objc2-core-media")]
186        /// Setter for [`timeRange`][Self::timeRange].
187        #[unsafe(method(setTimeRange:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setTimeRange(&self, time_range: CMTimeRange);
190
191        #[cfg(feature = "AVMetadataItem")]
192        #[unsafe(method(items))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
195
196        #[cfg(feature = "AVMetadataItem")]
197        /// Setter for [`items`][Self::items].
198        #[unsafe(method(setItems:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn setItems(&self, items: &NSArray<AVMetadataItem>);
201    );
202}
203
204/// Methods declared on superclass `AVTimedMetadataGroup`.
205impl AVMutableTimedMetadataGroup {
206    extern_methods!(
207        #[cfg(all(feature = "AVMetadataItem", feature = "objc2-core-media"))]
208        /// Initializes an instance of AVTimedMetadataGroup with a collection of metadata items.
209        ///
210        /// Parameter `items`: An NSArray of AVMetadataItems.
211        ///
212        /// Parameter `timeRange`: The timeRange of the collection of AVMetadataItems.
213        ///
214        /// Returns: An instance of AVTimedMetadataGroup.
215        #[unsafe(method(initWithItems:timeRange:))]
216        #[unsafe(method_family = init)]
217        pub unsafe fn initWithItems_timeRange(
218            this: Allocated<Self>,
219            items: &NSArray<AVMetadataItem>,
220            time_range: CMTimeRange,
221        ) -> Retained<Self>;
222
223        #[cfg(feature = "objc2-core-media")]
224        /// Initializes an instance of AVTimedMetadataGroup with a sample buffer.
225        ///
226        /// Parameter `sampleBuffer`: A CMSampleBuffer with media type kCMMediaType_Metadata.
227        ///
228        /// Returns: An instance of AVTimedMetadataGroup.
229        #[unsafe(method(initWithSampleBuffer:))]
230        #[unsafe(method_family = init)]
231        pub unsafe fn initWithSampleBuffer(
232            this: Allocated<Self>,
233            sample_buffer: &CMSampleBuffer,
234        ) -> Option<Retained<Self>>;
235    );
236}
237
238/// Methods declared on superclass `NSObject`.
239impl AVMutableTimedMetadataGroup {
240    extern_methods!(
241        #[unsafe(method(init))]
242        #[unsafe(method_family = init)]
243        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
244
245        #[unsafe(method(new))]
246        #[unsafe(method_family = new)]
247        pub unsafe fn new() -> Retained<Self>;
248    );
249}
250
251extern_class!(
252    /// AVDateRangeMetadataGroup is used to represent a collection of metadata items that are valid for use within a specific range of dates.
253    ///
254    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup?language=objc)
255    #[unsafe(super(AVMetadataGroup, NSObject))]
256    #[derive(Debug, PartialEq, Eq, Hash)]
257    pub struct AVDateRangeMetadataGroup;
258);
259
260unsafe impl NSCopying for AVDateRangeMetadataGroup {}
261
262unsafe impl CopyingHelper for AVDateRangeMetadataGroup {
263    type Result = Self;
264}
265
266unsafe impl NSMutableCopying for AVDateRangeMetadataGroup {}
267
268unsafe impl MutableCopyingHelper for AVDateRangeMetadataGroup {
269    type Result = AVMutableDateRangeMetadataGroup;
270}
271
272unsafe impl NSObjectProtocol for AVDateRangeMetadataGroup {}
273
274impl AVDateRangeMetadataGroup {
275    extern_methods!(
276        #[cfg(feature = "AVMetadataItem")]
277        /// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items.
278        ///
279        /// Parameter `items`: An NSArray of AVMetadataItems.
280        ///
281        /// Parameter `startDate`: The start date of the collection of AVMetadataItems.
282        ///
283        /// Parameter `endDate`: The end date of the collection of AVMetadataItems. If the receiver is intended to represent information about an instantaneous event, the value of endDate should be equal to the value of startDate. A value of nil for endDate indicates that the endDate is indefinite.
284        ///
285        /// Returns: An instance of AVDateRangeMetadataGroup.
286        #[unsafe(method(initWithItems:startDate:endDate:))]
287        #[unsafe(method_family = init)]
288        pub unsafe fn initWithItems_startDate_endDate(
289            this: Allocated<Self>,
290            items: &NSArray<AVMetadataItem>,
291            start_date: &NSDate,
292            end_date: Option<&NSDate>,
293        ) -> Retained<Self>;
294
295        #[unsafe(method(startDate))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn startDate(&self) -> Retained<NSDate>;
298
299        #[unsafe(method(endDate))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
302
303        #[cfg(feature = "AVMetadataItem")]
304        #[unsafe(method(items))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
307    );
308}
309
310/// Methods declared on superclass `NSObject`.
311impl AVDateRangeMetadataGroup {
312    extern_methods!(
313        #[unsafe(method(init))]
314        #[unsafe(method_family = init)]
315        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
316
317        #[unsafe(method(new))]
318        #[unsafe(method_family = new)]
319        pub unsafe fn new() -> Retained<Self>;
320    );
321}
322
323extern_class!(
324    /// AVMutableDateRangeMetadataGroup is used to represent a mutable collection of metadata items that are valid for use within a specific range of dates.
325    ///
326    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup?language=objc)
327    #[unsafe(super(AVDateRangeMetadataGroup, AVMetadataGroup, NSObject))]
328    #[derive(Debug, PartialEq, Eq, Hash)]
329    pub struct AVMutableDateRangeMetadataGroup;
330);
331
332unsafe impl NSCopying for AVMutableDateRangeMetadataGroup {}
333
334unsafe impl CopyingHelper for AVMutableDateRangeMetadataGroup {
335    type Result = AVDateRangeMetadataGroup;
336}
337
338unsafe impl NSMutableCopying for AVMutableDateRangeMetadataGroup {}
339
340unsafe impl MutableCopyingHelper for AVMutableDateRangeMetadataGroup {
341    type Result = Self;
342}
343
344unsafe impl NSObjectProtocol for AVMutableDateRangeMetadataGroup {}
345
346impl AVMutableDateRangeMetadataGroup {
347    extern_methods!(
348        #[unsafe(method(startDate))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn startDate(&self) -> Retained<NSDate>;
351
352        /// Setter for [`startDate`][Self::startDate].
353        #[unsafe(method(setStartDate:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn setStartDate(&self, start_date: &NSDate);
356
357        #[unsafe(method(endDate))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
360
361        /// Setter for [`endDate`][Self::endDate].
362        #[unsafe(method(setEndDate:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn setEndDate(&self, end_date: Option<&NSDate>);
365
366        #[cfg(feature = "AVMetadataItem")]
367        #[unsafe(method(items))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
370
371        #[cfg(feature = "AVMetadataItem")]
372        /// Setter for [`items`][Self::items].
373        #[unsafe(method(setItems:))]
374        #[unsafe(method_family = none)]
375        pub unsafe fn setItems(&self, items: &NSArray<AVMetadataItem>);
376    );
377}
378
379/// Methods declared on superclass `AVDateRangeMetadataGroup`.
380impl AVMutableDateRangeMetadataGroup {
381    extern_methods!(
382        #[cfg(feature = "AVMetadataItem")]
383        /// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items.
384        ///
385        /// Parameter `items`: An NSArray of AVMetadataItems.
386        ///
387        /// Parameter `startDate`: The start date of the collection of AVMetadataItems.
388        ///
389        /// Parameter `endDate`: The end date of the collection of AVMetadataItems. If the receiver is intended to represent information about an instantaneous event, the value of endDate should be equal to the value of startDate. A value of nil for endDate indicates that the endDate is indefinite.
390        ///
391        /// Returns: An instance of AVDateRangeMetadataGroup.
392        #[unsafe(method(initWithItems:startDate:endDate:))]
393        #[unsafe(method_family = init)]
394        pub unsafe fn initWithItems_startDate_endDate(
395            this: Allocated<Self>,
396            items: &NSArray<AVMetadataItem>,
397            start_date: &NSDate,
398            end_date: Option<&NSDate>,
399        ) -> Retained<Self>;
400    );
401}
402
403/// Methods declared on superclass `NSObject`.
404impl AVMutableDateRangeMetadataGroup {
405    extern_methods!(
406        #[unsafe(method(init))]
407        #[unsafe(method_family = init)]
408        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
409
410        #[unsafe(method(new))]
411        #[unsafe(method_family = new)]
412        pub unsafe fn new() -> Retained<Self>;
413    );
414}