objc2_core_video/generated/
CVPixelBufferPool.rs1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13#[repr(C)]
15pub struct CVPixelBufferPool {
16 inner: [u8; 0],
17 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20cf_type!(
21 #[encoding_name = "__CVPixelBufferPool"]
22 unsafe impl CVPixelBufferPool {}
23);
24
25extern "C" {
26 pub static kCVPixelBufferPoolMinimumBufferCountKey: &'static CFString;
28}
29
30extern "C" {
31 pub static kCVPixelBufferPoolMaximumBufferAgeKey: &'static CFString;
33}
34
35unsafe impl ConcreteType for CVPixelBufferPool {
36 #[doc(alias = "CVPixelBufferPoolGetTypeID")]
37 #[inline]
38 fn type_id() -> CFTypeID {
39 extern "C-unwind" {
40 fn CVPixelBufferPoolGetTypeID() -> CFTypeID;
41 }
42 unsafe { CVPixelBufferPoolGetTypeID() }
43 }
44}
45
46extern "C-unwind" {
47 #[cfg(feature = "CVReturn")]
57 pub fn CVPixelBufferPoolCreate(
58 allocator: Option<&CFAllocator>,
59 pool_attributes: Option<&CFDictionary>,
60 pixel_buffer_attributes: Option<&CFDictionary>,
61 pool_out: NonNull<*mut CVPixelBufferPool>,
62 ) -> CVReturn;
63}
64
65#[inline]
71pub unsafe extern "C-unwind" fn CVPixelBufferPoolGetAttributes(
72 pool: &CVPixelBufferPool,
73) -> Option<CFRetained<CFDictionary>> {
74 extern "C-unwind" {
75 fn CVPixelBufferPoolGetAttributes(
76 pool: &CVPixelBufferPool,
77 ) -> Option<NonNull<CFDictionary>>;
78 }
79 let ret = unsafe { CVPixelBufferPoolGetAttributes(pool) };
80 ret.map(|ret| unsafe { CFRetained::retain(ret) })
81}
82
83#[inline]
92pub unsafe extern "C-unwind" fn CVPixelBufferPoolGetPixelBufferAttributes(
93 pool: &CVPixelBufferPool,
94) -> Option<CFRetained<CFDictionary>> {
95 extern "C-unwind" {
96 fn CVPixelBufferPoolGetPixelBufferAttributes(
97 pool: &CVPixelBufferPool,
98 ) -> Option<NonNull<CFDictionary>>;
99 }
100 let ret = unsafe { CVPixelBufferPoolGetPixelBufferAttributes(pool) };
101 ret.map(|ret| unsafe { CFRetained::retain(ret) })
102}
103
104extern "C-unwind" {
105 #[cfg(all(
117 feature = "CVBuffer",
118 feature = "CVImageBuffer",
119 feature = "CVPixelBuffer",
120 feature = "CVReturn"
121 ))]
122 pub fn CVPixelBufferPoolCreatePixelBuffer(
123 allocator: Option<&CFAllocator>,
124 pixel_buffer_pool: &CVPixelBufferPool,
125 pixel_buffer_out: NonNull<*mut CVPixelBuffer>,
126 ) -> CVReturn;
127}
128
129extern "C-unwind" {
130 #[cfg(all(
131 feature = "CVBuffer",
132 feature = "CVImageBuffer",
133 feature = "CVPixelBuffer",
134 feature = "CVReturn"
135 ))]
136 pub fn CVPixelBufferPoolCreatePixelBufferWithAuxAttributes(
137 allocator: Option<&CFAllocator>,
138 pixel_buffer_pool: &CVPixelBufferPool,
139 aux_attributes: Option<&CFDictionary>,
140 pixel_buffer_out: NonNull<*mut CVPixelBuffer>,
141 ) -> CVReturn;
142}
143
144extern "C" {
145 pub static kCVPixelBufferPoolAllocationThresholdKey: &'static CFString;
147}
148
149extern "C" {
150 pub static kCVPixelBufferPoolFreeBufferNotification: &'static CFString;
152}
153
154#[cfg(feature = "CVBase")]
161#[repr(transparent)]
162#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
163pub struct CVPixelBufferPoolFlushFlags(pub CVOptionFlags);
164#[cfg(feature = "CVBase")]
165bitflags::bitflags! {
166 impl CVPixelBufferPoolFlushFlags: CVOptionFlags {
167 #[doc(alias = "kCVPixelBufferPoolFlushExcessBuffers")]
168 const ExcessBuffers = 1;
169 }
170}
171
172#[cfg(all(feature = "CVBase", feature = "objc2"))]
173unsafe impl Encode for CVPixelBufferPoolFlushFlags {
174 const ENCODING: Encoding = CVOptionFlags::ENCODING;
175}
176
177#[cfg(all(feature = "CVBase", feature = "objc2"))]
178unsafe impl RefEncode for CVPixelBufferPoolFlushFlags {
179 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
180}
181
182extern "C-unwind" {
183 #[cfg(feature = "CVBase")]
194 pub fn CVPixelBufferPoolFlush(pool: &CVPixelBufferPool, options: CVPixelBufferPoolFlushFlags);
195}