pub struct CMFormatDescription(/* private fields */);cm only.Expand description
Owned wrapper around CMFormatDescriptionRef.
Implementations§
Source§impl CMFormatDescription
impl CMFormatDescription
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 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.
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 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.
Sourcepub const unsafe fn from_ptr(ptr: *mut c_void) -> Self
pub const unsafe fn from_ptr(ptr: *mut c_void) -> Self
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.
Sourcepub 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.
Sourcepub fn media_type_raw(&self) -> u32
pub fn media_type_raw(&self) -> u32
Get the media type as a raw u32 value
Sourcepub fn media_type(&self) -> FourCharCode
pub fn media_type(&self) -> FourCharCode
Get the media type as FourCharCode
Sourcepub fn media_subtype_raw(&self) -> u32
pub fn media_subtype_raw(&self) -> u32
Get the media subtype (codec type) as a raw u32 value
Sourcepub fn media_subtype(&self) -> FourCharCode
pub fn media_subtype(&self) -> FourCharCode
Get the media subtype as FourCharCode
Sourcepub fn extensions(&self) -> Option<*const c_void>
pub fn extensions(&self) -> Option<*const c_void>
Get format description extensions
Sourcepub fn is_closed_caption(&self) -> bool
pub fn is_closed_caption(&self) -> bool
Check if this is a closed caption format description
Sourcepub fn is_metadata(&self) -> bool
pub fn is_metadata(&self) -> bool
Check if this is a metadata format description
Sourcepub fn is_timecode(&self) -> bool
pub fn is_timecode(&self) -> bool
Check if this is a timecode format description
Sourcepub fn media_type_string(&self) -> String
pub fn media_type_string(&self) -> String
Get a human-readable string for the media type
Sourcepub fn media_subtype_string(&self) -> String
pub fn media_subtype_string(&self) -> String
Get a human-readable string for the media subtype (codec)
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Sourcepub fn audio_is_float(&self) -> bool
pub fn audio_is_float(&self) -> bool
Check if audio is float format (based on format flags)
Sourcepub 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)