use core::cell::UnsafeCell;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[doc(alias = "CVOpenGLBufferPoolRef")]
#[repr(C)]
pub struct CVOpenGLBufferPool {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl CVOpenGLBufferPool {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__CVOpenGLBufferPool"> for CVOpenGLBufferPool {}
);
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferPoolMinimumBufferCountKey: &'static CFString;
}
extern "C" {
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
pub static kCVOpenGLBufferPoolMaximumBufferAgeKey: &'static CFString;
}
unsafe impl ConcreteType for CVOpenGLBufferPool {
#[doc(alias = "CVOpenGLBufferPoolGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn CVOpenGLBufferPoolGetTypeID() -> CFTypeID;
}
unsafe { CVOpenGLBufferPoolGetTypeID() }
}
}
impl CVOpenGLBufferPool {
#[doc(alias = "CVOpenGLBufferPoolCreate")]
#[cfg(feature = "CVReturn")]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub unsafe fn create(
allocator: Option<&CFAllocator>,
pool_attributes: Option<&CFDictionary>,
open_gl_buffer_attributes: Option<&CFDictionary>,
pool_out: NonNull<*mut CVOpenGLBufferPool>,
) -> CVReturn {
extern "C-unwind" {
fn CVOpenGLBufferPoolCreate(
allocator: Option<&CFAllocator>,
pool_attributes: Option<&CFDictionary>,
open_gl_buffer_attributes: Option<&CFDictionary>,
pool_out: NonNull<*mut CVOpenGLBufferPool>,
) -> CVReturn;
}
unsafe {
CVOpenGLBufferPoolCreate(
allocator,
pool_attributes,
open_gl_buffer_attributes,
pool_out,
)
}
}
#[doc(alias = "CVOpenGLBufferPoolGetAttributes")]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub fn attributes(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CVOpenGLBufferPoolGetAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CVOpenGLBufferPoolGetAttributes(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CVOpenGLBufferPoolGetOpenGLBufferAttributes")]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub fn open_gl_buffer_attributes(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CVOpenGLBufferPoolGetOpenGLBufferAttributes(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CVOpenGLBufferPoolCreateOpenGLBuffer")]
#[cfg(all(
feature = "CVBuffer",
feature = "CVImageBuffer",
feature = "CVOpenGLBuffer",
feature = "CVReturn"
))]
#[deprecated = "OpenGL/OpenGLES is no longer supported. Use Metal APIs instead. (Define COREVIDEO_SILENCE_GL_DEPRECATION to silence these warnings)"]
#[inline]
pub unsafe fn create_open_gl_buffer(
allocator: Option<&CFAllocator>,
open_gl_buffer_pool: &CVOpenGLBufferPool,
open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
) -> CVReturn {
extern "C-unwind" {
fn CVOpenGLBufferPoolCreateOpenGLBuffer(
allocator: Option<&CFAllocator>,
open_gl_buffer_pool: &CVOpenGLBufferPool,
open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
) -> CVReturn;
}
unsafe {
CVOpenGLBufferPoolCreateOpenGLBuffer(allocator, open_gl_buffer_pool, open_gl_buffer_out)
}
}
}
extern "C-unwind" {
#[cfg(feature = "CVReturn")]
#[deprecated = "renamed to `CVOpenGLBufferPool::create`"]
pub fn CVOpenGLBufferPoolCreate(
allocator: Option<&CFAllocator>,
pool_attributes: Option<&CFDictionary>,
open_gl_buffer_attributes: Option<&CFDictionary>,
pool_out: NonNull<*mut CVOpenGLBufferPool>,
) -> CVReturn;
}
#[deprecated = "renamed to `CVOpenGLBufferPool::attributes`"]
#[inline]
pub extern "C-unwind" fn CVOpenGLBufferPoolGetAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CVOpenGLBufferPoolGetAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CVOpenGLBufferPoolGetAttributes(pool) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CVOpenGLBufferPool::open_gl_buffer_attributes`"]
#[inline]
pub extern "C-unwind" fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CVOpenGLBufferPoolGetOpenGLBufferAttributes(
pool: &CVOpenGLBufferPool,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CVOpenGLBufferPoolGetOpenGLBufferAttributes(pool) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[cfg(all(
feature = "CVBuffer",
feature = "CVImageBuffer",
feature = "CVOpenGLBuffer",
feature = "CVReturn"
))]
#[deprecated = "renamed to `CVOpenGLBufferPool::create_open_gl_buffer`"]
pub fn CVOpenGLBufferPoolCreateOpenGLBuffer(
allocator: Option<&CFAllocator>,
open_gl_buffer_pool: &CVOpenGLBufferPool,
open_gl_buffer_out: NonNull<*mut CVOpenGLBuffer>,
) -> CVReturn;
}