objc2_core_video/generated/
CVOpenGLBufferPool.rs1use core::cell::UnsafeCell;
4use core::marker::{PhantomData, PhantomPinned};
5use core::ptr::NonNull;
6#[cfg(feature = "objc2")]
7use objc2::__framework_prelude::*;
8use objc2_core_foundation::*;
9
10use crate::*;
11
12#[doc(alias = "CVOpenGLBufferPoolRef")]
14#[repr(C)]
15pub struct CVOpenGLBufferPool {
16 inner: [u8; 0],
17 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20cf_type!(
21 unsafe impl CVOpenGLBufferPool {}
22);
23#[cfg(feature = "objc2")]
24cf_objc2_type!(
25 unsafe impl RefEncode<"__CVOpenGLBufferPool"> for CVOpenGLBufferPool {}
26);
27
28extern "C" {
29 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
31 pub static kCVOpenGLBufferPoolMinimumBufferCountKey: &'static CFString;
32}
33
34extern "C" {
35 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
37 pub static kCVOpenGLBufferPoolMaximumBufferAgeKey: &'static CFString;
38}
39
40unsafe impl ConcreteType for CVOpenGLBufferPool {
41 #[doc(alias = "CVOpenGLBufferPoolGetTypeID")]
42 #[inline]
43 fn type_id() -> CFTypeID {
44 extern "C-unwind" {
45 fn CVOpenGLBufferPoolGetTypeID() -> CFTypeID;
46 }
47 unsafe { CVOpenGLBufferPoolGetTypeID() }
48 }
49}
50
51impl CVOpenGLBufferPool {
52 #[doc(alias = "CVOpenGLBufferPoolCreate")]
72 #[cfg(feature = "CVReturn")]
73 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
74 #[inline]
75 pub unsafe fn create(
76 allocator: Option<&CFAllocator>,
77 pool_attributes: Option<&CFDictionary>,
78 open_gl_buffer_attributes: Option<&CFDictionary>,
79 pool_out: NonNull<*mut CVOpenGLBufferPool>,
80 ) -> CVReturn {
81 extern "C-unwind" {
82 fn CVOpenGLBufferPoolCreate(
83 allocator: Option<&CFAllocator>,
84 pool_attributes: Option<&CFDictionary>,
85 open_gl_buffer_attributes: Option<&CFDictionary>,
86 pool_out: NonNull<*mut CVOpenGLBufferPool>,
87 ) -> CVReturn;
88 }
89 unsafe {
90 CVOpenGLBufferPoolCreate(
91 allocator,
92 pool_attributes,
93 open_gl_buffer_attributes,
94 pool_out,
95 )
96 }
97 }
98
99 #[doc(alias = "CVOpenGLBufferPoolGetAttributes")]
105 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
106 #[inline]
107 pub fn attributes(&self) -> Option<CFRetained<CFDictionary>> {
108 extern "C-unwind" {
109 fn CVOpenGLBufferPoolGetAttributes(
110 pool: &CVOpenGLBufferPool,
111 ) -> Option<NonNull<CFDictionary>>;
112 }
113 let ret = unsafe { CVOpenGLBufferPoolGetAttributes(self) };
114 ret.map(|ret| unsafe { CFRetained::retain(ret) })
115 }
116
117 #[doc(alias = "CVOpenGLBufferPoolGetOpenGLBufferAttributes")]
126 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
127 #[inline]
128 pub fn open_gl_buffer_attributes(&self) -> Option<CFRetained<CFDictionary>> {
129 extern "C-unwind" {
130 fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
131 pool: &CVOpenGLBufferPool,
132 ) -> Option<NonNull<CFDictionary>>;
133 }
134 let ret = unsafe { CVOpenGLBufferPoolGetOpenGLBufferAttributes(self) };
135 ret.map(|ret| unsafe { CFRetained::retain(ret) })
136 }
137
138 #[doc(alias = "CVOpenGLBufferPoolCreateOpenGLBuffer")]
154 #[cfg(all(
155 feature = "CVBuffer",
156 feature = "CVImageBuffer",
157 feature = "CVOpenGLBuffer",
158 feature = "CVReturn"
159 ))]
160 #[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
161 #[inline]
162 pub unsafe fn create_open_gl_buffer(
163 allocator: Option<&CFAllocator>,
164 open_gl_buffer_pool: &CVOpenGLBufferPool,
165 open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
166 ) -> CVReturn {
167 extern "C-unwind" {
168 fn CVOpenGLBufferPoolCreateOpenGLBuffer(
169 allocator: Option<&CFAllocator>,
170 open_gl_buffer_pool: &CVOpenGLBufferPool,
171 open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
172 ) -> CVReturn;
173 }
174 unsafe {
175 CVOpenGLBufferPoolCreateOpenGLBuffer(allocator, open_gl_buffer_pool, open_gl_buffer_out)
176 }
177 }
178}
179
180extern "C-unwind" {
181 #[cfg(feature = "CVReturn")]
182 #[deprecated = "renamed to `CVOpenGLBufferPool::create`"]
183 pub fn CVOpenGLBufferPoolCreate(
184 allocator: Option<&CFAllocator>,
185 pool_attributes: Option<&CFDictionary>,
186 open_gl_buffer_attributes: Option<&CFDictionary>,
187 pool_out: NonNull<*mut CVOpenGLBufferPool>,
188 ) -> CVReturn;
189}
190
191#[deprecated = "renamed to `CVOpenGLBufferPool::attributes`"]
192#[inline]
193pub extern "C-unwind" fn CVOpenGLBufferPoolGetAttributes(
194 pool: &CVOpenGLBufferPool,
195) -> Option<CFRetained<CFDictionary>> {
196 extern "C-unwind" {
197 fn CVOpenGLBufferPoolGetAttributes(
198 pool: &CVOpenGLBufferPool,
199 ) -> Option<NonNull<CFDictionary>>;
200 }
201 let ret = unsafe { CVOpenGLBufferPoolGetAttributes(pool) };
202 ret.map(|ret| unsafe { CFRetained::retain(ret) })
203}
204
205#[deprecated = "renamed to `CVOpenGLBufferPool::open_gl_buffer_attributes`"]
206#[inline]
207pub extern "C-unwind" fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
208 pool: &CVOpenGLBufferPool,
209) -> Option<CFRetained<CFDictionary>> {
210 extern "C-unwind" {
211 fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
212 pool: &CVOpenGLBufferPool,
213 ) -> Option<NonNull<CFDictionary>>;
214 }
215 let ret = unsafe { CVOpenGLBufferPoolGetOpenGLBufferAttributes(pool) };
216 ret.map(|ret| unsafe { CFRetained::retain(ret) })
217}
218
219extern "C-unwind" {
220 #[cfg(all(
221 feature = "CVBuffer",
222 feature = "CVImageBuffer",
223 feature = "CVOpenGLBuffer",
224 feature = "CVReturn"
225 ))]
226 #[deprecated = "renamed to `CVOpenGLBufferPool::create_open_gl_buffer`"]
227 pub fn CVOpenGLBufferPoolCreateOpenGLBuffer(
228 allocator: Option<&CFAllocator>,
229 open_gl_buffer_pool: &CVOpenGLBufferPool,
230 open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
231 ) -> CVReturn;
232}