Struct CMFormatDescription
pub struct CMFormatDescription(/* private fields */);Expand description
Owned wrapper around CMFormatDescriptionRef.
Implementations§
§impl CMFormatDescription
impl CMFormatDescription
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<CMFormatDescription>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<CMFormatDescription>
Adopts a +1 retained CMFormatDescriptionRef and returns None for null.
§Safety
A non-null ptr must be a live CMFormatDescriptionRef of the exact
type carrying one retain transferred to this wrapper. The caller must
not release or separately adopt that transferred retain.
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<CMFormatDescription>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<CMFormatDescription>
Retains a +0 borrowed CMFormatDescriptionRef and returns an owned wrapper.
§Safety
A non-null ptr must be a live CMFormatDescriptionRef of the exact
type for the duration of the retain call.
pub const unsafe fn from_ptr(ptr: *mut c_void) -> CMFormatDescription
pub const unsafe fn from_ptr(ptr: *mut c_void) -> CMFormatDescription
Wraps a raw CMFormatDescriptionRef by taking ownership without retaining it.
§Safety
ptr must be a non-null, live CMFormatDescriptionRef of the exact
type carrying one retain transferred to this wrapper.
pub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrows the raw +0 CMFormatDescriptionRef while self remains alive.
pub fn media_type_raw(&self) -> u32
pub fn media_type_raw(&self) -> u32
Get the media type as a raw u32 value
pub fn media_type(&self) -> FourCharCode
pub fn media_type(&self) -> FourCharCode
Get the media type as FourCharCode
pub fn media_subtype_raw(&self) -> u32
pub fn media_subtype_raw(&self) -> u32
Get the media subtype (codec type) as a raw u32 value
pub fn media_subtype(&self) -> FourCharCode
pub fn media_subtype(&self) -> FourCharCode
Get the media subtype as FourCharCode
pub fn extensions(&self) -> Option<*const c_void>
pub fn extensions(&self) -> Option<*const c_void>
Get format description extensions
pub fn is_closed_caption(&self) -> bool
pub fn is_closed_caption(&self) -> bool
Check if this is a closed caption format description
pub fn is_metadata(&self) -> bool
pub fn is_metadata(&self) -> bool
Check if this is a metadata format description
pub fn is_timecode(&self) -> bool
pub fn is_timecode(&self) -> bool
Check if this is a timecode format description
pub fn media_type_string(&self) -> String
pub fn media_type_string(&self) -> String
Get a human-readable string for the media type
pub fn media_subtype_string(&self) -> String
pub fn media_subtype_string(&self) -> String
Get a human-readable string for the media subtype (codec)
pub fn video_dimensions(&self) -> Option<(i32, i32)>
pub fn video_parameter_sets(&self) -> Result<CMVideoParameterSets, i32>
pub fn audio_sample_rate(&self) -> Option<f64>
pub fn audio_sample_rate(&self) -> Option<f64>
Get the audio sample rate in Hz
Returns None if this is not an audio format description.
pub fn audio_channel_count(&self) -> Option<u32>
pub fn audio_channel_count(&self) -> Option<u32>
Get the number of audio channels
Returns None if this is not an audio format description.
pub fn audio_bits_per_channel(&self) -> Option<u32>
pub fn audio_bits_per_channel(&self) -> Option<u32>
Get the bits per audio channel
Returns None if this is not an audio format description.
pub fn audio_bytes_per_frame(&self) -> Option<u32>
pub fn audio_bytes_per_frame(&self) -> Option<u32>
Get the bytes per audio frame
Returns None if this is not an audio format description.
pub fn audio_format_flags(&self) -> Option<u32>
pub fn audio_format_flags(&self) -> Option<u32>
Get the audio format flags
Returns None if this is not an audio format description.
pub fn audio_is_float(&self) -> bool
pub fn audio_is_float(&self) -> bool
Check if audio is float format (based on format flags)
pub fn audio_is_big_endian(&self) -> bool
pub fn audio_is_big_endian(&self) -> bool
Check if audio is big-endian (based on format flags)
Trait Implementations§
§impl Clone for CMFormatDescription
impl Clone for CMFormatDescription
§fn clone(&self) -> CMFormatDescription
fn clone(&self) -> CMFormatDescription
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 CMFormatDescription
impl Debug for CMFormatDescription
§impl Display for CMFormatDescription
impl Display for CMFormatDescription
§impl Drop for CMFormatDescription
impl Drop for CMFormatDescription
impl Eq for CMFormatDescription
§impl From<CMMetadataFormatDescription> for CMFormatDescription
impl From<CMMetadataFormatDescription> for CMFormatDescription
§fn from(value: CMMetadataFormatDescription) -> CMFormatDescription
fn from(value: CMMetadataFormatDescription) -> CMFormatDescription
§impl Hash for CMFormatDescription
impl Hash for CMFormatDescription
§impl PartialEq for CMFormatDescription
impl PartialEq for CMFormatDescription
§fn eq(&self, other: &CMFormatDescription) -> bool
fn eq(&self, other: &CMFormatDescription) -> bool
self and other values to be equal, and is used by ==.