pub struct CMFormatDescription { /* private fields */ }CMFormatDescription only.Expand description
A reference to a CMFormatDescription, a CF object describing media of a particular type (audio, video, muxed, etc).
See also Apple’s documentation
Implementations§
Source§impl CMFormatDescription
impl CMFormatDescription
Sourcepub unsafe fn create(
allocator: Option<&CFAllocator>,
media_type: CMMediaType,
media_sub_type: u32,
extensions: Option<&CFDictionary>,
format_description_out: NonNull<*const CMFormatDescription>,
) -> i32
pub unsafe fn create( allocator: Option<&CFAllocator>, media_type: CMMediaType, media_sub_type: u32, extensions: Option<&CFDictionary>, format_description_out: NonNull<*const CMFormatDescription>, ) -> i32
Creates a generic CMFormatDescription object.
Use this call to create any CMFormatDescription that is composed solely of extensions, and for which CFEqual() of a the extensions dictionaries is a valid test for Format Description equality. Note that for some media types using this routine may result in creating a format description that is not fully specified for the purpose of media processing. Whenever possible, use media-specific format description creations routines such as CMVideoFormatDescriptionCreate, CMAudioFormatDescriptionCreate, etc.
Returns: A new CMFormatDescription object.
§Safety
extensionsgenerics must be of the correct type.format_description_outmust be a valid pointer.
Source§impl CMFormatDescription
impl CMFormatDescription
Sourcepub unsafe fn equal(
format_description: Option<&CMFormatDescription>,
other_format_description: Option<&CMFormatDescription>,
) -> bool
pub unsafe fn equal( format_description: Option<&CMFormatDescription>, other_format_description: Option<&CMFormatDescription>, ) -> bool
Compares two CMFormatDescription objects for equality.
This calls CFEqual on the provided CMFormatDescription objects. In contrast to the CF call it is NULL safe.
Sourcepub unsafe fn equal_ignoring_extension_keys(
format_description: Option<&CMFormatDescription>,
other_format_description: Option<&CMFormatDescription>,
format_description_extension_keys_to_ignore: Option<&CFType>,
sample_description_extension_atom_keys_to_ignore: Option<&CFType>,
) -> bool
pub unsafe fn equal_ignoring_extension_keys( format_description: Option<&CMFormatDescription>, other_format_description: Option<&CMFormatDescription>, format_description_extension_keys_to_ignore: Option<&CFType>, sample_description_extension_atom_keys_to_ignore: Option<&CFType>, ) -> bool
Compares two CMFormatDescription objects for equality, ignoring differences in specified lists of format description extension keys and sample description extension keys.
This function is NULL safe. If any keys are passed, kCMFormatDescriptionExtension_VerbatimSampleDescription and kCMFormatDescriptionExtension_VerbatimISOSampleEntry will also be automatically ignored for the purpose of comparison.
Parameter formatDescriptionExtensionKeysToIgnore: Either a single format description extension key (CFString)
or a CFArray of such keys.
Parameter sampleDescriptionExtensionAtomKeysToIgnore: Either a single sample description extension atom key (four-character CFString)
or a CFArray of such keys.
See kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms.
§Safety
format_description_extension_keys_to_ignoreshould be of the correct type.sample_description_extension_atom_keys_to_ignoreshould be of the correct type.
Sourcepub unsafe fn media_type(&self) -> CMMediaType
pub unsafe fn media_type(&self) -> CMMediaType
Returns the media type of a CMFormatDescription.
For example, returns kCMMediaType_Audio for a description of an audio stream.
Returns: The media type of the CMFormatDescription.
Sourcepub unsafe fn media_sub_type(&self) -> u32
pub unsafe fn media_sub_type(&self) -> u32
Returns the media subtype of a CMFormatDescription.
The media subtype is defined in a media-specific way. For audio streams, the media subtype is the asbd.mFormatID. For video streams, the media subtype is the video codec type. For muxed streams, it is the format of the muxed stream. For example, ’aac ’ is returned for a description of an AAC audio stream, ‘avc1’ is returned for a description of an H.264 video stream, and ‘mp2t’ is returned for a description of an MPEG-2 transport (muxed) stream. If a particular type of media stream does not have subtypes, this API may return 0.
Returns: The media subtype of the CMFormatDescription.
Sourcepub unsafe fn extensions(&self) -> Option<CFRetained<CFDictionary>>
pub unsafe fn extensions(&self) -> Option<CFRetained<CFDictionary>>
Returns an immutable dictionary containing all the extensions of a CMFormatDescription.
If there are no extensions, NULL is returned. Extensions dictionaries are valid property list objects. This means that dictionary keys are all CFStrings, and the values are all either CFNumber, CFString, CFBoolean, CFArray, CFDictionary, CFDate, or CFData. The returned dictionary is not retained by this call, so clients are required to retain it if they need to keep it longer.
Returns: An immutable dictionary containing all the extensions of the CMFormatDescription. May be NULL.
Source§impl CMFormatDescription
impl CMFormatDescription
Sourcepub unsafe fn extension(
&self,
extension_key: &CFString,
) -> Option<CFRetained<CFPropertyList>>
pub unsafe fn extension( &self, extension_key: &CFString, ) -> Option<CFRetained<CFPropertyList>>
Returns the specified extension of a CMFormatDescription.
If the named extension does not exist, NULL is returned. The extension is always a valid property list object. This means that it will be either a CFNumber, CFString, CFBoolean, CFArray, CFDictionary, CFDate, or CFData. If it is a CFDictionary, the keys will all be CFStrings. The returned extension is not retained by this call, so it is only valid as long as the CMFormatDescription is valid. Clients are required to retain it if they need to keep it longer.
Returns: The specified extension of the CMFormatDescription. May be NULL.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Available on crate feature CMAttachment only.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
CMAttachment only.Attempt to downcast the type to that of type T.
This is the reference-variant. Use CFRetained::downcast if you
want to convert a retained type. See also ConcreteType for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
Available on crate feature CMAttachment only.
pub fn retain_count(&self) -> usize
CMAttachment only.Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CMFormatDescription
impl AsRef<AnyObject> for CMFormatDescription
Source§impl AsRef<CFType> for CMFormatDescription
impl AsRef<CFType> for CMFormatDescription
Source§impl Borrow<AnyObject> for CMFormatDescription
impl Borrow<AnyObject> for CMFormatDescription
Source§impl Borrow<CFType> for CMFormatDescription
impl Borrow<CFType> for CMFormatDescription
Source§impl ConcreteType for CMFormatDescription
impl ConcreteType for CMFormatDescription
Source§impl Debug for CMFormatDescription
impl Debug for CMFormatDescription
Source§impl Deref for CMFormatDescription
impl Deref for CMFormatDescription
Source§impl Hash for CMFormatDescription
impl Hash for CMFormatDescription
Source§impl Message for CMFormatDescription
impl Message for CMFormatDescription
Source§impl PartialEq for CMFormatDescription
impl PartialEq for CMFormatDescription
Source§impl RefEncode for CMFormatDescription
impl RefEncode for CMFormatDescription
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for CMFormatDescription
impl Type for CMFormatDescription
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more