Struct CVPixelBufferPool
pub struct CVPixelBufferPool(/* private fields */);Expand description
Opaque handle to CVPixelBufferPool
Implementations§
§impl CVPixelBufferPool
impl CVPixelBufferPool
pub fn from_raw(ptr: *mut c_void) -> Option<CVPixelBufferPool>
pub fn from_raw(ptr: *mut c_void) -> Option<CVPixelBufferPool>
Wraps a +1 retained CVPixelBufferPoolRef and returns None for null.
pub const unsafe fn from_ptr(ptr: *mut c_void) -> CVPixelBufferPool
pub const unsafe fn from_ptr(ptr: *mut c_void) -> CVPixelBufferPool
Wraps a raw CVPixelBufferPoolRef by taking ownership without retaining it.
§Safety
The caller must ensure ptr is a valid +1 retained CVPixelBufferPoolRef.
pub fn create(
width: usize,
height: usize,
pixel_format: u32,
max_buffers: usize,
) -> Result<CVPixelBufferPool, i32>
pub fn create( width: usize, height: usize, pixel_format: u32, max_buffers: usize, ) -> Result<CVPixelBufferPool, i32>
Create a new pixel buffer pool
§Arguments
width- Width of pixel buffers in the poolheight- Height of pixel buffers in the poolpixel_format- Pixel format typemax_buffers- Maximum number of buffers in the pool (0 for unlimited)
§Errors
Returns a Core Video error code if the pool creation fails.
pub fn create_pixel_buffer(&self) -> Result<CVPixelBuffer, i32>
pub fn create_pixel_buffer(&self) -> Result<CVPixelBuffer, i32>
Create a pixel buffer from the pool
§Errors
Returns a Core Video error code if the buffer creation fails.
pub fn flush(&self)
pub fn flush(&self)
Flush the pixel buffer pool
Releases all available pixel buffers in the pool
pub fn create_pixel_buffer_with_aux_attributes(
&self,
aux_attributes: Option<&HashMap<String, u32>>,
) -> Result<CVPixelBuffer, i32>
pub fn create_pixel_buffer_with_aux_attributes( &self, aux_attributes: Option<&HashMap<String, u32>>, ) -> Result<CVPixelBuffer, i32>
Create a pixel buffer from the pool with auxiliary attributes
This allows specifying additional attributes for the created buffer
§Errors
Returns a Core Video error code if the buffer creation fails.
pub fn try_create_pixel_buffer(&self) -> Option<CVPixelBuffer>
pub fn try_create_pixel_buffer(&self) -> Option<CVPixelBuffer>
Try to create a pixel buffer from the pool without blocking
Returns None if no buffers are available
pub fn flush_with_options(&self, _flags: u32)
pub fn flush_with_options(&self, _flags: u32)
Flush the pool with specific options
Releases buffers based on the provided flags
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check if the pool is empty (no available buffers)
Note: This is an approximation based on whether we can create a buffer
pub fn attributes(&self) -> Option<*const c_void>
pub fn attributes(&self) -> Option<*const c_void>
Get the pool attributes
Returns the raw pointer to the CFDictionary containing pool attributes
pub fn pixel_buffer_attributes(&self) -> Option<*const c_void>
pub fn pixel_buffer_attributes(&self) -> Option<*const c_void>
Get the pixel buffer attributes
Returns the raw pointer to the CFDictionary containing pixel buffer attributes
Trait Implementations§
§impl Clone for CVPixelBufferPool
impl Clone for CVPixelBufferPool
§fn clone(&self) -> CVPixelBufferPool
fn clone(&self) -> CVPixelBufferPool
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for CVPixelBufferPool
impl Debug for CVPixelBufferPool
§impl Display for CVPixelBufferPool
impl Display for CVPixelBufferPool
§impl Drop for CVPixelBufferPool
impl Drop for CVPixelBufferPool
§impl Hash for CVPixelBufferPool
impl Hash for CVPixelBufferPool
§impl PartialEq for CVPixelBufferPool
impl PartialEq for CVPixelBufferPool
§fn eq(&self, other: &CVPixelBufferPool) -> bool
fn eq(&self, other: &CVPixelBufferPool) -> bool
self and other values to be equal, and is used by ==.