#[repr(C)]pub struct CMTimeMapping {
pub source: CMTimeRange,
pub target: CMTimeRange,
}CMTime and CMTimeRange only.Expand description
A CMTimeMapping specifies the mapping of a segment of one time line (called “source”) into another time line (called “target”).
When used for movie edit lists, the source time line is the media and the target time line is the track/movie. Field: source The time range on the source time line. For an empty edit, source.start is an invalid CMTime, in which case source.duration shall be ignored. Otherwise, source.start is the starting time within the source, and source.duration is the duration of the source timeline to be mapped to the target time range. Field: target The time range on the target time line. If target.duration and source.duration are different, then the source segment should be played at rate source.duration/target.duration to fit.
See also Apple’s documentation
Fields§
§source: CMTimeRange§target: CMTimeRangeImplementations§
Source§impl CMTimeMapping
impl CMTimeMapping
Sourcepub unsafe fn new(source: CMTimeRange, target: CMTimeRange) -> CMTimeMapping
pub unsafe fn new(source: CMTimeRange, target: CMTimeRange) -> CMTimeMapping
Make a valid CMTimeMapping with source and target.
Returns: The resulting CMTimeMapping.
The source and target parameters must have durations whose epoch is 0; otherwise an invalid time mapping will be returned.
Sourcepub unsafe fn empty(target: CMTimeRange) -> CMTimeMapping
pub unsafe fn empty(target: CMTimeRange) -> CMTimeMapping
Make a valid CMTimeMapping with an empty source.
Returns: The resulting CMTimeMapping.
The target parameter must have a duration whose epoch is 0; otherwise an invalid time mapping will be returned.
Sourcepub unsafe fn as_dictionary(
self,
allocator: Option<&CFAllocator>,
) -> Option<CFRetained<CFDictionary>>
pub unsafe fn as_dictionary( self, allocator: Option<&CFAllocator>, ) -> Option<CFRetained<CFDictionary>>
Returns a CFDictionary version of a CMTimeMapping.
This is useful when putting CMTimeMappings in CF container types.
Returns: A CFDictionary version of the CMTimeMapping.
Sourcepub unsafe fn from_dictionary(
dictionary_representation: &CFDictionary,
) -> CMTimeMapping
pub unsafe fn from_dictionary( dictionary_representation: &CFDictionary, ) -> CMTimeMapping
Reconstitutes a CMTimeMapping struct from a CFDictionary previously created by CMTimeMappingCopyAsDictionary.
This is useful when getting CMTimeMappings from CF container types. If the CFDictionary does not have the requisite keyed values, an invalid time mapping is returned.
Returns: The created CMTimeMapping.
§Safety
dictionary_representation generics must be of the correct type.
Source§impl CMTimeMapping
impl CMTimeMapping
Sourcepub unsafe fn description(
allocator: Option<&CFAllocator>,
mapping: CMTimeMapping,
) -> Option<CFRetained<CFString>>
pub unsafe fn description( allocator: Option<&CFAllocator>, mapping: CMTimeMapping, ) -> Option<CFRetained<CFString>>
Creates a CFString with a description of a CMTimeMapping (just like CFCopyDescription).
This is used from within CFShow on an object that contains CMTimeMapping fields. It is also useful from other client debugging code. The caller owns the returned CFString and is responsible for releasing it.
Returns: The created CFString description.
Trait Implementations§
Source§impl Clone for CMTimeMapping
impl Clone for CMTimeMapping
Source§fn clone(&self) -> CMTimeMapping
fn clone(&self) -> CMTimeMapping
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CMTimeMapping
impl Debug for CMTimeMapping
Source§impl Encode for CMTimeMapping
Available on crate feature objc2 only.
impl Encode for CMTimeMapping
objc2 only.Source§impl PartialEq for CMTimeMapping
impl PartialEq for CMTimeMapping
Source§impl RefEncode for CMTimeMapping
Available on crate feature objc2 only.
impl RefEncode for CMTimeMapping
objc2 only.