objc2-core-media 0.3.2

Bindings to the CoreMedia 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
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2_core_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_allocationfailed?language=objc)
pub const kCMMetadataIdentifierError_AllocationFailed: OSStatus = -16300;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_requiredparametermissing?language=objc)
pub const kCMMetadataIdentifierError_RequiredParameterMissing: OSStatus = -16301;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badkey?language=objc)
pub const kCMMetadataIdentifierError_BadKey: OSStatus = -16302;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badkeylength?language=objc)
pub const kCMMetadataIdentifierError_BadKeyLength: OSStatus = -16303;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badkeytype?language=objc)
pub const kCMMetadataIdentifierError_BadKeyType: OSStatus = -16304;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badnumberkey?language=objc)
pub const kCMMetadataIdentifierError_BadNumberKey: OSStatus = -16305;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badkeyspace?language=objc)
pub const kCMMetadataIdentifierError_BadKeySpace: OSStatus = -16306;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_badidentifier?language=objc)
pub const kCMMetadataIdentifierError_BadIdentifier: OSStatus = -16307;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifiererror_nokeyvalueavailable?language=objc)
pub const kCMMetadataIdentifierError_NoKeyValueAvailable: OSStatus = -16308;

/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_allocationfailed?language=objc)
pub const kCMMetadataDataTypeRegistryError_AllocationFailed: OSStatus = -16310;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_requiredparametermissing?language=objc)
pub const kCMMetadataDataTypeRegistryError_RequiredParameterMissing: OSStatus = -16311;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_baddatatypeidentifier?language=objc)
pub const kCMMetadataDataTypeRegistryError_BadDataTypeIdentifier: OSStatus = -16312;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_datatypealreadyregistered?language=objc)
pub const kCMMetadataDataTypeRegistryError_DataTypeAlreadyRegistered: OSStatus = -16313;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_requiresconformingbasetype?language=objc)
pub const kCMMetadataDataTypeRegistryError_RequiresConformingBaseType: OSStatus = -16314;
/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatyperegistryerror_multipleconformingbasetypes?language=objc)
pub const kCMMetadataDataTypeRegistryError_MultipleConformingBaseTypes: OSStatus = -16315;

extern "C" {
    /// Metadata keyspace for QuickTime User Data keys.
    ///
    /// Metadata keyspace for MPEG-4 User Data keys.
    ///
    /// Metadata keyspace for QuickTime Metadata keys.
    ///
    /// Metadata keyspace for iTunes keys.
    ///
    /// Metadata keyspace for ID3 keys.
    ///
    /// Metadata keyspace for ShoutCast keys.
    ///
    /// Metadata keyspace for HLS DateRange tags.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_quicktimeuserdata?language=objc)
    pub static kCMMetadataKeySpace_QuickTimeUserData: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_isouserdata?language=objc)
    pub static kCMMetadataKeySpace_ISOUserData: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_quicktimemetadata?language=objc)
    pub static kCMMetadataKeySpace_QuickTimeMetadata: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_itunes?language=objc)
    pub static kCMMetadataKeySpace_iTunes: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_id3?language=objc)
    pub static kCMMetadataKeySpace_ID3: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_icy?language=objc)
    pub static kCMMetadataKeySpace_Icy: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatakeyspace_hlsdaterange?language=objc)
    pub static kCMMetadataKeySpace_HLSDateRange: &'static CFString;
}

extern "C" {
    /// Location information in ISO-6709 format.
    ///
    /// Direction the observer is facing.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatalocation_iso6709?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataLocation_ISO6709: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatadirection_facing?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataDirection_Facing: &'static CFString;
}

extern "C" {
    /// An affine transform that can be used in place of a track matrix for
    /// displaying a video track, to better reflect the current orientation
    /// of a video camera with respect to a scene.  For example, if the camera
    /// is rotated after a recording has started, the presence of this metadata
    /// will allow a player to adjust its rendering at the time the rotation occurred.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatapreferredaffinetransform?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataPreferredAffineTransform: &'static CFString;
}

extern "C" {
    /// Video orientation as defined by TIFF/EXIF, which is enumerated by CGImagePropertyOrientation
    /// (see
    /// <ImageIO
    /// /CGImageProperties.h>).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatavideoorientation?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataVideoOrientation: &'static CFString;
}

extern "C" {
    /// A perspective transform that can be used to adjust a Live Photo still image to match the Live Photo movie.
    /// Expected data type is kCMMetadataBaseDataType_PerspectiveTransformF64.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatalivephotostillimagetransform?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransform:
        &'static CFString;
}

extern "C" {
    /// The dimensions of the image used to generate kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransform.
    /// Expected data type is kCMMetadataBaseDataType_DimensionsF32.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatalivephotostillimagetransformreferencedimensions?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataLivePhotoStillImageTransformReferenceDimensions:
        &'static CFString;
}

extern "C" {
    /// A segment identifier, used to support movies where pause/resume has been used.
    /// Expected data type is kCMMetadataDataType_QuickTimeMetadataUUID.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatasegmentidentifier?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataSegmentIdentifier: &'static CFString;
}

extern "C" {
    /// Scene illuminance measured in units of Lux.
    /// Expected data type is kCMMetadataDataType_QuickTimeMetadataMilliLux.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatasceneilluminance?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataSceneIlluminance: &'static CFString;
}

extern "C" {
    /// Data associated with a Spatial Audio capture that contains an analysis of a First Order Ambisonics audio stream which is used for playback.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadataspatialaudiomix?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataSpatialAudioMix: &'static CFString;
}

extern "C" {
    /// Display mask rectangle for monoscopic video
    /// Expected data type is kCMMetadataBaseDataType_RasterRectangleValue.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatadisplaymaskrectanglemono?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataDisplayMaskRectangleMono: &'static CFString;
}

extern "C" {
    /// Display mask rectangle for stereoscopic video's left eye view
    /// Expected data type is kCMMetadataBaseDataType_RasterRectangleValue or kCMMetadataBaseDataType_ExtendedRasterRectangleValue.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatadisplaymaskrectanglestereoleft?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataDisplayMaskRectangleStereoLeft:
        &'static CFString;
}

extern "C" {
    /// Display mask rectangle for stereoscopic video's right eye view
    /// Expected data type is kCMMetadataBaseDataType_RasterRectangleValue or kCMMetadataBaseDataType_ExtendedRasterRectangleValue.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatadisplaymaskrectanglestereoright?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataDisplayMaskRectangleStereoRight:
        &'static CFString;
}

extern "C" {
    /// Presentation data associated with Apple Immersive Video's video frames. Data is a JSON-encoding of ImmersiveMediaSupport framework's PresentationDescriptor object.
    /// Expected data type is kCMMetadataBaseDataType_RawData.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadataidentifier_quicktimemetadatapresentationimmersivemedia?language=objc)
    pub static kCMMetadataIdentifier_QuickTimeMetadataPresentationImmersiveMedia: &'static CFString;
}

extern "C-unwind" {
    /// Creates a URL-like string identifier that represents a key/keyspace tuple.
    ///
    /// Metadata entities are identified by a key whose interpretation
    /// is defined by its keyspace.  When writing metadata to a QuickTime
    /// Movie, this tuple is part of the track's format description.
    ///
    /// The following constants make up the current list of supported keyspaces,
    /// which are documented elsewhere in this file:
    /// <ul>
    /// kCMMetadataKeySpace_QuickTimeUserData
    /// <li>
    /// kCMMetadataKeySpace_ISOUserData
    /// <li>
    /// kCMMetadataKeySpace_iTunes
    /// <li>
    /// kCMMetadataKeySpace_ID3
    /// <li>
    /// kCMMetadataKeySpace_QuickTimeMetadata
    /// <li>
    /// kCMMetadataKeySpace_Icy
    /// </ul>
    /// Some keyspaces use OSTypes (a.k.a. FourCharCodes) to define their
    /// keys, and as such their keys are four bytes in length. The keyspaces
    /// that fall into this category are: kCMMetadataKeySpace_QuickTimeUserData,
    /// kCMMetadataKeySpace_ISOUserData, kCMMetadataKeySpace_iTunes, and
    /// kCMMetadataKeySpace_ID3.
    ///
    /// The keyspace kCMMetadataKeySpace_QuickTimeMetadata 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.
    ///
    /// As a matter of convenience, known keyspaces allow for a key
    /// to be passed in using a variety of CFTypes.  Note that what
    /// is returned by CMMetadataCreateKeyFromIdentifier depends upon the
    /// keyspace, and may be a different CFType than what is passed
    /// to this routine (see the discussion below for what CFTypes are
    /// returned for known keyspaces).  To get a key represented as
    /// CFData, call CMMetadataCreateKeyFromIdentifierAsCFData.
    ///
    /// For OSType keyspaces, a key may be passed as a CFNumber,
    /// a CFString, or a CFData. A key passed as a CFNumber will have
    /// its value retrieved as kCFNumberSInt32Type comprising the four
    /// bytes of the key’s numeric value in big-endian byte order.
    /// A key passed as a CFString must be a valid ASCII string of four
    /// characters. A key passed as a CFData must be comprised of the
    /// four bytes of the key’s numeric value in big-endian byte order.
    ///
    /// All other keyspaces allow the key to be passed as a CFString
    /// or CFData. In both cases, the key will be interpreted as an
    /// ASCII string for the purposes of identifier encoding.
    ///
    /// # Safety
    ///
    /// - `key` should be of the correct type.
    /// - `identifier_out` must be a valid pointer.
    pub fn CMMetadataCreateIdentifierForKeyAndKeySpace(
        allocator: Option<&CFAllocator>,
        key: &CFType,
        key_space: &CFString,
        identifier_out: NonNull<*const CFString>,
    ) -> OSStatus;
}

extern "C-unwind" {
    /// Creates a copy of the key encoded in the identifier as a CFType.
    ///
    /// The returned CFType is based on the keyspace encoded in the identifier.
    ///
    /// For OSType keyspaces, the key will be returned as a CFNumber,
    /// where a big endian interpretation of its kCFNumberSInt32Type value
    /// represents the four bytes of the key's numeric value.
    ///
    /// For the keyspaces kCMMetadataKeySpace_QuickTimeMetadata and
    /// kCMMetadataKeySpace_Icy, the key will be returned as a CFString.
    ///
    /// All other keyspaces will have the function return the key as a CFData.
    ///
    /// # Safety
    ///
    /// `key_out` must be a valid pointer.
    pub fn CMMetadataCreateKeyFromIdentifier(
        allocator: Option<&CFAllocator>,
        identifier: &CFString,
        key_out: NonNull<*const CFType>,
    ) -> OSStatus;
}

extern "C-unwind" {
    /// Creates a copy of the key value that was encoded in the identifier as CFData.
    /// The bytes in the CFData correpsond to how they are serialized in the file.
    ///
    /// # Safety
    ///
    /// `key_out` must be a valid pointer.
    pub fn CMMetadataCreateKeyFromIdentifierAsCFData(
        allocator: Option<&CFAllocator>,
        identifier: &CFString,
        key_out: NonNull<*const CFData>,
    ) -> OSStatus;
}

extern "C-unwind" {
    /// Creates a copy of the key value that was encoded in the identifier as CFData.
    ///
    /// # Safety
    ///
    /// `key_space_out` must be a valid pointer.
    pub fn CMMetadataCreateKeySpaceFromIdentifier(
        allocator: Option<&CFAllocator>,
        identifier: &CFString,
        key_space_out: NonNull<*const CFString>,
    ) -> OSStatus;
}

extern "C" {
    /// A sequence of bytes whose interpretation based upon an agreement between
    /// the reader and the writer.
    ///
    /// UTF-8 string.
    ///
    /// UTF-16 string.
    ///
    /// GIF image.
    ///
    /// JPEG image.
    ///
    /// PNG image.
    ///
    /// BMP image.
    ///
    /// 32-bit big endian floating point number.
    ///
    /// 64-bit big endian floating point number.
    ///
    /// 8-bit signed integer.
    ///
    /// 16-bit big endian signed integer.
    ///
    /// 32-bit big endian signed integer.
    ///
    /// 64-bit big endian signed integer.
    ///
    /// 8-bit unsigned integer.
    ///
    /// 16-bit big endian unsigned integer.
    ///
    /// 32-bit big endian unsigned integer.
    ///
    /// 64-bit big endian unsigned integer.
    ///
    /// Consists of two 32-bit big endian floating point values, the x and y values, respectively.
    ///
    /// Consists of a 32-bit big endian floating point x value followed by a 32-bit floating point y value.
    ///
    /// Consists of four 32-bit big endian floating point values, the origin's x, origin's y, width and height values, respectively.
    /// May also be interpreted as a 32-bit floating point origin followed by a 32-bit floating point dimension.
    ///
    /// A 3x3 matrix of 64-bit big endian floating point numbers stored in row-major order that specify an affine transform.
    ///
    /// Three or more pairs of 32-bit floating point numbers (x and y values) that define the verticies of a polygon.
    ///
    /// Two or more pairs of 32-bit floating point numbers (x and y values) that define a multi-segmented line.
    ///
    /// UTF-8 encoded JSON data.
    ///
    /// A 3x3 matrix of 64-bit big endian floating point numbers stored in row-major order that specify a perspective transform.
    ///
    /// Consists of six 16-bit big endian unsigned integer values of RasterRectangleValue in the following order: raster width, raster height, left, width, top, height.
    /// Rectangle origin and dimension are normalized to raster rectangle coordinates to be pixel accurate but still retain the relative semantics when scaled.
    ///
    /// Consists of at least six 16-bit big endian unsigned integer values for RasterRectangleValue in the same order as kCMMetadataBaseDataType_RasterRectangleValue and then two 4-bit values for the number of left and right edge adjustment points. If edge adustment points are 2 or more, points would be pairs of 16-bit big endian unsigned integers alternating between x and y with left edge points first and right edge points afterwards.
    /// Rectangle origin and dimension are normalized to raster rectangle coordinates to be pixel accurate but still retain the relative semantics when scaled.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_rawdata?language=objc)
    pub static kCMMetadataBaseDataType_RawData: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_utf8?language=objc)
    pub static kCMMetadataBaseDataType_UTF8: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_utf16?language=objc)
    pub static kCMMetadataBaseDataType_UTF16: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_gif?language=objc)
    pub static kCMMetadataBaseDataType_GIF: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_jpeg?language=objc)
    pub static kCMMetadataBaseDataType_JPEG: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_png?language=objc)
    pub static kCMMetadataBaseDataType_PNG: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_bmp?language=objc)
    pub static kCMMetadataBaseDataType_BMP: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_float32?language=objc)
    pub static kCMMetadataBaseDataType_Float32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_float64?language=objc)
    pub static kCMMetadataBaseDataType_Float64: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_sint8?language=objc)
    pub static kCMMetadataBaseDataType_SInt8: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_sint16?language=objc)
    pub static kCMMetadataBaseDataType_SInt16: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_sint32?language=objc)
    pub static kCMMetadataBaseDataType_SInt32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_sint64?language=objc)
    pub static kCMMetadataBaseDataType_SInt64: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_uint8?language=objc)
    pub static kCMMetadataBaseDataType_UInt8: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_uint16?language=objc)
    pub static kCMMetadataBaseDataType_UInt16: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_uint32?language=objc)
    pub static kCMMetadataBaseDataType_UInt32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_uint64?language=objc)
    pub static kCMMetadataBaseDataType_UInt64: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_pointf32?language=objc)
    pub static kCMMetadataBaseDataType_PointF32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_dimensionsf32?language=objc)
    pub static kCMMetadataBaseDataType_DimensionsF32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_rectf32?language=objc)
    pub static kCMMetadataBaseDataType_RectF32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_affinetransformf64?language=objc)
    pub static kCMMetadataBaseDataType_AffineTransformF64: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_polygonf32?language=objc)
    pub static kCMMetadataBaseDataType_PolygonF32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_polylinef32?language=objc)
    pub static kCMMetadataBaseDataType_PolylineF32: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_json?language=objc)
    pub static kCMMetadataBaseDataType_JSON: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_perspectivetransformf64?language=objc)
    pub static kCMMetadataBaseDataType_PerspectiveTransformF64: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_rasterrectanglevalue?language=objc)
    pub static kCMMetadataBaseDataType_RasterRectangleValue: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatabasedatatype_extendedrasterrectanglevalue?language=objc)
    pub static kCMMetadataBaseDataType_ExtendedRasterRectangleValue: &'static CFString;
}

extern "C" {
    /// A string supplying location information in ISO-6709 format.  Conforms to
    /// kCMMetadataBaseDataType_UTF8.
    ///
    /// A string supplying degrees offset from magnetic North.  Conforms to
    /// kCMMetadataBaseDataType_UTF8.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatype_quicktimemetadatalocation_iso6709?language=objc)
    pub static kCMMetadataDataType_QuickTimeMetadataLocation_ISO6709: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatype_quicktimemetadatadirection?language=objc)
    pub static kCMMetadataDataType_QuickTimeMetadataDirection: &'static CFString;
}

extern "C" {
    /// A string supplying a universally unique identifier.  Conforms to
    /// kCMMetadataBaseDataType_UTF8.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatype_quicktimemetadatauuid?language=objc)
    pub static kCMMetadataDataType_QuickTimeMetadataUUID: &'static CFString;
}

extern "C" {
    /// 1/1000 of a Lux.  An unsigned value between 0 - 100,000,000.  Conforms to
    /// kCMMetadataBaseDataType_UInt32.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmmetadatadatatype_quicktimemetadatamillilux?language=objc)
    pub static kCMMetadataDataType_QuickTimeMetadataMilliLux: &'static CFString;
}

extern "C-unwind" {
    /// Register a data type with the data type registry.
    ///
    /// This routine is called by clients to register a data type with
    /// the data type registry.  The list of conforming data type identifiers
    /// must include a base data type.  If the data type has already
    /// been registered, then it is not considered an error to re-register it
    /// as long as the list of conforming data type identifiers has the same
    /// entries as the original;  otherwise an error will be returned.
    ///
    /// # Safety
    ///
    /// `conforming_data_types` generic must be of the correct type.
    pub fn CMMetadataDataTypeRegistryRegisterDataType(
        data_type: &CFString,
        description: &CFString,
        conforming_data_types: &CFArray,
    ) -> OSStatus;
}

/// Tests a data type identifier to see if it has been registered.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryDataTypeIsRegistered(
    data_type: &CFString,
) -> bool {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryDataTypeIsRegistered(data_type: &CFString) -> Boolean;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryDataTypeIsRegistered(data_type) };
    ret != 0
}

/// Returns the data type's description (if any was provided when it was registered).
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryGetDataTypeDescription(
    data_type: &CFString,
) -> CFRetained<CFString> {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryGetDataTypeDescription(
            data_type: &CFString,
        ) -> Option<NonNull<CFString>>;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryGetDataTypeDescription(data_type) };
    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
    unsafe { CFRetained::retain(ret) }
}

/// Returns the data type's conforming data types (if any were
/// provided when it was registered).
///
/// Returns: List of conforming data types registered for the given data type.
/// NULL is returned if the data type has not been registered.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryGetConformingDataTypes(
    data_type: &CFString,
) -> CFRetained<CFArray> {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryGetConformingDataTypes(
            data_type: &CFString,
        ) -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryGetConformingDataTypes(data_type) };
    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
    unsafe { CFRetained::retain(ret) }
}

/// Checks to see if a data type conforms to another data type.
///
/// A given data type will conform to a second data type if any of
/// the following are true:
/// <ul>
/// 1. The data type identifiers are the same.
/// <li>
/// 2. The first data type identifier's conformance list contains the second data type identifier.
/// <li>
/// 3. A recursive search of the conforming data types for each element in the first
/// <li>
/// data type's conformance list yields the second data type identifer.
/// </ul>
///
/// Returns: True if the first data type conforms to the second data type.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryDataTypeConformsToDataType(
    data_type: &CFString,
    conforms_to_data_type: &CFString,
) -> bool {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryDataTypeConformsToDataType(
            data_type: &CFString,
            conforms_to_data_type: &CFString,
        ) -> Boolean;
    }
    let ret = unsafe {
        CMMetadataDataTypeRegistryDataTypeConformsToDataType(data_type, conforms_to_data_type)
    };
    ret != 0
}

/// Returns an array of base data type identifiers.
///
/// There are a set of base data types that seed the data type
/// registry.  All valid data types will have their conformance search
/// end with a base data type.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryGetBaseDataTypes(
) -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryGetBaseDataTypes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryGetBaseDataTypes() };
    ret.map(|ret| unsafe { CFRetained::retain(ret) })
}

/// Tests a data type identifier to see if it represents a base data type.
///
/// This is simply a convenience method to test to see if a given
/// data type identifier is in the array returned by
/// CMMetadataDataTypeRegistryGetBaseDataTypes.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryDataTypeIsBaseDataType(
    data_type: &CFString,
) -> bool {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryDataTypeIsBaseDataType(data_type: &CFString) -> Boolean;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryDataTypeIsBaseDataType(data_type) };
    ret != 0
}

/// Returns the base data type identifier that the given data type
/// conforms to.
///
/// There are a set of base data types that seed the data type
/// registry.  All valid data types will have their conformance search
/// end with a base data type.
#[inline]
pub unsafe extern "C-unwind" fn CMMetadataDataTypeRegistryGetBaseDataTypeForConformingDataType(
    data_type: &CFString,
) -> CFRetained<CFString> {
    extern "C-unwind" {
        fn CMMetadataDataTypeRegistryGetBaseDataTypeForConformingDataType(
            data_type: &CFString,
        ) -> Option<NonNull<CFString>>;
    }
    let ret = unsafe { CMMetadataDataTypeRegistryGetBaseDataTypeForConformingDataType(data_type) };
    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
    unsafe { CFRetained::retain(ret) }
}