pub struct CMMetadataFormatDescription(/* private fields */);cm only.Expand description
Metadata-specific wrapper around CMFormatDescriptionRef.
Implementations§
Source§impl CMMetadataFormatDescription
impl CMMetadataFormatDescription
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopt a retained raw metadata format-description pointer.
Sourcepub const unsafe fn from_ptr(ptr: *mut c_void) -> Self
pub const unsafe fn from_ptr(ptr: *mut c_void) -> Self
§Safety
The caller must ensure the pointer is a valid metadata CMFormatDescription pointer.
pub const fn as_ptr(&self) -> *mut c_void
Sourcepub const fn as_format_description(&self) -> &CMFormatDescription
pub const fn as_format_description(&self) -> &CMFormatDescription
Access the metadata description as a plain CMFormatDescription.
Sourcepub fn into_format_description(self) -> CMFormatDescription
pub fn into_format_description(self) -> CMFormatDescription
Consume the metadata wrapper and return the underlying CMFormatDescription.
Sourcepub fn create_with_keys(
metadata_type: FourCharCode,
keys: Option<&CFArray>,
) -> Result<Self, i32>
pub fn create_with_keys( metadata_type: FourCharCode, keys: Option<&CFArray>, ) -> Result<Self, i32>
Create a metadata format description from an optional array of key dictionaries.
§Errors
Returns the OSStatus reported by Core Media if the description could not be created.
Sourcepub fn create_with_metadata_specifications(
metadata_type: FourCharCode,
metadata_specifications: &CFArray,
) -> Result<Self, i32>
pub fn create_with_metadata_specifications( metadata_type: FourCharCode, metadata_specifications: &CFArray, ) -> Result<Self, i32>
Create a boxed metadata format description from metadata specification dictionaries.
§Errors
Returns the OSStatus reported by Core Media if the description could not be created.
Sourcepub fn extend_with_metadata_specifications(
&self,
metadata_specifications: &CFArray,
) -> Result<Self, i32>
pub fn extend_with_metadata_specifications( &self, metadata_specifications: &CFArray, ) -> Result<Self, i32>
Extend an existing metadata description with additional metadata specifications.
§Errors
Returns the OSStatus reported by Core Media if the extended description could not be created.
Sourcepub fn merge(&self, other: &Self) -> Result<Self, i32>
pub fn merge(&self, other: &Self) -> Result<Self, i32>
Merge two metadata format descriptions into a new description.
§Errors
Returns the OSStatus reported by Core Media if the merged description could not be created.
Sourcepub fn identifiers(&self) -> Option<CFArray>
pub fn identifiers(&self) -> Option<CFArray>
Copy the metadata identifiers declared by this description.
Sourcepub fn key_with_local_id(&self, local_id: u32) -> Option<CFDictionary>
pub fn key_with_local_id(&self, local_id: u32) -> Option<CFDictionary>
Copy the metadata key dictionary for local_id, if present.
Methods from Deref<Target = CMFormatDescription>§
pub fn as_ptr(&self) -> *mut c_void
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)
Trait Implementations§
Source§impl Clone for CMMetadataFormatDescription
impl Clone for CMMetadataFormatDescription
Source§fn clone(&self) -> CMMetadataFormatDescription
fn clone(&self) -> CMMetadataFormatDescription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CMMetadataFormatDescription
impl Debug for CMMetadataFormatDescription
Source§impl Deref for CMMetadataFormatDescription
impl Deref for CMMetadataFormatDescription
Source§impl From<CMMetadataFormatDescription> for CMFormatDescription
impl From<CMMetadataFormatDescription> for CMFormatDescription
Source§fn from(value: CMMetadataFormatDescription) -> Self
fn from(value: CMMetadataFormatDescription) -> Self
Source§impl Hash for CMMetadataFormatDescription
impl Hash for CMMetadataFormatDescription
Source§impl PartialEq for CMMetadataFormatDescription
impl PartialEq for CMMetadataFormatDescription
Source§fn eq(&self, other: &CMMetadataFormatDescription) -> bool
fn eq(&self, other: &CMMetadataFormatDescription) -> bool
self and other values to be equal, and is used by ==.