objc2-av-foundation 0.3.2

Bindings to the AVFoundation framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataitem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataItem;
);

#[cfg(feature = "AVAsynchronousKeyValueLoading")]
extern_conformance!(
    unsafe impl AVAsynchronousKeyValueLoading for AVMetadataItem {}
);

extern_conformance!(
    unsafe impl NSCopying for AVMetadataItem {}
);

unsafe impl CopyingHelper for AVMetadataItem {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSMutableCopying for AVMetadataItem {}
);

unsafe impl MutableCopyingHelper for AVMetadataItem {
    type Result = AVMutableMetadataItem;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataItem {}
);

impl AVMetadataItem {
    extern_methods!(
        #[cfg(feature = "AVMetadataIdentifiers")]
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<AVMetadataIdentifier>>;

        #[unsafe(method(extendedLanguageTag))]
        #[unsafe(method_family = none)]
        pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;

        #[cfg(feature = "objc2-core-media")]
        #[unsafe(method(time))]
        #[unsafe(method_family = none)]
        pub unsafe fn time(&self) -> CMTime;

        #[cfg(feature = "objc2-core-media")]
        #[unsafe(method(duration))]
        #[unsafe(method_family = none)]
        pub unsafe fn duration(&self) -> CMTime;

        #[unsafe(method(dataType))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataType(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(value))]
        #[unsafe(method_family = none)]
        pub unsafe fn value(&self)
            -> Option<Retained<AnyObject /* NSObjectProtocol+ NSCopying */>>;

        #[cfg(feature = "AVMetadataFormat")]
        #[unsafe(method(extraAttributes))]
        #[unsafe(method_family = none)]
        pub unsafe fn extraAttributes(
            &self,
        ) -> Option<Retained<NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMetadataItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMetadataItemDateRepresentation.
impl AVMetadataItem {
    extern_methods!(
        #[unsafe(method(startDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;
    );
}

/// AVMetadataItemTypeCoercion.
impl AVMetadataItem {
    extern_methods!(
        #[unsafe(method(stringValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(numberValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn numberValue(&self) -> Option<Retained<NSNumber>>;

        #[unsafe(method(dateValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn dateValue(&self) -> Option<Retained<NSDate>>;

        #[unsafe(method(dataValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataValue(&self) -> Option<Retained<NSData>>;
    );
}

/// AVAsynchronousKeyValueLoading.
impl AVMetadataItem {
    extern_methods!(
        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `handler` block must be sendable.
        #[unsafe(method(loadValuesAsynchronouslyForKeys:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadValuesAsynchronouslyForKeys_completionHandler(
            &self,
            keys: &NSArray<NSString>,
            handler: Option<&block2::DynBlock<dyn Fn()>>,
        );
    );
}

/// AVMetadataItemArrayFiltering.
impl AVMetadataItem {
    extern_methods!(
        /// Filters an array of AVMetadataItems according to whether their locales match any language identifier in the specified array of preferred languages. The returned array is sorted according to the order of preference of the language each matches.
        ///
        /// Parameter `metadataItems`: An array of AVMetadataItems to be filtered and sorted.
        ///
        /// Parameter `preferredLanguages`: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. If your goal is to provide the best match for the end user's preferred languages without consideration of your app's available localizations, pass [NSLocale preferredLanguages] as the value of preferredLanguages. However, if you want to filter the available choices in order to obtain the best match among the localizations that are available for your app, pass [NSBundle preferredLocalizationsFromArray:[[NSBundle mainBundle] localizations] forPreferences:[NSLocale preferredLanguages]] instead. The latter choice is normally more appropriate for strings intended for display as part of the app's UI.
        ///
        /// Returns: An instance of NSArray containing metadata items of the specified NSArray that match a preferred language, sorted according to the order of preference of the language each matches.
        #[unsafe(method(metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemsFromArray_filteredAndSortedAccordingToPreferredLanguages(
            metadata_items: &NSArray<AVMetadataItem>,
            preferred_languages: &NSArray<NSString>,
        ) -> Retained<NSArray<AVMetadataItem>>;

        #[cfg(feature = "AVMetadataIdentifiers")]
        /// Filters an array of AVMetadataItems according to identifier.
        ///
        /// Parameter `metadataItems`: An array of AVMetadataItems to be filtered by identifier.
        ///
        /// Parameter `identifier`: The identifier that must be matched for a metadata item to be copied to the output array. Items are considered a match not only when their identifiers are equal to the specified identifier, and also when their identifiers conform to the specified identifier.
        ///
        /// Returns: An instance of NSArray containing the metadata items of the target NSArray that match the specified identifier.
        #[unsafe(method(metadataItemsFromArray:filteredByIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemsFromArray_filteredByIdentifier(
            metadata_items: &NSArray<AVMetadataItem>,
            identifier: &AVMetadataIdentifier,
        ) -> Retained<NSArray<AVMetadataItem>>;

        /// Filters an array of AVMetadataItems using the supplied AVMetadataItemFilter.
        ///
        /// Parameter `metadataItems`: An array of AVMetadataItems to be filtered.
        ///
        /// Parameter `metadataItemFilter`: The AVMetadataItemFilter object for filtering the metadataItems.
        ///
        /// Returns: An instance of NSArray containing the metadata items of the target NSArray that have not been removed by metadataItemFilter.
        #[unsafe(method(metadataItemsFromArray:filteredByMetadataItemFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemsFromArray_filteredByMetadataItemFilter(
            metadata_items: &NSArray<AVMetadataItem>,
            metadata_item_filter: &AVMetadataItemFilter,
        ) -> Retained<NSArray<AVMetadataItem>>;
    );
}

/// AVMetadataItemKeyAndKeyspace.
impl AVMetadataItem {
    extern_methods!(
        #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataIdentifiers"))]
        /// Provides the metadata identifier that's equivalent to a key and keySpace.
        ///
        /// Parameter `key`: The metadata key.
        ///
        /// Parameter `keySpace`: The metadata keySpace.
        ///
        /// Returns: A metadata identifier equivalent to the given key and keySpace, or nil if no identifier can be constructed from the given key and keySpace.
        ///
        /// Metadata keys that are not instances of NSString, NSNumber, or NSData cannot be converted to metadata identifiers; they also cannot be written to media resources via AVAssetExportSession or AVAssetWriter.  Metadata item keySpaces must be a string of one to four printable ASCII characters.
        ///
        /// For custom identifiers, the keySpace AVMetadataKeySpaceQuickTimeMetadata is recommended.  This keySpace defines its key values to be expressed as reverse-DNS strings, which allows third parties to define their own keys in a well established way that avoids collisions.
        ///
        /// # Safety
        ///
        /// `key` should be of the correct type.
        #[unsafe(method(identifierForKey:keySpace:))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifierForKey_keySpace(
            key: &AnyObject,
            key_space: &AVMetadataKeySpace,
        ) -> Option<Retained<AVMetadataIdentifier>>;

        #[cfg(all(feature = "AVMetadataFormat", feature = "AVMetadataIdentifiers"))]
        #[unsafe(method(keySpaceForIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn keySpaceForIdentifier(
            identifier: &AVMetadataIdentifier,
        ) -> Option<Retained<AVMetadataKeySpace>>;

        #[cfg(feature = "AVMetadataIdentifiers")]
        #[unsafe(method(keyForIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn keyForIdentifier(
            identifier: &AVMetadataIdentifier,
        ) -> Option<Retained<AnyObject>>;

        #[unsafe(method(key))]
        #[unsafe(method_family = none)]
        pub unsafe fn key(&self) -> Option<Retained<AnyObject /* NSObjectProtocol+ NSCopying */>>;

        #[cfg(feature = "AVMetadataFormat")]
        #[unsafe(method(commonKey))]
        #[unsafe(method_family = none)]
        pub unsafe fn commonKey(&self) -> Option<Retained<AVMetadataKey>>;

        #[cfg(feature = "AVMetadataFormat")]
        #[unsafe(method(keySpace))]
        #[unsafe(method_family = none)]
        pub unsafe fn keySpace(&self) -> Option<Retained<AVMetadataKeySpace>>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmutablemetadataitem?language=objc)
    #[unsafe(super(AVMetadataItem, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMutableMetadataItem;
);

#[cfg(feature = "AVAsynchronousKeyValueLoading")]
extern_conformance!(
    unsafe impl AVAsynchronousKeyValueLoading for AVMutableMetadataItem {}
);

extern_conformance!(
    unsafe impl NSCopying for AVMutableMetadataItem {}
);

unsafe impl CopyingHelper for AVMutableMetadataItem {
    type Result = AVMetadataItem;
}

extern_conformance!(
    unsafe impl NSMutableCopying for AVMutableMetadataItem {}
);

unsafe impl MutableCopyingHelper for AVMutableMetadataItem {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMutableMetadataItem {}
);

impl AVMutableMetadataItem {
    extern_methods!(
        #[cfg(feature = "AVMetadataIdentifiers")]
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<AVMetadataIdentifier>>;

        #[cfg(feature = "AVMetadataIdentifiers")]
        /// Setter for [`identifier`][Self::identifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIdentifier(&self, identifier: Option<&AVMetadataIdentifier>);

        #[unsafe(method(extendedLanguageTag))]
        #[unsafe(method_family = none)]
        pub unsafe fn extendedLanguageTag(&self) -> Option<Retained<NSString>>;

        /// Setter for [`extendedLanguageTag`][Self::extendedLanguageTag].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setExtendedLanguageTag:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setExtendedLanguageTag(&self, extended_language_tag: Option<&NSString>);

        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;

        /// Setter for [`locale`][Self::locale].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);

        #[cfg(feature = "objc2-core-media")]
        #[unsafe(method(time))]
        #[unsafe(method_family = none)]
        pub unsafe fn time(&self) -> CMTime;

        #[cfg(feature = "objc2-core-media")]
        /// Setter for [`time`][Self::time].
        #[unsafe(method(setTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTime(&self, time: CMTime);

        #[cfg(feature = "objc2-core-media")]
        #[unsafe(method(duration))]
        #[unsafe(method_family = none)]
        pub unsafe fn duration(&self) -> CMTime;

        #[cfg(feature = "objc2-core-media")]
        /// Setter for [`duration`][Self::duration].
        #[unsafe(method(setDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDuration(&self, duration: CMTime);

        #[unsafe(method(dataType))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataType(&self) -> Option<Retained<NSString>>;

        /// Setter for [`dataType`][Self::dataType].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDataType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDataType(&self, data_type: Option<&NSString>);

        #[unsafe(method(value))]
        #[unsafe(method_family = none)]
        pub unsafe fn value(&self)
            -> Option<Retained<AnyObject /* NSObjectProtocol+ NSCopying */>>;

        /// Setter for [`value`][Self::value].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `value` should be of the correct type.
        #[unsafe(method(setValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValue(&self, value: Option<&AnyObject /* NSObjectProtocol+ NSCopying */>);

        #[cfg(feature = "AVMetadataFormat")]
        #[unsafe(method(extraAttributes))]
        #[unsafe(method_family = none)]
        pub unsafe fn extraAttributes(
            &self,
        ) -> Option<Retained<NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>>;

        #[cfg(feature = "AVMetadataFormat")]
        /// Setter for [`extraAttributes`][Self::extraAttributes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `extra_attributes` generic should be of the correct type.
        #[unsafe(method(setExtraAttributes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setExtraAttributes(
            &self,
            extra_attributes: Option<&NSDictionary<AVMetadataExtraAttributeKey, AnyObject>>,
        );

        /// Returns an instance of AVMutableMetadataItem.
        #[unsafe(method(metadataItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItem() -> Retained<AVMutableMetadataItem>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMutableMetadataItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMutableMetadataItemDateRepresentation.
impl AVMutableMetadataItem {
    extern_methods!(
        #[unsafe(method(startDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;

        /// Setter for [`startDate`][Self::startDate].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setStartDate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartDate(&self, start_date: Option<&NSDate>);
    );
}

/// AVMutableMetadataItemKeyAndKeyspace.
impl AVMutableMetadataItem {
    extern_methods!(
        #[cfg(feature = "AVMetadataFormat")]
        #[unsafe(method(keySpace))]
        #[unsafe(method_family = none)]
        pub unsafe fn keySpace(&self) -> Option<Retained<AVMetadataKeySpace>>;

        #[cfg(feature = "AVMetadataFormat")]
        /// Setter for [`keySpace`][Self::keySpace].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setKeySpace:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setKeySpace(&self, key_space: Option<&AVMetadataKeySpace>);

        #[unsafe(method(key))]
        #[unsafe(method_family = none)]
        pub unsafe fn key(&self) -> Option<Retained<AnyObject /* NSObjectProtocol+ NSCopying */>>;

        /// Setter for [`key`][Self::key].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `key` should be of the correct type.
        #[unsafe(method(setKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setKey(&self, key: Option<&AnyObject /* NSObjectProtocol+ NSCopying */>);
    );
}

/// AVMetadataItemLazyValueLoading.
impl AVMetadataItem {
    extern_methods!(
        #[cfg(feature = "block2")]
        /// Creates an instance of AVMutableMetadataItem with a value that you do not wish to load unless required, e.g. a large image value that needn't be loaded into memory until another module wants to display it.
        ///
        /// Parameter `metadataItem`: An instance of AVMetadataItem with the identifier, extendedLanguageTag, and other property values that you want the newly created instance of AVMetadataItem to share. The value of metadataItem is ignored.
        ///
        /// Parameter `handler`: A block that loads the value of the metadata item.
        ///
        /// Returns: An instance of AVMetadataItem.
        ///
        /// This method is intended for the creation of metadata items for optional display purposes, when there is no immediate need to load specific metadata values. For example, see the interface for navigation markers as consumed by AVPlayerViewController. It's not intended for the creation of metadata items with values that are required immediately, such as metadata items that are provided for impending serialization operations (e.g. via -[AVAssetExportSession setMetadata:] and other similar methods defined on AVAssetWriter and AVAssetWriterInput).
        /// When -loadValuesAsynchronouslyForKeys:completionHandler: is invoked on an AVMetadataItem created via +metadataItemWithPropertiesOfMetadataItem:valueLoadingHandler: and
        /// "
        /// value" is among the keys for which loading is requested, the block you provide as the value loading handler will be executed on an arbitrary dispatch queue, off the main thread. The handler can perform I/O and other necessary operations to obtain the value. If loading of the value succeeds, provide the value by invoking -[AVMetadataItemValueRequest respondWithValue:]. If loading of the value fails, provide an instance of NSError that describes the failure by invoking -[AVMetadataItemValueRequest respondWithError:].
        ///
        /// # Safety
        ///
        /// `handler` block must be sendable.
        #[unsafe(method(metadataItemWithPropertiesOfMetadataItem:valueLoadingHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemWithPropertiesOfMetadataItem_valueLoadingHandler(
            metadata_item: &AVMetadataItem,
            handler: &block2::DynBlock<dyn Fn(NonNull<AVMetadataItemValueRequest>)>,
        ) -> Retained<AVMetadataItem>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataitemvaluerequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataItemValueRequest;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataItemValueRequest {}
);

impl AVMetadataItemValueRequest {
    extern_methods!(
        #[unsafe(method(metadataItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItem(&self) -> Option<Retained<AVMetadataItem>>;

        /// Allows you to respond to an AVMetadataItemValueRequest by providing a value.
        ///
        /// Parameter `value`: The value of the AVMetadataItem.
        ///
        /// # Safety
        ///
        /// `value` should be of the correct type.
        #[unsafe(method(respondWithValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn respondWithValue(
            &self,
            value: &AnyObject, /* NSObjectProtocol+ NSCopying */
        );

        /// Allows you to respond to an AVMetadataItemValueRequest in the case of failure.
        ///
        /// Parameter `error`: An instance of NSError that describes a failure encountered while loading the value of an AVMetadataItem.
        #[unsafe(method(respondWithError:))]
        #[unsafe(method_family = none)]
        pub unsafe fn respondWithError(&self, error: &NSError);
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMetadataItemValueRequest {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Filters selected information from a metadata item.
    ///
    /// Subclasses of this type that are used from Swift must fulfill the requirements of a Sendable type.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avmetadataitemfilter?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVMetadataItemFilter;
);

unsafe impl Send for AVMetadataItemFilter {}

unsafe impl Sync for AVMetadataItemFilter {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVMetadataItemFilter {}
);

impl AVMetadataItemFilter {
    extern_methods!(
        #[unsafe(method(metadataItemFilterForSharing))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemFilterForSharing() -> Retained<AVMetadataItemFilter>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVMetadataItemFilter {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// AVMetadataItemArrayFilteringDeprecable.
impl AVMetadataItem {
    extern_methods!(
        /// Instead, use metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:.
        #[unsafe(method(metadataItemsFromArray:withLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemsFromArray_withLocale(
            metadata_items: &NSArray<AVMetadataItem>,
            locale: &NSLocale,
        ) -> Retained<NSArray<AVMetadataItem>>;

        #[cfg(feature = "AVMetadataFormat")]
        /// Instead, use metadataItemsFromArray:filteredByIdentifier:.
        ///
        /// # Safety
        ///
        /// `key` should be of the correct type.
        #[unsafe(method(metadataItemsFromArray:withKey:keySpace:))]
        #[unsafe(method_family = none)]
        pub unsafe fn metadataItemsFromArray_withKey_keySpace(
            metadata_items: &NSArray<AVMetadataItem>,
            key: Option<&AnyObject>,
            key_space: Option<&AVMetadataKeySpace>,
        ) -> Retained<NSArray<AVMetadataItem>>;
    );
}

/// SynchronousMetadataItemInterface.
///
/// Redeclarations of async-only AVMetadataItem interfaces to allow synchronous usage in the mutable subclass.
///
/// See AVMetadataItem's interface for more information about these interfaces.
impl AVMutableMetadataItem {
    extern_methods!();
}