Struct core_media::sample_buffer::CMSampleBuffer

source ·
pub struct CMSampleBuffer(/* private fields */);

Implementations§

source§

impl CMSampleBuffer

source

pub unsafe fn new( data_buffer: Option<&CMBlockBuffer>, data_ready: bool, make_data_ready_callback: CMSampleBufferMakeDataReadyCallback, make_data_ready_refcon: *mut c_void, format_description: Option<&CMFormatDescription>, num_samples: CMItemCount, sample_timing_array: Option<&[CMSampleTimingInfo]>, sample_size_array: Option<&[size_t]> ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn new_with_make_data_ready_closure<F>( data_buffer: Option<&CMBlockBuffer>, data_ready: bool, format_description: Option<&CMFormatDescription>, num_samples: CMItemCount, sample_timing_array: Option<&[CMSampleTimingInfo]>, sample_size_array: Option<&[size_t]>, make_data_ready_closure: Option<F> ) -> Result<CMSampleBuffer, OSStatus>
where F: Fn(CMSampleBuffer) -> OSStatus + 'static,

source

pub fn new_ready( data_buffer: &CMBlockBuffer, format_description: Option<&CMFormatDescription>, num_samples: CMItemCount, sample_timing_array: Option<&[CMSampleTimingInfo]>, sample_size_array: Option<&[size_t]> ) -> Result<CMSampleBuffer, OSStatus>

source

pub unsafe fn new_audio_sample_buffer_with_packet_descriptions( data_buffer: Option<&CMBlockBuffer>, data_ready: bool, make_data_ready_callback: CMSampleBufferMakeDataReadyCallback, make_data_ready_refcon: *mut c_void, format_description: &CMFormatDescription, num_samples: CMItemCount, presentation_time_stamp: CMTime, packet_descriptions: Option<&[AudioStreamPacketDescription]> ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn new_audio_sample_buffer_with_packet_descriptions_and_make_data_ready_closure<F>( data_buffer: Option<&CMBlockBuffer>, data_ready: bool, format_description: &CMFormatDescription, num_samples: CMItemCount, presentation_time_stamp: CMTime, packet_descriptions: Option<&[AudioStreamPacketDescription]>, make_data_ready_closure: Option<F> ) -> Result<CMSampleBuffer, OSStatus>
where F: Fn(CMSampleBuffer) -> OSStatus + 'static,

source

pub fn new_audio_sample_buffer_ready_with_packet_descriptions( data_buffer: &CMBlockBuffer, format_description: &CMFormatDescription, num_samples: CMItemCount, presentation_time_stamp: CMTime, packet_descriptions: Option<&[AudioStreamPacketDescription]> ) -> Result<CMSampleBuffer, OSStatus>

source

pub unsafe fn from_image_buffer( image_buffer: &CVImageBuffer, data_ready: bool, make_data_ready_callback: CMSampleBufferMakeDataReadyCallback, make_data_ready_refcon: *mut c_void, format_description: &CMVideoFormatDescription, sample_timing: &CMSampleTimingInfo ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn from_image_buffer_with_make_data_ready_closure<F>( image_buffer: &CVImageBuffer, data_ready: bool, format_description: &CMVideoFormatDescription, sample_timing: &CMSampleTimingInfo, make_data_ready_closure: Option<F> ) -> Result<CMSampleBuffer, OSStatus>
where F: Fn(CMSampleBuffer) -> OSStatus + 'static,

source

pub fn from_image_buffer_ready( image_buffer: &CVImageBuffer, format_description: &CMVideoFormatDescription, sample_timing: &CMSampleTimingInfo ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn copy(&self) -> Result<CMSampleBuffer, OSStatus>

source

pub fn copy_with_new_timing( &self, sample_timing_array: Option<&[CMSampleTimingInfo]> ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn copy_for_range( &self, sample_range: CFRange ) -> Result<CMSampleBuffer, OSStatus>

source

pub fn set_data_buffer( &self, data_buffer: &CMBlockBuffer ) -> Result<(), OSStatus>

source

pub fn get_data_buffer(&self) -> Option<CMBlockBuffer>

source

pub fn get_image_buffer(&self) -> Option<CVImageBuffer>

source

pub fn set_data_buffer_from_audio_buffer_list( &self, flags: u32, buffer_list: &AudioBufferList ) -> Result<(), OSStatus>

source

pub fn set_data_ready(&self) -> Result<(), OSStatus>

source

pub fn is_data_ready(&self) -> bool

source

pub fn set_data_failed(&self, status: OSStatus) -> Result<(), OSStatus>

source

pub fn has_data_failed(&self) -> (OSStatus, bool)

source

pub fn make_data_ready(&self) -> Result<(), OSStatus>

source

pub fn track_data_readiness( &self, sample_buffer_to_track: &CMSampleBuffer ) -> Result<(), OSStatus>

source

pub fn invalidate(&self) -> Result<(), OSStatus>

source

pub unsafe fn set_invalidate_callback( &self, invalidate_callback: CMSampleBufferInvalidateCallback, invalidate_ref_con: u64 ) -> Result<(), OSStatus>

source

pub fn set_invalidate_closure<F>( &self, invalidate_closure: Option<F> ) -> Result<(), OSStatus>
where F: Fn(CMSampleBuffer) + 'static,

source

pub fn is_valid(&self) -> bool

source

pub fn get_num_samples(&self) -> CMItemCount

source

pub fn get_duration(&self) -> CMTime

source

pub fn get_presentation_time_stamp(&self) -> CMTime

source

pub fn get_decode_time_stamp(&self) -> CMTime

source

pub fn get_output_duration(&self) -> CMTime

source

pub fn get_output_presentation_time_stamp(&self) -> CMTime

source

pub fn set_output_presentation_time_stamp( &self, output_presentation_time_stamp: CMTime ) -> Result<(), OSStatus>

source

pub fn get_output_decode_time_stamp(&self) -> CMTime

source

pub fn get_sample_timing_info_array(&self) -> Option<Vec<CMSampleTimingInfo>>

source

pub fn get_sample_timing_info( &self, sample_index: CMItemCount ) -> Option<CMSampleTimingInfo>

source

pub fn get_sample_size_array(&self) -> Option<Vec<size_t>>

source

pub fn get_sample_size(&self, sample_index: CMItemCount) -> size_t

source

pub fn get_total_sample_size(&self) -> usize

source

pub fn get_format_description(&self) -> Option<CMFormatDescription>

source

pub fn get_sample_attachments_array( &self, create_if_necessary: bool ) -> Option<CFArray<CFDictionary<CFString, CFType>>>

source

pub unsafe fn call_for_each_sample( &self, callback: extern "C" fn(_: CMSampleBufferRef, _: CMItemCount, _: *mut c_void) -> OSStatus, refcon: *mut c_void ) -> Result<(), OSStatus>

source

pub fn call_closure_for_each_sample<F>( &self, closure: Option<F> ) -> Result<(), OSStatus>
where F: Fn(CMSampleBuffer, CMItemCount) -> OSStatus + 'static,

Trait Implementations§

source§

impl Clone for CMSampleBuffer

source§

fn clone(&self) -> CMSampleBuffer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CMSampleBuffer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CMSampleBuffer

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl PartialEq for CMSampleBuffer

source§

fn eq(&self, other: &CMSampleBuffer) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TCFType for CMSampleBuffer

§

type Ref = *mut opaqueCMSampleBuffer

The reference type wrapped inside this type.
source§

fn as_concrete_TypeRef(&self) -> CMSampleBufferRef

Returns the object as its concrete TypeRef.
source§

unsafe fn wrap_under_get_rule(reference: CMSampleBufferRef) -> Self

Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this when following Core Foundation’s “Get Rule”. The reference count is bumped.
source§

fn as_CFTypeRef(&self) -> CFTypeRef

Returns the object as a raw CFTypeRef. The reference count is not adjusted.
source§

unsafe fn wrap_under_create_rule(reference: CMSampleBufferRef) -> Self

Returns an instance of the object, wrapping the underlying CFTypeRef subclass. Use this when following Core Foundation’s “Create Rule”. The reference count is not bumped.
source§

fn type_id() -> CFTypeID

Returns the type ID for this class.
source§

fn as_CFType(&self) -> CFType

Returns the object as a wrapped CFType. The reference count is incremented by one.
source§

fn into_CFType(self) -> CFType
where Self: Sized,

Returns the object as a wrapped CFType. Consumes self and avoids changing the reference count.
source§

fn retain_count(&self) -> isize

Returns the reference count of the object. It is unwise to do anything other than test whether the return value of this method is greater than zero.
source§

fn type_of(&self) -> usize

Returns the type ID of this object.
source§

fn show(&self)

Writes a debugging version of this object on standard error.
source§

fn instance_of<OtherCFType>(&self) -> bool
where OtherCFType: TCFType,

Returns true if this value is an instance of another type.
source§

impl<'a> ToVoid<CMSampleBuffer> for &'a CMSampleBuffer

source§

impl ToVoid<CMSampleBuffer> for CMSampleBufferRef

source§

impl ToVoid<CMSampleBuffer> for CMSampleBuffer

source§

impl ConcreteCFType for CMSampleBuffer

source§

impl Eq for CMSampleBuffer

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromMutVoid for T
where T: TCFType,

source§

unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, T>

source§

impl<T> FromVoid for T
where T: TCFType,

source§

unsafe fn from_void<'a>(x: *const c_void) -> ItemRef<'a, T>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,