objc2_core_media/generated/CMFormatDescriptionBridge.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_invalidparameter?language=objc)
9pub const kCMFormatDescriptionBridgeError_InvalidParameter: OSStatus = -12712;
10/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_allocationfailed?language=objc)
11pub const kCMFormatDescriptionBridgeError_AllocationFailed: OSStatus = -12713;
12/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_invalidserializedsampledescription?language=objc)
13pub const kCMFormatDescriptionBridgeError_InvalidSerializedSampleDescription: OSStatus = -12714;
14/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_invalidformatdescription?language=objc)
15pub const kCMFormatDescriptionBridgeError_InvalidFormatDescription: OSStatus = -12715;
16/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_incompatibleformatdescription?language=objc)
17pub const kCMFormatDescriptionBridgeError_IncompatibleFormatDescription: OSStatus = -12716;
18/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_unsupportedsampledescriptionflavor?language=objc)
19pub const kCMFormatDescriptionBridgeError_UnsupportedSampleDescriptionFlavor: OSStatus = -12717;
20/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmformatdescriptionbridgeerror_invalidslice?language=objc)
21pub const kCMFormatDescriptionBridgeError_InvalidSlice: OSStatus = -12719;
22
23/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmimagedescriptionflavor?language=objc)
24// NS_TYPED_EXTENSIBLE_ENUM
25pub type CMImageDescriptionFlavor = CFString;
26
27extern "C" {
28 /// Chooses the QuickTime Movie Image Description format.
29 ///
30 /// Passing NULL is equivalent to passing this constant.
31 ///
32 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmimagedescriptionflavor_quicktimemovie?language=objc)
33 pub static kCMImageDescriptionFlavor_QuickTimeMovie: &'static CMImageDescriptionFlavor;
34}
35
36extern "C" {
37 /// Chooses the ISO family sample description format, used in MP4
38 ///
39 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmimagedescriptionflavor_isofamily?language=objc)
40 pub static kCMImageDescriptionFlavor_ISOFamily: &'static CMImageDescriptionFlavor;
41}
42
43extern "C" {
44 /// Chooses the 3GP family sample description format.
45 ///
46 /// This implies kCMImageDescriptionFlavor_ISOFamily and adds additional rules specific to the 3GP family.
47 ///
48 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmimagedescriptionflavor_3gpfamily?language=objc)
49 pub static kCMImageDescriptionFlavor_3GPFamily: &'static CMImageDescriptionFlavor;
50}
51
52extern "C" {
53 /// Chooses the ISO family sample description format with use of Apple extensions where appropriate for M4V and M4A.
54 ///
55 /// This implies kCMImageDescriptionFlavor_ISOFamily and adds additional rules specific to the .m4a, .m4b, and .m4v file formats.
56 ///
57 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmimagedescriptionflavor_isofamilywithappleextensions?language=objc)
58 pub static kCMImageDescriptionFlavor_ISOFamilyWithAppleExtensions:
59 &'static CMImageDescriptionFlavor;
60}
61
62extern "C-unwind" {
63 /// Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure.
64 ///
65 ///
66 /// Parameter `allocator`: Allocator to use for allocating the CMVideoFormatDescription object. May be NULL.
67 ///
68 /// Parameter `imageDescriptionData`: ImageDescription data structure in big-endian byte ordering.
69 ///
70 /// Parameter `size`: Size of ImageDescription data structure.
71 ///
72 /// Parameter `stringEncoding`: Pass CFStringGetSystemEncoding() or GetApplicationTextEncoding().
73 ///
74 /// Parameter `flavor`: kCMImageDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
75 ///
76 /// Parameter `formatDescriptionOut`: Receives new CMVideoFormatDescription.
77 ///
78 /// # Safety
79 ///
80 /// - `image_description_data` must be a valid pointer.
81 /// - `format_description_out` must be a valid pointer.
82 #[cfg(feature = "CMFormatDescription")]
83 pub fn CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(
84 allocator: Option<&CFAllocator>,
85 image_description_data: NonNull<u8>,
86 size: usize,
87 string_encoding: CFStringEncoding,
88 flavor: Option<&CMImageDescriptionFlavor>,
89 format_description_out: NonNull<*const CMVideoFormatDescription>,
90 ) -> OSStatus;
91}
92
93extern "C-unwind" {
94 /// Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure in a CMBlockBuffer.
95 ///
96 ///
97 /// Parameter `allocator`: Allocator to use for allocating the CMVideoFormatDescription object. May be NULL.
98 ///
99 /// Parameter `imageDescriptionBlockBuffer`: CMBlockBuffer containing ImageDescription data structure in big-endian byte ordering.
100 ///
101 /// Parameter `stringEncoding`: Pass CFStringGetSystemEncoding() or GetApplicationTextEncoding().
102 ///
103 /// Parameter `flavor`: kCMImageDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
104 ///
105 /// Parameter `formatDescriptionOut`: Receives new CMVideoFormatDescription.
106 ///
107 /// # Safety
108 ///
109 /// `format_description_out` must be a valid pointer.
110 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
111 pub fn CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(
112 allocator: Option<&CFAllocator>,
113 image_description_block_buffer: &CMBlockBuffer,
114 string_encoding: CFStringEncoding,
115 flavor: Option<&CMImageDescriptionFlavor>,
116 format_description_out: NonNull<*const CMVideoFormatDescription>,
117 ) -> OSStatus;
118}
119
120extern "C-unwind" {
121 /// Copies the contents of a CMVideoFormatDescription to a CMBlockBuffer in big-endian byte ordering.
122 ///
123 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
124 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
125 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
126 /// if writing the SampleDescription to a QuickTime/ISO file.
127 ///
128 ///
129 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
130 ///
131 /// Parameter `videoFormatDescription`: CMVideoFormatDescription to be copied.
132 ///
133 /// Parameter `stringEncoding`: Pass CFStringGetSystemEncoding() or GetApplicationTextEncoding().
134 ///
135 /// Parameter `flavor`: kCMImageDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
136 ///
137 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing ImageDescription data structure in big-endian byte ordering.
138 ///
139 /// # Safety
140 ///
141 /// `block_buffer_out` must be a valid pointer.
142 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
143 pub fn CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(
144 allocator: Option<&CFAllocator>,
145 video_format_description: &CMVideoFormatDescription,
146 string_encoding: CFStringEncoding,
147 flavor: Option<&CMImageDescriptionFlavor>,
148 block_buffer_out: NonNull<*mut CMBlockBuffer>,
149 ) -> OSStatus;
150}
151
152extern "C-unwind" {
153 /// Converts an ImageDescription data structure from big-endian to host-endian in place.
154 ///
155 ///
156 /// Parameter `imageDescriptionData`: ImageDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
157 ///
158 /// Parameter `imageDescriptionSize`: Size of ImageDescription data structure.
159 ///
160 /// # Safety
161 ///
162 /// `image_description_data` must be a valid pointer.
163 pub fn CMSwapBigEndianImageDescriptionToHost(
164 image_description_data: NonNull<u8>,
165 image_description_size: usize,
166 ) -> OSStatus;
167}
168
169extern "C-unwind" {
170 /// Converts an ImageDescription data structure from host-endian to big-endian in place.
171 ///
172 ///
173 /// Parameter `imageDescriptionData`: ImageDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
174 ///
175 /// Parameter `imageDescriptionSize`: Size of ImageDescription data structure.
176 ///
177 /// # Safety
178 ///
179 /// `image_description_data` must be a valid pointer.
180 pub fn CMSwapHostEndianImageDescriptionToBig(
181 image_description_data: NonNull<u8>,
182 image_description_size: usize,
183 ) -> OSStatus;
184}
185
186/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmsounddescriptionflavor?language=objc)
187// NS_TYPED_EXTENSIBLE_ENUM
188pub type CMSoundDescriptionFlavor = CFString;
189
190extern "C" {
191 /// Chooses the most backwards-compatible QuickTime Movie Sound Description format.
192 ///
193 /// A V1 sound description will be written if possible.
194 /// If a V1 sound description is written for CBR or PCM audio, the sample tables will need to use the legacy CBR layout.
195 ///
196 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmsounddescriptionflavor_quicktimemovie?language=objc)
197 pub static kCMSoundDescriptionFlavor_QuickTimeMovie: &'static CMSoundDescriptionFlavor;
198}
199
200extern "C" {
201 /// Chooses the QuickTime Movie Sound Description V2 format.
202 ///
203 /// A V2 sound description will be written.
204 /// V2 Sound Descriptions contain no legacy CBR layout, and use 'lpcm' for all flavors of PCM.
205 ///
206 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmsounddescriptionflavor_quicktimemoviev2?language=objc)
207 pub static kCMSoundDescriptionFlavor_QuickTimeMovieV2: &'static CMSoundDescriptionFlavor;
208}
209
210extern "C" {
211 /// Chooses the ISO family sample description format, used in MP4, M4A, etc.
212 ///
213 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmsounddescriptionflavor_isofamily?language=objc)
214 pub static kCMSoundDescriptionFlavor_ISOFamily: &'static CMSoundDescriptionFlavor;
215}
216
217extern "C" {
218 /// Chooses the 3GP family sample description format.
219 ///
220 /// This implies kCMSoundDescriptionFlavor_ISOFamily and adds additional rules specific to the 3GP family.
221 ///
222 /// See also [Apple's documentation](https://developer.apple.com/documentation/coremedia/kcmsounddescriptionflavor_3gpfamily?language=objc)
223 pub static kCMSoundDescriptionFlavor_3GPFamily: &'static CMSoundDescriptionFlavor;
224}
225
226extern "C-unwind" {
227 /// Creates a CMAudioFormatDescription from a big-endian SoundDescription data structure.
228 ///
229 ///
230 /// Parameter `allocator`: Allocator to use for allocating the CMAudioFormatDescription object. May be NULL.
231 ///
232 /// Parameter `soundDescriptionData`: SoundDescription data structure in big-endian byte ordering.
233 ///
234 /// Parameter `size`: Size of SoundDescription data structure.
235 ///
236 /// Parameter `flavor`: kCMSoundDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
237 ///
238 /// Parameter `formatDescriptionOut`: Receives new CMAudioFormatDescription.
239 ///
240 /// # Safety
241 ///
242 /// - `sound_description_data` must be a valid pointer.
243 /// - `format_description_out` must be a valid pointer.
244 #[cfg(feature = "CMFormatDescription")]
245 pub fn CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData(
246 allocator: Option<&CFAllocator>,
247 sound_description_data: NonNull<u8>,
248 size: usize,
249 flavor: Option<&CMSoundDescriptionFlavor>,
250 format_description_out: NonNull<*const CMAudioFormatDescription>,
251 ) -> OSStatus;
252}
253
254extern "C-unwind" {
255 /// Creates a CMAudioFormatDescription from a big-endian SoundDescription data structure in a CMBlockBuffer.
256 ///
257 ///
258 /// Parameter `allocator`: Allocator to use for allocating the CMAudioFormatDescription object. May be NULL.
259 ///
260 /// Parameter `soundDescriptionBlockBuffer`: CMBlockBuffer containing SoundDescription data structure in big-endian byte ordering.
261 ///
262 /// Parameter `flavor`: kCMSoundDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
263 ///
264 /// Parameter `formatDescriptionOut`: Receives new CMAudioFormatDescription.
265 ///
266 /// # Safety
267 ///
268 /// `format_description_out` must be a valid pointer.
269 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
270 pub fn CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer(
271 allocator: Option<&CFAllocator>,
272 sound_description_block_buffer: &CMBlockBuffer,
273 flavor: Option<&CMSoundDescriptionFlavor>,
274 format_description_out: NonNull<*const CMAudioFormatDescription>,
275 ) -> OSStatus;
276}
277
278extern "C-unwind" {
279 /// Copies the contents of a CMAudioFormatDescription to a CMBlockBuffer in big-endian byte ordering.
280 ///
281 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
282 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
283 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
284 /// if writing the SampleDescription to a QuickTime/ISO file.
285 ///
286 ///
287 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
288 ///
289 /// Parameter `audioFormatDescription`: CMAudioFormatDescription to be copied.
290 ///
291 /// Parameter `flavor`: kCMSoundDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
292 ///
293 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing SoundDescription data structure in big-endian byte ordering.
294 ///
295 /// # Safety
296 ///
297 /// `block_buffer_out` must be a valid pointer.
298 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
299 pub fn CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer(
300 allocator: Option<&CFAllocator>,
301 audio_format_description: &CMAudioFormatDescription,
302 flavor: Option<&CMSoundDescriptionFlavor>,
303 block_buffer_out: NonNull<*mut CMBlockBuffer>,
304 ) -> OSStatus;
305}
306
307/// Examine a big-endian SoundDescription data structure in a CMBlockBuffer, and report whether the sample tables will need to use the legacy CBR layout.
308///
309///
310/// Parameter `soundDescriptionBlockBuffer`: CMBlockBuffer containing SoundDescription data structure in big-endian byte ordering.
311///
312/// Parameter `flavor`: kCMSoundDescriptionFlavor constant or NULL for QuickTimeMovie flavor.
313#[cfg(feature = "CMBlockBuffer")]
314#[inline]
315pub unsafe extern "C-unwind" fn CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout(
316 sound_description_block_buffer: &CMBlockBuffer,
317 flavor: Option<&CMSoundDescriptionFlavor>,
318) -> bool {
319 extern "C-unwind" {
320 fn CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout(
321 sound_description_block_buffer: &CMBlockBuffer,
322 flavor: Option<&CMSoundDescriptionFlavor>,
323 ) -> Boolean;
324 }
325 let ret = unsafe {
326 CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout(
327 sound_description_block_buffer,
328 flavor,
329 )
330 };
331 ret != 0
332}
333
334extern "C-unwind" {
335 /// Converts a SoundDescription data structure from big-endian to host-endian in place.
336 ///
337 ///
338 /// Parameter `soundDescriptionData`: SoundDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
339 ///
340 /// Parameter `soundDescriptionSize`: Size of SoundDescription data structure.
341 ///
342 /// # Safety
343 ///
344 /// `sound_description_data` must be a valid pointer.
345 pub fn CMSwapBigEndianSoundDescriptionToHost(
346 sound_description_data: NonNull<u8>,
347 sound_description_size: usize,
348 ) -> OSStatus;
349}
350
351extern "C-unwind" {
352 /// Converts a SoundDescription data structure from host-endian to big-endian in place.
353 ///
354 ///
355 /// Parameter `soundDescriptionData`: SoundDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
356 ///
357 /// Parameter `soundDescriptionSize`: Size of SoundDescription data structure.
358 ///
359 /// # Safety
360 ///
361 /// `sound_description_data` must be a valid pointer.
362 pub fn CMSwapHostEndianSoundDescriptionToBig(
363 sound_description_data: NonNull<u8>,
364 sound_description_size: usize,
365 ) -> OSStatus;
366}
367
368/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmtextdescriptionflavor?language=objc)
369// NS_TYPED_EXTENSIBLE_ENUM
370pub type CMTextDescriptionFlavor = CFString;
371
372extern "C-unwind" {
373 /// Creates a CMTextFormatDescription from a big-endian TextDescription data structure.
374 ///
375 ///
376 /// Parameter `allocator`: Allocator to use for allocating the CMTextFormatDescription object. May be NULL.
377 ///
378 /// Parameter `textDescriptionData`: TextDescription data structure in big-endian byte ordering.
379 ///
380 /// Parameter `size`: Size of TextDescription data structure.
381 ///
382 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
383 ///
384 /// Parameter `mediaType`: Pass kCMMediaType_Text or kCMMediaType_Subtitle.
385 ///
386 /// Parameter `formatDescriptionOut`: Receives new CMTextFormatDescription.
387 ///
388 /// # Safety
389 ///
390 /// - `text_description_data` must be a valid pointer.
391 /// - `format_description_out` must be a valid pointer.
392 #[cfg(feature = "CMFormatDescription")]
393 pub fn CMTextFormatDescriptionCreateFromBigEndianTextDescriptionData(
394 allocator: Option<&CFAllocator>,
395 text_description_data: NonNull<u8>,
396 size: usize,
397 flavor: Option<&CMTextDescriptionFlavor>,
398 media_type: CMMediaType,
399 format_description_out: NonNull<*const CMTextFormatDescription>,
400 ) -> OSStatus;
401}
402
403extern "C-unwind" {
404 /// Creates a CMTextFormatDescription from a big-endian TextDescription data structure in a CMBlockBuffer.
405 ///
406 ///
407 /// Parameter `allocator`: Allocator to use for allocating the CMTextFormatDescription object. May be NULL.
408 ///
409 /// Parameter `textDescriptionBlockBuffer`: CMBlockBuffer containing TextDescription data structure in big-endian byte ordering.
410 ///
411 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
412 ///
413 /// Parameter `mediaType`: Pass kCMMediaType_Text or kCMMediaType_Subtitle.
414 ///
415 /// Parameter `formatDescriptionOut`: Receives new CMTextFormatDescription.
416 ///
417 /// # Safety
418 ///
419 /// `format_description_out` must be a valid pointer.
420 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
421 pub fn CMTextFormatDescriptionCreateFromBigEndianTextDescriptionBlockBuffer(
422 allocator: Option<&CFAllocator>,
423 text_description_block_buffer: &CMBlockBuffer,
424 flavor: Option<&CMTextDescriptionFlavor>,
425 media_type: CMMediaType,
426 format_description_out: NonNull<*const CMTextFormatDescription>,
427 ) -> OSStatus;
428}
429
430extern "C-unwind" {
431 /// Copies the contents of a CMTextFormatDescription to a CMBlockBuffer in big-endian byte ordering.
432 ///
433 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
434 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
435 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
436 /// if writing the SampleDescription to a QuickTime/ISO file.
437 ///
438 ///
439 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
440 ///
441 /// Parameter `textFormatDescription`: CMTextFormatDescription to be copied.
442 ///
443 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
444 ///
445 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing TextDescription data structure in big-endian byte ordering.
446 ///
447 /// # Safety
448 ///
449 /// `block_buffer_out` must be a valid pointer.
450 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
451 pub fn CMTextFormatDescriptionCopyAsBigEndianTextDescriptionBlockBuffer(
452 allocator: Option<&CFAllocator>,
453 text_format_description: &CMTextFormatDescription,
454 flavor: Option<&CMTextDescriptionFlavor>,
455 block_buffer_out: NonNull<*mut CMBlockBuffer>,
456 ) -> OSStatus;
457}
458
459extern "C-unwind" {
460 /// Converts a TextDescription data structure from big-endian to host-endian in place.
461 ///
462 ///
463 /// Parameter `textDescriptionData`: TextDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
464 ///
465 /// Parameter `textDescriptionSize`: Size of TextDescription data structure.
466 ///
467 /// # Safety
468 ///
469 /// `text_description_data` must be a valid pointer.
470 pub fn CMSwapBigEndianTextDescriptionToHost(
471 text_description_data: NonNull<u8>,
472 text_description_size: usize,
473 ) -> OSStatus;
474}
475
476extern "C-unwind" {
477 /// Converts a TextDescription data structure from host-endian to big-endian in place.
478 ///
479 ///
480 /// Parameter `textDescriptionData`: TextDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
481 ///
482 /// Parameter `textDescriptionSize`: Size of TextDescription data structure.
483 ///
484 /// # Safety
485 ///
486 /// `text_description_data` must be a valid pointer.
487 pub fn CMSwapHostEndianTextDescriptionToBig(
488 text_description_data: NonNull<u8>,
489 text_description_size: usize,
490 ) -> OSStatus;
491}
492
493/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmclosedcaptiondescriptionflavor?language=objc)
494// NS_TYPED_EXTENSIBLE_ENUM
495pub type CMClosedCaptionDescriptionFlavor = CFString;
496
497extern "C-unwind" {
498 /// Creates a CMClosedCaptionFormatDescription from a big-endian ClosedCaptionDescription data structure.
499 ///
500 ///
501 /// Parameter `allocator`: Allocator to use for allocating the CMClosedCaptionFormatDescription object. May be NULL.
502 ///
503 /// Parameter `closedCaptionDescriptionData`: ClosedCaptionDescription data structure in big-endian byte ordering.
504 ///
505 /// Parameter `size`: Size of ClosedCaptionDescription data structure.
506 ///
507 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
508 ///
509 /// Parameter `formatDescriptionOut`: Receives new CMClosedCaptionFormatDescription.
510 ///
511 /// # Safety
512 ///
513 /// - `closed_caption_description_data` must be a valid pointer.
514 /// - `format_description_out` must be a valid pointer.
515 #[cfg(feature = "CMFormatDescription")]
516 pub fn CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionData(
517 allocator: Option<&CFAllocator>,
518 closed_caption_description_data: NonNull<u8>,
519 size: usize,
520 flavor: Option<&CMClosedCaptionDescriptionFlavor>,
521 format_description_out: NonNull<*const CMClosedCaptionFormatDescription>,
522 ) -> OSStatus;
523}
524
525extern "C-unwind" {
526 /// Creates a CMClosedCaptionFormatDescription from a big-endian ClosedCaptionDescription data structure in a CMBlockBuffer.
527 ///
528 ///
529 /// Parameter `allocator`: Allocator to use for allocating the CMClosedCaptionFormatDescription object. May be NULL.
530 ///
531 /// Parameter `closedCaptionDescriptionBlockBuffer`: CMBlockBuffer containing ClosedCaptionDescription data structure in big-endian byte ordering.
532 ///
533 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
534 ///
535 /// Parameter `formatDescriptionOut`: Receives new CMClosedCaptionFormatDescription.
536 ///
537 /// # Safety
538 ///
539 /// `format_description_out` must be a valid pointer.
540 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
541 pub fn CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionBlockBuffer(
542 allocator: Option<&CFAllocator>,
543 closed_caption_description_block_buffer: &CMBlockBuffer,
544 flavor: Option<&CMClosedCaptionDescriptionFlavor>,
545 format_description_out: NonNull<*const CMClosedCaptionFormatDescription>,
546 ) -> OSStatus;
547}
548
549extern "C-unwind" {
550 /// Copies the contents of a CMClosedCaptionFormatDescription to a CMBlockBuffer in big-endian byte ordering.
551 ///
552 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
553 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
554 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
555 /// if writing the SampleDescription to a QuickTime/ISO file.
556 ///
557 ///
558 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
559 ///
560 /// Parameter `closedCaptionFormatDescription`: CMClosedCaptionFormatDescription to be copied.
561 ///
562 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
563 ///
564 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing ClosedCaptionDescription data structure in big-endian byte ordering.
565 ///
566 /// # Safety
567 ///
568 /// `block_buffer_out` must be a valid pointer.
569 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
570 pub fn CMClosedCaptionFormatDescriptionCopyAsBigEndianClosedCaptionDescriptionBlockBuffer(
571 allocator: Option<&CFAllocator>,
572 closed_caption_format_description: &CMClosedCaptionFormatDescription,
573 flavor: Option<&CMClosedCaptionDescriptionFlavor>,
574 block_buffer_out: NonNull<*mut CMBlockBuffer>,
575 ) -> OSStatus;
576}
577
578extern "C-unwind" {
579 /// Converts a ClosedCaptionDescription data structure from big-endian to host-endian in place.
580 ///
581 ///
582 /// Parameter `closedCaptionDescriptionData`: ClosedCaptionDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
583 ///
584 /// Parameter `closedCaptionDescriptionSize`: Size of ClosedCaptionDescription data structure.
585 ///
586 /// # Safety
587 ///
588 /// `closed_caption_description_data` must be a valid pointer.
589 pub fn CMSwapBigEndianClosedCaptionDescriptionToHost(
590 closed_caption_description_data: NonNull<u8>,
591 closed_caption_description_size: usize,
592 ) -> OSStatus;
593}
594
595extern "C-unwind" {
596 /// Converts a ClosedCaptionDescription data structure from host-endian to big-endian in place.
597 ///
598 ///
599 /// Parameter `closedCaptionDescriptionData`: ClosedCaptionDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
600 ///
601 /// Parameter `closedCaptionDescriptionSize`: Size of ClosedCaptionDescription data structure.
602 ///
603 /// # Safety
604 ///
605 /// `closed_caption_description_data` must be a valid pointer.
606 pub fn CMSwapHostEndianClosedCaptionDescriptionToBig(
607 closed_caption_description_data: NonNull<u8>,
608 closed_caption_description_size: usize,
609 ) -> OSStatus;
610}
611
612/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmtimecodedescriptionflavor?language=objc)
613// NS_TYPED_EXTENSIBLE_ENUM
614pub type CMTimeCodeDescriptionFlavor = CFString;
615
616extern "C-unwind" {
617 /// Creates a CMTimeCodeFormatDescription from a big-endian TimeCodeDescription data structure.
618 ///
619 ///
620 /// Parameter `allocator`: Allocator to use for allocating the CMTimeCodeFormatDescription object. May be NULL.
621 ///
622 /// Parameter `timeCodeDescriptionData`: TimeCodeDescription data structure in big-endian byte ordering.
623 ///
624 /// Parameter `size`: Size of TimeCodeDescription data structure.
625 ///
626 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
627 ///
628 /// Parameter `formatDescriptionOut`: Receives new CMTimeCodeFormatDescription.
629 ///
630 /// # Safety
631 ///
632 /// - `time_code_description_data` must be a valid pointer.
633 /// - `format_description_out` must be a valid pointer.
634 #[cfg(feature = "CMFormatDescription")]
635 pub fn CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionData(
636 allocator: Option<&CFAllocator>,
637 time_code_description_data: NonNull<u8>,
638 size: usize,
639 flavor: Option<&CMTimeCodeDescriptionFlavor>,
640 format_description_out: NonNull<*const CMTimeCodeFormatDescription>,
641 ) -> OSStatus;
642}
643
644extern "C-unwind" {
645 /// Creates a CMTimeCodeFormatDescription from a big-endian TimeCodeDescription data structure in a CMBlockBuffer.
646 ///
647 ///
648 /// Parameter `allocator`: Allocator to use for allocating the CMTimeCodeFormatDescription object. May be NULL.
649 ///
650 /// Parameter `timeCodeDescriptionBlockBuffer`: CMBlockBuffer containing TimeCodeDescription data structure in big-endian byte ordering.
651 ///
652 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
653 ///
654 /// Parameter `formatDescriptionOut`: Receives new CMTimeCodeFormatDescription.
655 ///
656 /// # Safety
657 ///
658 /// `format_description_out` must be a valid pointer.
659 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
660 pub fn CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionBlockBuffer(
661 allocator: Option<&CFAllocator>,
662 time_code_description_block_buffer: &CMBlockBuffer,
663 flavor: Option<&CMTimeCodeDescriptionFlavor>,
664 format_description_out: NonNull<*const CMTimeCodeFormatDescription>,
665 ) -> OSStatus;
666}
667
668extern "C-unwind" {
669 /// Copies the contents of a CMTimeCodeFormatDescription to a CMBlockBuffer in big-endian byte ordering.
670 ///
671 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
672 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
673 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
674 /// if writing the SampleDescription to a QuickTime/ISO file.
675 ///
676 ///
677 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
678 ///
679 /// Parameter `timeCodeFormatDescription`: CMTimeCodeFormatDescription to be copied.
680 ///
681 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
682 ///
683 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing TimeCodeDescription data structure in big-endian byte ordering.
684 ///
685 /// # Safety
686 ///
687 /// `block_buffer_out` must be a valid pointer.
688 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
689 pub fn CMTimeCodeFormatDescriptionCopyAsBigEndianTimeCodeDescriptionBlockBuffer(
690 allocator: Option<&CFAllocator>,
691 time_code_format_description: &CMTimeCodeFormatDescription,
692 flavor: Option<&CMTimeCodeDescriptionFlavor>,
693 block_buffer_out: NonNull<*mut CMBlockBuffer>,
694 ) -> OSStatus;
695}
696
697extern "C-unwind" {
698 /// Converts a TimeCodeDescription data structure from big-endian to host-endian in place.
699 ///
700 ///
701 /// Parameter `timeCodeDescriptionData`: TimeCodeDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
702 ///
703 /// Parameter `timeCodeDescriptionSize`: Size of TimeCodeDescription data structure.
704 ///
705 /// # Safety
706 ///
707 /// `time_code_description_data` must be a valid pointer.
708 pub fn CMSwapBigEndianTimeCodeDescriptionToHost(
709 time_code_description_data: NonNull<u8>,
710 time_code_description_size: usize,
711 ) -> OSStatus;
712}
713
714extern "C-unwind" {
715 /// Converts a TimeCodeDescription data structure from host-endian to big-endian in place.
716 ///
717 ///
718 /// Parameter `timeCodeDescriptionData`: TimeCodeDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
719 ///
720 /// Parameter `timeCodeDescriptionSize`: Size of TimeCodeDescription data structure.
721 ///
722 /// # Safety
723 ///
724 /// `time_code_description_data` must be a valid pointer.
725 pub fn CMSwapHostEndianTimeCodeDescriptionToBig(
726 time_code_description_data: NonNull<u8>,
727 time_code_description_size: usize,
728 ) -> OSStatus;
729}
730
731/// [Apple's documentation](https://developer.apple.com/documentation/coremedia/cmmetadatadescriptionflavor?language=objc)
732// NS_TYPED_EXTENSIBLE_ENUM
733pub type CMMetadataDescriptionFlavor = CFString;
734
735extern "C-unwind" {
736 /// Creates a CMMetadataFormatDescription from a big-endian MetadataDescription data structure.
737 ///
738 ///
739 /// Parameter `allocator`: Allocator to use for allocating the CMMetadataFormatDescription object. May be NULL.
740 ///
741 /// Parameter `metadataDescriptionData`: MetadataDescription data structure in big-endian byte ordering.
742 ///
743 /// Parameter `size`: Size of MetadataDescription data structure.
744 ///
745 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
746 ///
747 /// Parameter `formatDescriptionOut`: Receives new CMMetadataFormatDescriptionRef.
748 ///
749 /// # Safety
750 ///
751 /// - `metadata_description_data` must be a valid pointer.
752 /// - `format_description_out` must be a valid pointer.
753 #[cfg(feature = "CMFormatDescription")]
754 pub fn CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionData(
755 allocator: Option<&CFAllocator>,
756 metadata_description_data: NonNull<u8>,
757 size: usize,
758 flavor: Option<&CMMetadataDescriptionFlavor>,
759 format_description_out: NonNull<*const CMMetadataFormatDescription>,
760 ) -> OSStatus;
761}
762
763extern "C-unwind" {
764 /// Creates a CMMetadataFormatDescription from a big-endian MetadataDescription data structure in a CMBlockBuffer.
765 ///
766 ///
767 /// Parameter `allocator`: Allocator to use for allocating the CMMetadataFormatDescription object. May be NULL.
768 ///
769 /// Parameter `metadataDescriptionBlockBuffer`: CMBlockBuffer containing MetadataDescription data structure in big-endian byte ordering.
770 ///
771 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
772 ///
773 /// Parameter `formatDescriptionOut`: Receives new CMMetadataFormatDescriptionRef.
774 ///
775 /// # Safety
776 ///
777 /// `format_description_out` must be a valid pointer.
778 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
779 pub fn CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionBlockBuffer(
780 allocator: Option<&CFAllocator>,
781 metadata_description_block_buffer: &CMBlockBuffer,
782 flavor: Option<&CMMetadataDescriptionFlavor>,
783 format_description_out: NonNull<*const CMMetadataFormatDescription>,
784 ) -> OSStatus;
785}
786
787extern "C-unwind" {
788 /// Copies the contents of a CMMetadataFormatDescription to a CMBlockBuffer in big-endian byte ordering.
789 ///
790 /// On return, the caller owns the returned CMBlockBuffer, and must release it when done with it.
791 /// Note that the dataRefIndex field of the SampleDescription is intentionally filled with
792 /// garbage values (0xFFFF). The caller must overwrite these values with a valid dataRefIndex
793 /// if writing the SampleDescription to a QuickTime/ISO file.
794 ///
795 ///
796 /// Parameter `allocator`: Allocator to use for allocating the CMBlockBuffer object. May be NULL.
797 ///
798 /// Parameter `metadataFormatDescription`: CMMetadataFormatDescriptionRef to be copied.
799 ///
800 /// Parameter `flavor`: Reserved for future use. Pass NULL for QuickTime Movie or ISO flavor.
801 ///
802 /// Parameter `blockBufferOut`: Receives new CMBlockBuffer containing MetadataDescription data structure in big-endian byte ordering.
803 ///
804 /// # Safety
805 ///
806 /// `block_buffer_out` must be a valid pointer.
807 #[cfg(all(feature = "CMBlockBuffer", feature = "CMFormatDescription"))]
808 pub fn CMMetadataFormatDescriptionCopyAsBigEndianMetadataDescriptionBlockBuffer(
809 allocator: Option<&CFAllocator>,
810 metadata_format_description: &CMMetadataFormatDescription,
811 flavor: Option<&CMMetadataDescriptionFlavor>,
812 block_buffer_out: NonNull<*mut CMBlockBuffer>,
813 ) -> OSStatus;
814}
815
816extern "C-unwind" {
817 /// Converts a MetadataDescription data structure from big-endian to host-endian in place.
818 ///
819 ///
820 /// Parameter `metadataDescriptionData`: MetadataDescription data structure in big-endian byte ordering to be converted to host-endian byte ordering.
821 ///
822 /// Parameter `metadataDescriptionSize`: Size of MetadataDescription data structure.
823 ///
824 /// # Safety
825 ///
826 /// `metadata_description_data` must be a valid pointer.
827 pub fn CMSwapBigEndianMetadataDescriptionToHost(
828 metadata_description_data: NonNull<u8>,
829 metadata_description_size: usize,
830 ) -> OSStatus;
831}
832
833extern "C-unwind" {
834 /// Converts a MetadataDescription data structure from host-endian to big-endian in place.
835 ///
836 ///
837 /// Parameter `metadataDescriptionData`: MetadataDescription data structure in host-endian byte ordering to be converted to big-endian byte ordering.
838 ///
839 /// Parameter `metadataDescriptionSize`: Size of MetadataDescription data structure.
840 ///
841 /// # Safety
842 ///
843 /// `metadata_description_data` must be a valid pointer.
844 pub fn CMSwapHostEndianMetadataDescriptionToBig(
845 metadata_description_data: NonNull<u8>,
846 metadata_description_size: usize,
847 ) -> OSStatus;
848}