AVMutableComposition

Struct AVMutableComposition 

Source
pub struct AVMutableComposition { /* private fields */ }
Available on crate features AVAsset and AVComposition only.
Expand description

Implementations§

Source§

impl AVMutableComposition

Source

pub unsafe fn tracks(&self) -> Retained<NSArray<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack only.

Provides the array of AVMutableCompositionTracks contained by the composition.

Source

pub unsafe fn naturalSize(&self) -> CGSize

Available on crate feature objc2-core-foundation only.

Indicates the authored size of the visual portion of the asset.

If not set, the value is the size of the composition’s first video track. Set to CGSizeZero to revert to default behavior.

Source

pub unsafe fn setNaturalSize(&self, natural_size: CGSize)

Available on crate feature objc2-core-foundation only.

Setter for naturalSize.

Source

pub unsafe fn composition() -> Retained<Self>

Returns an empty AVMutableComposition.

Source

pub unsafe fn compositionWithURLAssetInitializationOptions( url_asset_initialization_options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<Self>

Returns an empty AVMutableComposition.

Parameter URLAssetInitializationOptions: Specifies the initialization options that the receiver should use when creating AVURLAssets internally, e.g. AVURLAssetPreferPreciseDurationAndTimingKey. The default behavior for creation of AVURLAssets by an AVMutableComposition is equivalent to the behavior of +[AVURLAsset URLAssetWithURL:options:] when specifying no initialization options.

AVMutableCompositions create AVURLAssets internally for URLs specified by AVCompositionTrackSegments of AVMutableCompositionTracks, as needed, whenever AVCompositionTrackSegments are added to tracks via -[AVMutableCompositionTrack setSegments:] rather than by inserting timeranges of already existing AVAssets or AVAssetTracks.

§Safety

url_asset_initialization_options generic should be of the correct type.

Source§

impl AVMutableComposition

Methods declared on superclass AVAsset.

Source

pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>

Returns an instance of AVAsset for inspection of a media resource.

Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.

  • Parameter URL: An instance of NSURL that references a media resource.

  • Returns: An instance of AVAsset.

Source§

impl AVMutableComposition

Methods declared on superclass NSObject.

Source

pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>

Source

pub unsafe fn new() -> Retained<Self>

Source§

impl AVMutableComposition

AVMutableCompositionCompositionLevelEditing.

Source

pub unsafe fn insertTimeRange_ofAsset_atTime_error( &self, time_range: CMTimeRange, asset: &AVAsset, start_time: CMTime, ) -> Result<(), Retained<NSError>>

👎Deprecated
Available on crate feature objc2-core-media only.

Inserts all the tracks of a timeRange of an asset into a composition.

Parameter timeRange: Specifies the timeRange of the asset to be inserted.

Parameter asset: Specifies the asset that contains the tracks that are to be inserted. Only instances of AVURLAsset and AVComposition are supported (AVComposition starting in macOS 10.10 and iOS 8.0). The asset should have its tracks loaded, and the tracks should have their formatDescriptions loaded before invoking this method to avoid blocking.

Parameter startTime: Specifies the time at which the inserted tracks are to be presented by the composition.

Parameter outError: Describes failures that may be reported to the user, e.g. the asset that was selected for insertion in the composition is restricted by copy-protection.

Returns: A BOOL value indicating the success of the insertion.

You provide a reference to an AVAsset and the timeRange within it that you want to insert. You specify the start time in the destination composition at which the timeRange should be inserted. This method may add new tracks to ensure that all tracks of the asset are represented in the inserted timeRange. Note that the media data for the inserted timeRange will be presented at its natural duration and rate. It can be scaled to a different duration and presented at a different rate via -scaleTimeRange:toDuration:. Existing content at the specified startTime will be pushed out by the duration of timeRange. Note that this operation only inserts one or more track segments into affected AVMutableCompositionTracks; it does not affect the values of other track properties, either to match the corresponding values of tracks in the source asset or for any other purpose.

Source

pub unsafe fn insertTimeRange_ofAsset_atTime_completionHandler( &self, time_range: CMTimeRange, asset: &AVAsset, start_time: CMTime, completion_handler: &DynBlock<dyn Fn(*mut NSError)>, )

Available on crate features block2 and objc2-core-media only.

Inserts all the tracks of a timeRange of an asset into a composition.

Parameter timeRange: Specifies the timeRange of the asset to be inserted.

Parameter asset: Specifies the asset that contains the tracks that are to be inserted. Only instances of AVURLAsset and AVComposition are supported (AVComposition starting in macOS 10.10 and iOS 8.0).

Parameter startTime: Specifies the time at which the inserted tracks are to be presented by the composition.

Parameter completionHandler: A block that is invoked when the insertion is complete. If the error parameter is non-nil, it describes a failure that may be reported to the user, e.g. the asset that was selected for insertion in the composition is restricted by copy-protection.

You provide a reference to an AVAsset and the timeRange within it that you want to insert. You specify the start time in the destination composition at which the timeRange should be inserted. This method may add new tracks to ensure that all tracks of the asset are represented in the inserted timeRange. Note that the media data for the inserted timeRange will be presented at its natural duration and rate. It can be scaled to a different duration and presented at a different rate via -scaleTimeRange:toDuration:. Existing content at the specified startTime will be pushed out by the duration of timeRange. Note that this operation only inserts one or more track segments into affected AVMutableCompositionTracks; it does not affect the values of other track properties, either to match the corresponding values of tracks in the source asset or for any other purpose.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn insertEmptyTimeRange(&self, time_range: CMTimeRange)

Available on crate feature objc2-core-media only.

Adds or extends an empty timeRange within all tracks of the composition.

Parameter timeRange: Specifies the empty timeRange to be inserted.

If you insert an empty timeRange into the composition, any media that was presented during that interval prior to the insertion will be presented instead immediately afterward. You can use this method to reserve an interval in which you want a subsequently created track to present its media. Note that you cannot add empty time ranges to the end of a composition.

Source

pub unsafe fn removeTimeRange(&self, time_range: CMTimeRange)

Available on crate feature objc2-core-media only.

Removes a specified timeRange from all tracks of the composition.

Parameter timeRange: Specifies the timeRange to be removed.

Removal of a time range does not cause any existing tracks to be removed from the composition, even if removing timeRange results in an empty track. Instead, it removes or truncates track segments that intersect with the timeRange.

After removing, existing content after timeRange will be pulled in.

Source

pub unsafe fn scaleTimeRange_toDuration( &self, time_range: CMTimeRange, duration: CMTime, )

Available on crate feature objc2-core-media only.

Changes the duration of a timeRange of all tracks.

Parameter timeRange: Specifies the timeRange of the composition to be scaled.

Parameter duration: Specifies the new duration of the timeRange.

Each trackSegment affected by the scaling operation will be presented at a rate equal to source.duration / target.duration of its resulting timeMapping.

Source§

impl AVMutableComposition

AVMutableCompositionTrackLevelEditing.

Source

pub unsafe fn addMutableTrackWithMediaType_preferredTrackID( &self, media_type: &AVMediaType, preferred_track_id: CMPersistentTrackID, ) -> Option<Retained<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat and objc2-core-media only.

Adds an empty track to a mutable composition.

Parameter mediaType: The media type of the new track.

Parameter preferredTrackID: Specifies the preferred track ID for the new track. If you do not need to specify a preferred track ID, pass kCMPersistentTrackID_Invalid. Otherwise the preferred track ID will be used for the new track, provided that it is not currently in use and has not previously been used.

Returns: An instance of AVMutableCompositionTrack representing the new track. Its actual trackID is available via its “ trackID“ key.

If the specified preferred track ID is not available, or kCMPersistentTrackID_Invalid was passed in, a unique track ID will be generated.

Source

pub unsafe fn removeTrack(&self, track: &AVCompositionTrack)

Available on crate features AVAssetTrack and AVCompositionTrack only.

Removes a track of a mutable composition.

Parameter track: A reference to the AVCompositionTrack to be removed.

If you retain a reference to the removed track, note that its “ composition“ key will have the value nil, and the values of its other properties are undefined.

Source

pub unsafe fn mutableTrackCompatibleWithTrack( &self, track: &AVAssetTrack, ) -> Option<Retained<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack only.

Provides a reference to a track of a mutable composition into which any timeRange of an AVAssetTrack can be inserted (via -[AVMutableCompositionTrack insertTimeRange:ofTrack:atTime:error:]).

Parameter track: A reference to the AVAssetTrack from which a timeRange may be inserted.

Returns: An AVMutableCompositionTrack that can accommodate the insertion, or, if no such track is available, nil.

If a compatible track is desired but the result of this method is nil, a new track of the same mediaType as the AVAssetTrack can be created via -addMutableTrackWithMediaType:preferredTrackID:, and this new track will be compatible.

For best performance, the number of tracks of a composition should be kept to a minimum, corresponding to the number for which media data must be presented in parallel. If media data of the same type is to be presented serially, even from multiple assets, a single track of that media type should be used. This method, -mutableTrackCompatibleWithTrack:, can help the client to identify an existing target track for an insertion.

Similar to -[AVAsset compatibleTrackForCompositionTrack:].

Source§

impl AVMutableComposition

AVMutableCompositionTrackInspection.

Source

pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and objc2-core-media only.

Provides an instance of AVMutableCompositionTrack that represents the track of the specified trackID.

Parameter trackID: The trackID of the requested AVMutableCompositionTrack.

Returns: An instance of AVMutableCompositionTrack; may be nil if no track of the specified trackID is available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &DynBlock<dyn Fn(*mut AVMutableCompositionTrack, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and block2 and objc2-core-media only.

Loads an instance of AVMutableCompositionTrack that represents the track of the specified trackID.

Parameter trackID: The trackID of the requested AVMutableCompositionTrack.

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat only.

Provides an array of AVMutableCompositionTracks of the asset that present media of the specified media type.

Parameter mediaType: The media type according to which the receiver filters its AVMutableCompositionTracks. (Media types are defined in AVMediaFormat.h)

Returns: An NSArray of AVMutableCompositionTracks; may be empty if no tracks of the specified media type are available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVMutableCompositionTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat and block2 only.

Loads an array of AVMutableCompositionTracks of the asset that present media of the specified media type.

Parameter mediaType: The media type according to which AVAsset filters its AVMutableCompositionTracks. (Media types are defined in AVMediaFormat.h.)

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVMutableCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat only.

Provides an array of AVMutableCompositionTracks of the asset that present media with the specified characteristic.

Parameter mediaCharacteristic: The media characteristic according to which the receiver filters its AVMutableCompositionTracks. (Media characteristics are defined in AVMediaFormat.h)

Returns: An NSArray of AVMutableCompositionTracks; may be empty if no tracks with the specified characteristic are available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVMutableCompositionTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat and block2 only.

Loads an array of AVMutableCompositionTracks of the asset that present media with the specified characteristic.

Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVMutableCompositionTracks. (Media characteristics are defined in AVMediaFormat.h.)

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.

§Safety

completion_handler block must be sendable.

Methods from Deref<Target = AVComposition>§

Source

pub unsafe fn tracks(&self) -> Retained<NSArray<AVCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack only.

Provides the array of AVCompositionTracks contained by the composition.

Source

pub unsafe fn naturalSize(&self) -> CGSize

Available on crate feature objc2-core-foundation only.

Indicates the authored size of the visual portion of the composition.

Source

pub unsafe fn URLAssetInitializationOptions( &self, ) -> Retained<NSDictionary<NSString, AnyObject>>

Specifies the initialization options for the creation of AVURLAssets by the receiver, e.g. AVURLAssetPreferPreciseDurationAndTimingKey. The default behavior for creation of AVURLAssets by an AVComposition is equivalent to the behavior of +[AVURLAsset URLAssetWithURL:options:] when specifying no initialization options.

AVCompositions create AVURLAssets internally for URLs specified by AVCompositionTrackSegments of AVCompositionTracks, as needed, whenever AVCompositionTrackSegments were originally added to a track via -[AVMutableCompositionTrack setSegments:] rather than by inserting timeranges of already existing AVAssets or AVAssetTracks. The value of URLAssetInitializationOptions can be specified at the time an AVMutableComposition is created via +compositionWithURLAssetInitializationOptions:.

Source

pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and objc2-core-media only.

Provides an instance of AVCompositionTrack that represents the track of the specified trackID.

Parameter trackID: The trackID of the requested AVCompositionTrack.

Returns: An instance of AVCompositionTrack; may be nil if no track of the specified trackID is available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &DynBlock<dyn Fn(*mut AVCompositionTrack, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and block2 and objc2-core-media only.

Loads an instance of AVCompositionTrack that represents the track of the specified trackID.

Parameter trackID: The trackID of the requested AVCompositionTrack.

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat only.

Provides an array of AVCompositionTracks of the asset that present media of the specified media type.

Parameter mediaType: The media type according to which the receiver filters its AVCompositionTracks. (Media types are defined in AVMediaFormat.h)

Returns: An NSArray of AVCompositionTracks; may be empty if no tracks of the specified media type are available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVCompositionTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat and block2 only.

Loads an array of AVCompositionTracks of the asset that present media of the specified media type.

Parameter mediaType: The media type according to which AVAsset filters its AVCompositionTracks. (Media types are defined in AVMediaFormat.h.)

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVCompositionTrack>>

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat only.

Provides an array of AVCompositionTracks of the asset that present media with the specified characteristic.

Parameter mediaCharacteristic: The media characteristic according to which the receiver filters its AVCompositionTracks. (Media characteristics are defined in AVMediaFormat.h)

Returns: An NSArray of AVCompositionTracks; may be empty if no tracks with the specified characteristic are available.

Becomes callable without blocking when the key “ tracks“ has been loaded

Source

pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVCompositionTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVCompositionTrack and AVMediaFormat and block2 only.

Loads an array of AVCompositionTracks of the asset that present media with the specified characteristic.

Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVCompositionTracks. (Media characteristics are defined in AVMediaFormat.h.)

Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.

§Safety

completion_handler block must be sendable.

Source

pub unsafe fn metadataForFormat( &self, format: &AVMetadataFormat, ) -> Retained<NSArray<AVMetadataItem>>

Available on crate features AVMetadataFormat and AVMetadataItem only.
Source

pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys( &self, locale: &NSLocale, common_keys: Option<&NSArray<AVMetadataKey>>, ) -> Retained<NSArray<AVTimedMetadataGroup>>

Available on crate features AVMetadataFormat and AVTimedMetadataGroup only.
Source

pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages( &self, preferred_languages: &NSArray<NSString>, ) -> Retained<NSArray<AVTimedMetadataGroup>>

Available on crate feature AVTimedMetadataGroup only.
Source

pub unsafe fn mediaSelectionGroupForMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Option<Retained<AVMediaSelectionGroup>>

Available on crate features AVMediaFormat and AVMediaSelectionGroup only.
Source

pub unsafe fn unusedTrackID(&self) -> CMPersistentTrackID

Available on crate feature objc2-core-media only.

Methods from Deref<Target = AVAsset>§

Source

pub unsafe fn duration(&self) -> CMTime

Available on crate feature objc2-core-media only.

Indicates the duration of the asset.

If “ providesPreciseDurationAndTiming“ is NO, a best-available estimate of the duration is returned. The degree of precision preferred for timing-related properties can be set at initialization time for assets initialized with URLs

  • Seealso: AVURLAssetPreferPreciseDurationAndTimingKey for AVURLAsset below.
Source

pub unsafe fn preferredRate(&self) -> c_float

Indicates the natural rate at which the asset is to be played; often but not always 1.0

Source

pub unsafe fn preferredVolume(&self) -> c_float

Indicates the preferred volume at which the audible media of an asset is to be played; often but not always 1.0

Source

pub unsafe fn preferredTransform(&self) -> CGAffineTransform

Available on crate feature objc2-core-foundation only.

Indicates the preferred transform to apply to the visual content of the asset for presentation or processing; the value is often but not always the identity transform

Source

pub unsafe fn naturalSize(&self) -> CGSize

👎Deprecated: Use the naturalSize and preferredTransform, as appropriate, of the receiver’s video tracks. See -tracksWithMediaType:
Available on crate feature objc2-core-foundation only.

The following property is deprecated. Instead, use the naturalSize and preferredTransform, as appropriate, of the receiver’s video tracks. See -tracksWithMediaType: below.

Source

pub unsafe fn minimumTimeOffsetFromLive(&self) -> CMTime

Available on crate feature objc2-core-media only.

Indicates how close to the latest content in a live stream playback can be sustained.

For non-live assets this value is kCMTimeInvalid.

Source

pub unsafe fn providesPreciseDurationAndTiming(&self) -> bool

Indicates that the asset provides precise timing. See “ duration“ above and AVURLAssetPreferPreciseDurationAndTimingKey below.

Source

pub unsafe fn cancelLoading(&self)

Cancels the loading of all values for all observers.

Deallocation or finalization of an instance of AVAsset will implicitly cancel loading if any loading requests are still outstanding.

Source

pub unsafe fn referenceRestrictions(&self) -> AVAssetReferenceRestrictions

Indicates the reference restrictions being used by the receiver.

For AVURLAsset, this property reflects the value passed in for AVURLAssetReferenceRestrictionsKey, if any. See AVURLAssetReferenceRestrictionsKey below for a full discussion of reference restrictions. The default value for this property is AVAssetReferenceRestrictionForbidLocalReferenceToRemote.

Source

pub unsafe fn tracks(&self) -> Retained<NSArray<AVAssetTrack>>

Available on crate feature AVAssetTrack only.

Provides the array of AVAssetTracks contained by the asset

Source

pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVAssetTrack>>

👎Deprecated: Use loadTrackWithTrackID:completionHandler: instead
Available on crate features AVAssetTrack and objc2-core-media only.

Provides an instance of AVAssetTrack that represents the track of the specified trackID.

Becomes callable without blocking when the key “ tracks“ has been loaded

  • Parameter trackID: The trackID of the requested AVAssetTrack.

  • Returns: An instance of AVAssetTrack; may be nil if no track of the specified trackID is available.

Source

pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &DynBlock<dyn Fn(*mut AVAssetTrack, *mut NSError)>, )

Available on crate features AVAssetTrack and block2 and objc2-core-media only.

Loads an instance of AVAssetTrack that represents the track of the specified trackID.

  • Parameter trackID: The trackID of the requested AVAssetTrack.
  • Parameter completionHandler: A block that is called when the loading is finished, with either the loaded track (which may be nil if no track of the specified trackID is available) or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVAssetTrack>>

👎Deprecated: Use loadTracksWithMediaType:completionHandler: instead
Available on crate features AVAssetTrack and AVMediaFormat only.

Provides an array of AVAssetTracks of the asset that present media of the specified media type.

Becomes callable without blocking when the key “ tracks“ has been loaded

  • Parameter mediaType: The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)

  • Returns: An NSArray of AVAssetTracks; may be empty if no tracks of the specified media type are available.

Source

pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVMediaFormat and block2 only.

Loads an array of AVAssetTracks of the asset that present media of the specified media type.

  • Parameter mediaType: The media type according to which AVAsset filters its AVAssetTracks. (Media types are defined in AVMediaFormat.h.)
  • Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks of the specified media type are available) or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVAssetTrack>>

👎Deprecated: Use loadTracksWithMediaCharacteristic:completionHandler: instead
Available on crate features AVAssetTrack and AVMediaFormat only.

Provides an array of AVAssetTracks of the asset that present media with the specified characteristic.

Becomes callable without blocking when the key “ tracks“ has been loaded

  • Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)

  • Returns: An NSArray of AVAssetTracks; may be empty if no tracks with the specified characteristic are available.

Source

pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>, )

Available on crate features AVAssetTrack and AVMediaFormat and block2 only.

Loads an array of AVAssetTracks of the asset that present media with the specified characteristic.

  • Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVAssetTracks. (Media characteristics are defined in AVMediaFormat.h.)
  • Parameter completionHandler: A block that is called when the loading is finished, with either the loaded tracks (which may be empty if no tracks with the specified characteristic are available) or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn trackGroups(&self) -> Retained<NSArray<AVAssetTrackGroup>>

Available on crate feature AVAssetTrackGroup only.

All track groups in the receiver.

The value of this property is an NSArray of AVAssetTrackGroups, each representing a different grouping of tracks in the receiver.

Source

pub unsafe fn creationDate(&self) -> Option<Retained<AVMetadataItem>>

Available on crate feature AVMetadataItem only.

Indicates the creation date of the asset as an AVMetadataItem. May be nil. If a creation date has been stored by the asset in a form that can be converted to an NSDate, the dateValue property of the AVMetadataItem will provide an instance of NSDate. Otherwise the creation date is available only as a string value, via -[AVMetadataItem stringValue].

Source

pub unsafe fn lyrics(&self) -> Option<Retained<NSString>>

Provides access to the lyrics of the asset suitable for the current locale.

Source

pub unsafe fn commonMetadata(&self) -> Retained<NSArray<AVMetadataItem>>

Available on crate feature AVMetadataItem only.

Provides access to an array of AVMetadataItems for each common metadata key for which a value is available; items can be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:] and according to identifier via +[AVMetadataItem metadataItemsFromArray:filteredByIdentifier:].

Source

pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>

Available on crate feature AVMetadataItem only.

Provides access to an array of AVMetadataItems for all metadata identifiers for which a value is available; items can be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:] and according to identifier via +[AVMetadataItem metadataItemsFromArray:filteredByIdentifier:].

Source

pub unsafe fn availableMetadataFormats( &self, ) -> Retained<NSArray<AVMetadataFormat>>

Available on crate feature AVMetadataFormat only.

Provides an NSArray of NSStrings, each representing a metadata format that’s available to the asset (e.g. ID3, iTunes metadata, etc.). Metadata formats are defined in AVMetadataFormat.h.

Source

pub unsafe fn metadataForFormat( &self, format: &AVMetadataFormat, ) -> Retained<NSArray<AVMetadataItem>>

👎Deprecated: Use loadMetadataForFormat:completionHandler: instead
Available on crate features AVMetadataFormat and AVMetadataItem only.

Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].

Becomes callable without blocking when the key “ availableMetadataFormats“ has been loaded

  • Parameter format: The metadata format for which items are requested.

  • Returns: An NSArray containing AVMetadataItems; may be empty if there is no metadata of the specified format.

Source

pub unsafe fn loadMetadataForFormat_completionHandler( &self, format: &AVMetadataFormat, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVMetadataItem>, *mut NSError)>, )

Available on crate features AVMetadataFormat and AVMetadataItem and block2 only.

Loads an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format; can subsequently be filtered according to language via +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:], according to locale via +[AVMetadataItem metadataItemsFromArray:withLocale:], or according to key via +[AVMetadataItem metadataItemsFromArray:withKey:keySpace:].

  • Parameter format: The metadata format for which items are requested.
  • Parameter completionHandler: A block that is invoked when loading is complete, vending the array of metadata items (which may be empty if there is no metadata of the specified format) or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn availableChapterLocales(&self) -> Retained<NSArray<NSLocale>>

array of NSLocale

Source

pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys( &self, locale: &NSLocale, common_keys: Option<&NSArray<AVMetadataKey>>, ) -> Retained<NSArray<AVTimedMetadataGroup>>

👎Deprecated: Use loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler: instead
Available on crate features AVMetadataFormat and AVTimedMetadataGroup only.

Provides an array of chapters.

This method returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.

An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.

Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].

  • Parameter locale: Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).

  • Parameter commonKeys: Array of common keys of AVMetadataItem to be included; can be nil. AVMetadataCommonKeyArtwork is the only supported key for now.

  • Returns: An NSArray of AVTimedMetadataGroup.

Source

pub unsafe fn loadChapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys_completionHandler( &self, locale: &NSLocale, common_keys: &NSArray<AVMetadataKey>, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>, )

Available on crate features AVMetadataFormat and AVTimedMetadataGroup and block2 only.

Loads an array of chapters.

This method vends an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.

An AVMetadataItem with the specified common key will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and the metadata group overlaps. The locale of items not carrying chapter titles need not match the specified locale parameter.

Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].

  • Parameter locale: Locale of the metadata items carrying chapter titles to be returned (supports the IETF BCP 47 specification).
  • Parameter commonKeys: Array of common keys of AVMetadataItem to be included; if no common keys are required, send an empty list. AVMetadataCommonKeyArtwork is the only supported key for now.
  • Parameter completionHandler: A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages( &self, preferred_languages: &NSArray<NSString>, ) -> Retained<NSArray<AVTimedMetadataGroup>>

👎Deprecated: Use loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler: instead
Available on crate feature AVTimedMetadataGroup only.

Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and returns the array of chapters corresponding to the first match that’s found.

Safe to call without blocking when the AVAsset key availableChapterLocales has status AVKeyValueStatusLoaded.

Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.

All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.

Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].

  • Parameter preferredLanguages: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. If your goal is to provide the best match for the end user’s preferred languages without consideration of your app’s available localizations, pass [NSLocale preferredLanguages] as the value of preferredLanguages. However, if you want to filter the available choices in order to obtain the best match among the localizations that are available for your app, pass [NSBundle preferredLocalizationsFromArray:[[NSBundle mainBundle] localizations] forPreferences:[NSLocale preferredLanguages]] instead. The latter choice is normally more appropriate for strings intended for display as part of the app’s UI.

  • Returns: An NSArray of AVTimedMetadataGroup.

Source

pub unsafe fn loadChapterMetadataGroupsBestMatchingPreferredLanguages_completionHandler( &self, preferred_languages: &NSArray<NSString>, completion_handler: &DynBlock<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>, )

Available on crate features AVTimedMetadataGroup and block2 only.

Tests, in order of preference, for a match between language identifiers in the specified array of preferred languages and the available chapter locales, and loads the array of chapters corresponding to the first match that’s found.

Returns an array of AVTimedMetadataGroup objects. Each object in the array always contains an AVMetadataItem representing the chapter title; the timeRange property of the AVTimedMetadataGroup object is equal to the time range of the chapter title item.

All of the available chapter metadata is included in the metadata groups, including items with the common key AVMetadataCommonKeyArtwork, if such items are present. Items not carrying chapter titles will be added to an existing AVTimedMetadataGroup object if the time range (timestamp and duration) of the metadata item and that of the metadata group overlaps. The locale of such items need not match the locale of the chapter titles.

Further filtering of the metadata items in AVTimedMetadataGroups according to language can be accomplished using +[AVMetadataItem metadataItemsFromArray:filteredAndSortedAccordingToPreferredLanguages:]; filtering of the metadata items according to locale can be accomplished using +[AVMetadataItem metadataItemsFromArray:withLocale:].

  • Parameter preferredLanguages: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. If your goal is to provide the best match for the end user’s preferred languages without consideration of your app’s available localizations, pass [NSLocale preferredLanguages] as the value of preferredLanguages. However, if you want to filter the available choices in order to obtain the best match among the localizations that are available for your app, pass [NSBundle preferredLocalizationsFromArray:[[NSBundle mainBundle] localizations] forPreferences:[NSLocale preferredLanguages]] instead. The latter choice is normally more appropriate for strings intended for display as part of the app’s UI.
  • Parameter completionHandler: A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn availableMediaCharacteristicsWithMediaSelectionOptions( &self, ) -> Retained<NSArray<AVMediaCharacteristic>>

Available on crate feature AVMediaFormat only.

Provides an NSArray of NSStrings, each NSString indicating a media characteristic for which a media selection option is available.

Source

pub unsafe fn mediaSelectionGroupForMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Option<Retained<AVMediaSelectionGroup>>

👎Deprecated: Use loadMediaSelectionGroupForMediaCharacteristic:completionHandler: instead
Available on crate features AVMediaFormat and AVMediaSelectionGroup only.

Provides an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.

Becomes callable without blocking when the key “ availableMediaCharacteristicsWithMediaSelectionOptions“ has been loaded.

If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.

Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.

  • Parameter mediaCharacteristic: A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported. Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio. Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes. Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.

  • Returns: An instance of AVMediaSelectionGroup. May be nil.

Source

pub unsafe fn loadMediaSelectionGroupForMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &DynBlock<dyn Fn(*mut AVMediaSelectionGroup, *mut NSError)>, )

Available on crate features AVMediaFormat and AVMediaSelectionGroup and block2 only.

Loads an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.

If the asset has no AVMediaSelectionGroup containing options with the specified media characteristic, the return value will be nil.

Filtering of the options in the returned AVMediaSelectionGroup according to playability, locale, and additional media characteristics can be accomplished using the category AVMediaSelectionOptionFiltering defined on AVMediaSelectionGroup.

  • Parameter mediaCharacteristic: A media characteristic for which you wish to obtain the available media selection options. AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual are currently supported. Pass AVMediaCharacteristicAudible to obtain the group of available options for audio media in various languages and for various purposes, such as descriptive audio. Pass AVMediaCharacteristicLegible to obtain the group of available options for subtitles in various languages and for various purposes Pass AVMediaCharacteristicVisual to obtain the group of available options for video media.
  • Parameter completionHandler: A block that is invoked when loading is complete, vending an instance of AVMediaSelectionGroup (which may be nil) or an error.
§Safety

completion_handler block must be sendable.

Source

pub unsafe fn preferredMediaSelection(&self) -> Retained<AVMediaSelection>

Available on crate feature AVMediaSelection only.

Provides an instance of AVMediaSelection with default selections for each of the receiver’s media selection groups.

Source

pub unsafe fn allMediaSelections(&self) -> Retained<NSArray<AVMediaSelection>>

Available on crate feature AVMediaSelection only.

Provides an array of all permutations of AVMediaSelection for this asset.

Source

pub unsafe fn hasProtectedContent(&self) -> bool

Indicates whether or not the asset has protected content.

Assets containing protected content may not be playable without successful authorization, even if the value of the “playable” property is YES. See the properties in the AVAssetUsability category for details on how such an asset may be used. On macOS, clients can use the interfaces in AVPlayerItemProtectedContentAdditions.h to request authorization to play the asset.

Source

pub unsafe fn canContainFragments(&self) -> bool

Indicates whether the asset is capable of being extended by fragments.

For QuickTime movie files and MPEG-4 files, the value of canContainFragments is YES if an ‘mvex’ box is present in the ‘moov’ box. For those types, the ‘mvex’ box signals the possible presence of later ‘moof’ boxes.

Source

pub unsafe fn containsFragments(&self) -> bool

Indicates whether the asset is extended by at least one fragment.

For QuickTime movie files and MPEG-4 files, the value of this property is YES if canContainFragments is YES and at least one ‘moof’ box is present after the ‘moov’ box.

Source

pub unsafe fn overallDurationHint(&self) -> CMTime

Available on crate feature objc2-core-media only.

Indicates the total duration of fragments that either exist now or may be appended in the future in order to extend the duration of the asset.

For QuickTime movie files and MPEG-4 files, the value of this property is obtained from the ‘mehd’ box of the ‘mvex’ box, if present. If no total fragment duration hint is available, the value of this property is kCMTimeInvalid.

Source

pub unsafe fn isPlayable(&self) -> bool

Indicates whether an AVPlayer can play the contents of the asset in a manner that meets user expectations.

A client can attempt playback when playable is NO, this however may lead to a substandard playback experience.

Source

pub unsafe fn isExportable(&self) -> bool

Indicates whether an AVAssetExportSession can be used with the receiver for export

Source

pub unsafe fn isReadable(&self) -> bool

Indicates whether an AVAssetReader can be used with the receiver for extracting media data

Source

pub unsafe fn isComposable(&self) -> bool

Indicates whether the receiver can be used to build an AVMutableComposition

Source

pub unsafe fn isCompatibleWithSavedPhotosAlbum(&self) -> bool

Indicates whether the receiver can be written to the saved photos album

Source

pub unsafe fn isCompatibleWithAirPlayVideo(&self) -> bool

Indicates whether the asset is compatible with AirPlay Video.

YES if an AVPlayerItem initialized with the receiver can be played by an external device via AirPlay Video.

Source

pub unsafe fn unusedTrackID(&self) -> CMPersistentTrackID

👎Deprecated: Use findUnusedTrackIDWithCompletionHandler: instead
Available on crate features AVVideoComposition and objc2-core-media only.
Source

pub unsafe fn findUnusedTrackIDWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(CMPersistentTrackID, *mut NSError)>, )

Available on crate features AVVideoComposition and block2 and objc2-core-media only.

Loads a track ID that will not collide with any existing track

  • Parameter completionHandler: A block that is invoked when loading is complete, vending the track ID or an error.
§Safety

completion_handler block must be sendable.

Methods from Deref<Target = NSObject>§

Source

pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !

Handle messages the object doesn’t recognize.

See Apple’s documentation for details.

Methods from Deref<Target = AnyObject>§

Source

pub fn class(&self) -> &'static AnyClass

Dynamically find the class of this object.

§Panics

May panic if the object is invalid (which may be the case for objects returned from unavailable init/new methods).

§Example

Check that an instance of NSObject has the precise class NSObject.

use objc2::ClassType;
use objc2::runtime::NSObject;

let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
Source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load instead.

Use Ivar::load instead.

§Safety

The object must have an instance variable with the given name, and it must be of type T.

See Ivar::load_ptr for details surrounding this.

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: DowncastTarget,

Attempt to downcast the object to a class of type T.

This is the reference-variant. Use Retained::downcast if you want to convert a retained object to another type.

§Mutable classes

Some classes have immutable and mutable variants, such as NSString and NSMutableString.

When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.

So using this method to convert a NSString to a NSMutableString, while not unsound, is generally frowned upon unless you created the string yourself, or the API explicitly documents the string to be mutable.

See Apple’s documentation on mutability and on isKindOfClass: for more details.

§Generic classes

Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.

You can, however, safely downcast to generic collections where all the type-parameters are AnyObject.

§Panics

This works internally by calling isKindOfClass:. That means that the object must have the instance method of that name, and an exception will be thrown (if CoreFoundation is linked) or the process will abort if that is not the case. In the vast majority of cases, you don’t need to worry about this, since both root objects NSObject and NSProxy implement this method.

§Examples

Cast an NSString back and forth from NSObject.

use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};

let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();

Try (and fail) to cast an NSObject to an NSString.

use objc2_foundation::{NSObject, NSString};

let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());

Try to cast to an array of strings.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();

This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.

Downcast when processing each element instead.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);

for elem in arr {
    if let Some(data) = elem.downcast_ref::<NSString>() {
        // handle `data`
    }
}

Trait Implementations§

Source§

impl AVAsynchronousKeyValueLoading for AVMutableComposition

Source§

unsafe fn loadValuesAsynchronouslyForKeys_completionHandler( &self, keys: &NSArray<NSString>, handler: Option<&DynBlock<dyn Fn()>>, )
where Self: Sized + Message,

Available on crate features AVAsynchronousKeyValueLoading and block2 only.
Directs the target to load the values of any of the specified keys that are not already loaded. Read more
Source§

impl AsRef<AVAsset> for AVMutableComposition

Source§

fn as_ref(&self) -> &AVAsset

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<AVComposition> for AVMutableComposition

Source§

fn as_ref(&self) -> &AVComposition

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<AVMutableComposition> for AVMutableComposition

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<AnyObject> for AVMutableComposition

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NSObject> for AVMutableComposition

Source§

fn as_ref(&self) -> &NSObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AVAsset> for AVMutableComposition

Source§

fn borrow(&self) -> &AVAsset

Immutably borrows from an owned value. Read more
Source§

impl Borrow<AVComposition> for AVMutableComposition

Source§

fn borrow(&self) -> &AVComposition

Immutably borrows from an owned value. Read more
Source§

impl Borrow<AnyObject> for AVMutableComposition

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<NSObject> for AVMutableComposition

Source§

fn borrow(&self) -> &NSObject

Immutably borrows from an owned value. Read more
Source§

impl ClassType for AVMutableComposition

Source§

const NAME: &'static str = "AVMutableComposition"

The name of the Objective-C class that this type represents. Read more
Source§

type Super = AVComposition

The superclass of this class. Read more
Source§

type ThreadKind = <<AVMutableComposition as ClassType>::Super as ClassType>::ThreadKind

Whether the type can be used from any thread, or from only the main thread. Read more
Source§

fn class() -> &'static AnyClass

Get a reference to the Objective-C class that this type represents. Read more
Source§

fn as_super(&self) -> &Self::Super

Get an immutable reference to the superclass.
Source§

impl CopyingHelper for AVMutableComposition

Source§

type Result = AVComposition

The immutable counterpart of the type, or Self if the type has no immutable counterpart. Read more
Source§

impl Debug for AVMutableComposition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for AVMutableComposition

Source§

type Target = AVComposition

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for AVMutableComposition

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for AVMutableComposition

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl MutableCopyingHelper for AVMutableComposition

Source§

type Result = AVMutableComposition

The mutable counterpart of the type, or Self if the type has no mutable counterpart. Read more
Source§

impl NSCopying for AVMutableComposition

Source§

fn copy(&self) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

impl NSMutableCopying for AVMutableComposition

Source§

fn mutableCopy(&self) -> Retained<Self::Result>

Returns a new instance that’s a mutable copy of the receiver. Read more
Source§

unsafe fn mutableCopyWithZone( &self, zone: *mut NSZone, ) -> Retained<Self::Result>

Returns a new instance that’s a mutable copy of the receiver. Read more
Source§

impl NSObjectProtocol for AVMutableComposition

Source§

fn isEqual(&self, other: Option<&AnyObject>) -> bool
where Self: Sized + Message,

Check whether the object is equal to an arbitrary other object. Read more
Source§

fn hash(&self) -> usize
where Self: Sized + Message,

An integer that can be used as a table address in a hash table structure. Read more
Source§

fn isKindOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

Check if the object is an instance of the class, or one of its subclasses. Read more
Source§

fn is_kind_of<T>(&self) -> bool
where T: ClassType, Self: Sized + Message,

👎Deprecated: use isKindOfClass directly, or cast your objects with AnyObject::downcast_ref
Check if the object is an instance of the class type, or one of its subclasses. Read more
Source§

fn isMemberOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

Check if the object is an instance of a specific class, without checking subclasses. Read more
Source§

fn respondsToSelector(&self, aSelector: Sel) -> bool
where Self: Sized + Message,

Check whether the object implements or inherits a method with the given selector. Read more
Source§

fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
where Self: Sized + Message,

Check whether the object conforms to a given protocol. Read more
Source§

fn description(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object. Read more
Source§

fn debugDescription(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object to use when debugging. Read more
Source§

fn isProxy(&self) -> bool
where Self: Sized + Message,

Check whether the receiver is a subclass of the NSProxy root class instead of the usual NSObject. Read more
Source§

fn retainCount(&self) -> usize
where Self: Sized + Message,

The reference count of the object. Read more
Source§

impl PartialEq for AVMutableComposition

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for AVMutableComposition

Source§

const ENCODING_REF: Encoding = <AVComposition as ::objc2::RefEncode>::ENCODING_REF

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl DowncastTarget for AVMutableComposition

Source§

impl Eq for AVMutableComposition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T> AnyThread for T
where T: ClassType<ThreadKind = dyn AnyThread + 'a> + ?Sized,

Source§

fn alloc() -> Allocated<Self>
where Self: Sized + ClassType,

Allocate a new instance of the class. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,