objc2_video_toolbox/generated/
VTMultiPassStorage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::marker::{PhantomData, PhantomPinned};
5use core::ptr::NonNull;
6use objc2_core_foundation::*;
7#[cfg(feature = "objc2-core-media")]
8use objc2_core_media::*;
9
10use crate::*;
11
12/// A mechanism for storing information for each frame of a multi-pass compression session.
13///
14/// VTMultiPassStorageRef is a CF type, so call CFRelease and CFRetain to manage objects of this type.
15/// The data stored in the VTMultiPassStorage is private to the video encoder.
16///
17/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtmultipassstorage?language=objc)
18#[repr(C)]
19pub struct VTMultiPassStorage {
20    inner: [u8; 0],
21    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
22}
23
24cf_type!(
25    #[encoding_name = "OpaqueVTMultiPassStorage"]
26    unsafe impl VTMultiPassStorage {}
27);
28
29unsafe impl ConcreteType for VTMultiPassStorage {
30    #[doc(alias = "VTMultiPassStorageGetTypeID")]
31    #[inline]
32    fn type_id() -> CFTypeID {
33        extern "C-unwind" {
34            fn VTMultiPassStorageGetTypeID() -> CFTypeID;
35        }
36        unsafe { VTMultiPassStorageGetTypeID() }
37    }
38}
39
40extern "C-unwind" {
41    /// Creates a VTMultiPassStorage object using a temporary file.
42    ///
43    /// The returned VTMultiPassStorage object may be used to perform multi-pass encoding; see kVTCompressionPropertyKey_MultiPassStorage.
44    /// Call CFRelease to release your retain on the created VTMultiPassStorage object when you are done with it.
45    ///
46    /// Parameter `fileURL`: Specifies where to put the backing file for the VTMultiPassStorage object.
47    /// If you pass NULL for fileURL, the video toolbox will pick a unique temporary file name.
48    ///
49    /// Parameter `timeRange`: Gives a hint to the multi pass storage about valid time stamps for data.
50    ///
51    /// Parameter `options`: If the file did not exist when the storage was created, the file will be deleted when the VTMultiPassStorage object is finalized, unless you set the kVTMultiPassStorageCreationOption_DoNotDelete option to kCFBooleanTrue in the options dictionary.
52    #[cfg(feature = "objc2-core-media")]
53    pub fn VTMultiPassStorageCreate(
54        allocator: Option<&CFAllocator>,
55        file_url: Option<&CFURL>,
56        time_range: CMTimeRange,
57        options: Option<&CFDictionary>,
58        multi_pass_storage_out: NonNull<*mut VTMultiPassStorage>,
59    ) -> OSStatus;
60}
61
62extern "C" {
63    /// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/kvtmultipassstoragecreationoption_donotdelete?language=objc)
64    pub static kVTMultiPassStorageCreationOption_DoNotDelete: &'static CFString;
65}
66
67extern "C-unwind" {
68    /// Ensures that any pending data is written to the multipass storage file and closes the file.
69    ///
70    /// After this function is called, all methods on the multipass storage object will fail.
71    /// It is still necessary to release the object by calling CFRelease.
72    pub fn VTMultiPassStorageClose(multi_pass_storage: &VTMultiPassStorage) -> OSStatus;
73}