pub struct CVBuffer(/* private fields */);Available on crate feature
cv only.Expand description
Generic CVBufferRef wrapper.
Implementations§
Source§impl CVBuffer
impl CVBuffer
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CVBufferRef and returns None for null.
§Safety
A non-null ptr must be a live CVBufferRef of the exact type carrying
one retain transferred to this wrapper. The caller must not release or
separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CVBufferRef and returns an owned wrapper.
§Safety
A non-null ptr must be a live CVBufferRef of the exact type for the
duration of the retain call.
Sourcepub fn from_pixel_buffer(pixel_buffer: &CVPixelBuffer) -> Option<Self>
pub fn from_pixel_buffer(pixel_buffer: &CVPixelBuffer) -> Option<Self>
Wrap a pixel buffer as a generic CVBuffer.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrow the raw +0 CVBufferRef while self remains alive.
Sourcepub fn set_attachment(
&self,
key: &CFString,
value: &dyn AsCFType,
mode: CVAttachmentMode,
)
pub fn set_attachment( &self, key: &CFString, value: &dyn AsCFType, mode: CVAttachmentMode, )
Attach a Core Foundation value to the buffer.
Sourcepub fn attachment(&self, key: &CFString) -> Option<CFType>
pub fn attachment(&self, key: &CFString) -> Option<CFType>
Copy an attachment value for key.
Sourcepub fn attachments(&self, mode: CVAttachmentMode) -> Option<CFDictionary>
pub fn attachments(&self, mode: CVAttachmentMode) -> Option<CFDictionary>
Copy all attachments for the requested propagation mode.
Sourcepub fn remove_all_attachments(&self)
pub fn remove_all_attachments(&self)
Remove all attachments.
Trait Implementations§
impl Eq for CVBuffer
Auto Trait Implementations§
impl !Send for CVBuffer
impl !Sync for CVBuffer
impl Freeze for CVBuffer
impl RefUnwindSafe for CVBuffer
impl Unpin for CVBuffer
impl UnsafeUnpin for CVBuffer
impl UnwindSafe for CVBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more