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        ///
213        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
214        #[unsafe(method(setItems:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn setItems(&self, items: &NSArray<AVMetadataItem>);
217    );
218}
219
220/// Methods declared on superclass `AVTimedMetadataGroup`.
221impl AVMutableTimedMetadataGroup {
222    extern_methods!(
223        #[cfg(all(feature = "AVMetadataItem", feature = "objc2-core-media"))]
224        /// Initializes an instance of AVTimedMetadataGroup with a collection of metadata items.
225        ///
226        /// Parameter `items`: An NSArray of AVMetadataItems.
227        ///
228        /// Parameter `timeRange`: The timeRange of the collection of AVMetadataItems.
229        ///
230        /// Returns: An instance of AVTimedMetadataGroup.
231        #[unsafe(method(initWithItems:timeRange:))]
232        #[unsafe(method_family = init)]
233        pub unsafe fn initWithItems_timeRange(
234            this: Allocated<Self>,
235            items: &NSArray<AVMetadataItem>,
236            time_range: CMTimeRange,
237        ) -> Retained<Self>;
238
239        #[cfg(feature = "objc2-core-media")]
240        /// Initializes an instance of AVTimedMetadataGroup with a sample buffer.
241        ///
242        /// Parameter `sampleBuffer`: A CMSampleBuffer with media type kCMMediaType_Metadata.
243        ///
244        /// Returns: An instance of AVTimedMetadataGroup.
245        #[unsafe(method(initWithSampleBuffer:))]
246        #[unsafe(method_family = init)]
247        pub unsafe fn initWithSampleBuffer(
248            this: Allocated<Self>,
249            sample_buffer: &CMSampleBuffer,
250        ) -> Option<Retained<Self>>;
251    );
252}
253
254/// Methods declared on superclass `NSObject`.
255impl AVMutableTimedMetadataGroup {
256    extern_methods!(
257        #[unsafe(method(init))]
258        #[unsafe(method_family = init)]
259        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
260
261        #[unsafe(method(new))]
262        #[unsafe(method_family = new)]
263        pub unsafe fn new() -> Retained<Self>;
264    );
265}
266
267extern_class!(
268    /// AVDateRangeMetadataGroup is used to represent a collection of metadata items that are valid for use within a specific range of dates.
269    ///
270    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avdaterangemetadatagroup?language=objc)
271    #[unsafe(super(AVMetadataGroup, NSObject))]
272    #[derive(Debug, PartialEq, Eq, Hash)]
273    pub struct AVDateRangeMetadataGroup;
274);
275
276extern_conformance!(
277    unsafe impl NSCopying for AVDateRangeMetadataGroup {}
278);
279
280unsafe impl CopyingHelper for AVDateRangeMetadataGroup {
281    type Result = Self;
282}
283
284extern_conformance!(
285    unsafe impl NSMutableCopying for AVDateRangeMetadataGroup {}
286);
287
288unsafe impl MutableCopyingHelper for AVDateRangeMetadataGroup {
289    type Result = AVMutableDateRangeMetadataGroup;
290}
291
292extern_conformance!(
293    unsafe impl NSObjectProtocol for AVDateRangeMetadataGroup {}
294);
295
296impl AVDateRangeMetadataGroup {
297    extern_methods!(
298        #[cfg(feature = "AVMetadataItem")]
299        /// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items.
300        ///
301        /// Parameter `items`: An NSArray of AVMetadataItems.
302        ///
303        /// Parameter `startDate`: The start date of the collection of AVMetadataItems.
304        ///
305        /// 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.
306        ///
307        /// Returns: An instance of AVDateRangeMetadataGroup.
308        #[unsafe(method(initWithItems:startDate:endDate:))]
309        #[unsafe(method_family = init)]
310        pub unsafe fn initWithItems_startDate_endDate(
311            this: Allocated<Self>,
312            items: &NSArray<AVMetadataItem>,
313            start_date: &NSDate,
314            end_date: Option<&NSDate>,
315        ) -> Retained<Self>;
316
317        #[unsafe(method(startDate))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn startDate(&self) -> Retained<NSDate>;
320
321        #[unsafe(method(endDate))]
322        #[unsafe(method_family = none)]
323        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
324
325        #[cfg(feature = "AVMetadataItem")]
326        #[unsafe(method(items))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
329    );
330}
331
332/// Methods declared on superclass `NSObject`.
333impl AVDateRangeMetadataGroup {
334    extern_methods!(
335        #[unsafe(method(init))]
336        #[unsafe(method_family = init)]
337        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
338
339        #[unsafe(method(new))]
340        #[unsafe(method_family = new)]
341        pub unsafe fn new() -> Retained<Self>;
342    );
343}
344
345extern_class!(
346    /// AVMutableDateRangeMetadataGroup is used to represent a mutable collection of metadata items that are valid for use within a specific range of dates.
347    ///
348    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutabledaterangemetadatagroup?language=objc)
349    #[unsafe(super(AVDateRangeMetadataGroup, AVMetadataGroup, NSObject))]
350    #[derive(Debug, PartialEq, Eq, Hash)]
351    pub struct AVMutableDateRangeMetadataGroup;
352);
353
354extern_conformance!(
355    unsafe impl NSCopying for AVMutableDateRangeMetadataGroup {}
356);
357
358unsafe impl CopyingHelper for AVMutableDateRangeMetadataGroup {
359    type Result = AVDateRangeMetadataGroup;
360}
361
362extern_conformance!(
363    unsafe impl NSMutableCopying for AVMutableDateRangeMetadataGroup {}
364);
365
366unsafe impl MutableCopyingHelper for AVMutableDateRangeMetadataGroup {
367    type Result = Self;
368}
369
370extern_conformance!(
371    unsafe impl NSObjectProtocol for AVMutableDateRangeMetadataGroup {}
372);
373
374impl AVMutableDateRangeMetadataGroup {
375    extern_methods!(
376        #[unsafe(method(startDate))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn startDate(&self) -> Retained<NSDate>;
379
380        /// Setter for [`startDate`][Self::startDate].
381        ///
382        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
383        #[unsafe(method(setStartDate:))]
384        #[unsafe(method_family = none)]
385        pub unsafe fn setStartDate(&self, start_date: &NSDate);
386
387        #[unsafe(method(endDate))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
390
391        /// Setter for [`endDate`][Self::endDate].
392        ///
393        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
394        #[unsafe(method(setEndDate:))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn setEndDate(&self, end_date: Option<&NSDate>);
397
398        #[cfg(feature = "AVMetadataItem")]
399        #[unsafe(method(items))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn items(&self) -> Retained<NSArray<AVMetadataItem>>;
402
403        #[cfg(feature = "AVMetadataItem")]
404        /// Setter for [`items`][Self::items].
405        ///
406        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
407        #[unsafe(method(setItems:))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn setItems(&self, items: &NSArray<AVMetadataItem>);
410    );
411}
412
413/// Methods declared on superclass `AVDateRangeMetadataGroup`.
414impl AVMutableDateRangeMetadataGroup {
415    extern_methods!(
416        #[cfg(feature = "AVMetadataItem")]
417        /// Initializes an instance of AVDateRangeMetadataGroup with a collection of metadata items.
418        ///
419        /// Parameter `items`: An NSArray of AVMetadataItems.
420        ///
421        /// Parameter `startDate`: The start date of the collection of AVMetadataItems.
422        ///
423        /// 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.
424        ///
425        /// Returns: An instance of AVDateRangeMetadataGroup.
426        #[unsafe(method(initWithItems:startDate:endDate:))]
427        #[unsafe(method_family = init)]
428        pub unsafe fn initWithItems_startDate_endDate(
429            this: Allocated<Self>,
430            items: &NSArray<AVMetadataItem>,
431            start_date: &NSDate,
432            end_date: Option<&NSDate>,
433        ) -> Retained<Self>;
434    );
435}
436
437/// Methods declared on superclass `NSObject`.
438impl AVMutableDateRangeMetadataGroup {
439    extern_methods!(
440        #[unsafe(method(init))]
441        #[unsafe(method_family = init)]
442        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
443
444        #[unsafe(method(new))]
445        #[unsafe(method_family = new)]
446        pub unsafe fn new() -> Retained<Self>;
447    );
448}