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