#[repr(C)]pub struct AVMutableMovie { /* private fields */ }AVAsset and AVMovie only.Expand description
AVMutableMovie adds to its immutable superclass, AVMovie, several categories of methods for editing QuickTime movie files, e.g. inserting and removing time ranges of media, adding and removing tracks, and modifying the metadata collections stored therein.
By default, after creating an AVMutableMovie the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
See also Apple’s documentation
Implementations§
Source§impl AVMutableMovie
impl AVMutableMovie
Sourcepub unsafe fn movieWithURL_options_error(
url: &NSURL,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn movieWithURL_options_error( url: &NSURL, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
Parameter URL: An NSURL object that specifies a file containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn initWithURL_options_error(
this: Allocated<Self>,
url: &NSURL,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn initWithURL_options_error( this: Allocated<Self>, url: &NSURL, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
Parameter URL: An NSURL object that specifies a file containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn movieWithData_options_error(
data: &NSData,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn movieWithData_options_error( data: &NSData, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object from a movie header stored in an NSData object.
Parameter data: An NSData object containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn initWithData_options_error(
this: Allocated<Self>,
data: &NSData,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn initWithData_options_error( this: Allocated<Self>, data: &NSData, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object from a movie header stored in an NSData object.
Parameter data: An NSData object containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
By default, the defaultMediaDataStorage property will be nil and each associated AVMutableMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn movieWithSettingsFromMovie_options_error(
movie: Option<&AVMovie>,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn movieWithSettingsFromMovie_options_error( movie: Option<&AVMovie>, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object without tracks (and therefore without media).
Parameter movie: If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Pass nil for default initialization behavior.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn initWithSettingsFromMovie_options_error(
this: Allocated<Self>,
movie: Option<&AVMovie>,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<Self>, Retained<NSError>>
pub unsafe fn initWithSettingsFromMovie_options_error( this: Allocated<Self>, movie: Option<&AVMovie>, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Result<Retained<Self>, Retained<NSError>>
Creates an AVMutableMovie object without tracks (and therefore without media).
Parameter movie: If you wish to transfer settings from an existing movie (including movie userdata and metadata, preferred rate, preferred volume, etc.), pass a reference to an AVMovie object representing that movie. Otherwise pass nil. The userdata and metadata from the source movie may need to be converted if the format of that movie differs from fileType; you may wish to inspect the userdata or metadata of the receiver to ensure that important data was copied.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMutableMovie object. Pass nil for default initialization behavior.
Parameter outError: If an error occurs creating a movie, describes the nature of the failure.
Returns: An AVMutableMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn preferredRate(&self) -> c_float
pub unsafe fn preferredRate(&self) -> c_float
The natural rate at which the movie is to be played; often but not always 1.0.
Sourcepub unsafe fn setPreferredRate(&self, preferred_rate: c_float)
pub unsafe fn setPreferredRate(&self, preferred_rate: c_float)
Setter for preferredRate.
Sourcepub unsafe fn preferredVolume(&self) -> c_float
pub unsafe fn preferredVolume(&self) -> c_float
The preferred volume of the audible media data of the movie; often but not always 1.0.
Sourcepub unsafe fn setPreferredVolume(&self, preferred_volume: c_float)
pub unsafe fn setPreferredVolume(&self, preferred_volume: c_float)
Setter for preferredVolume.
Sourcepub unsafe fn preferredTransform(&self) -> CGAffineTransform
Available on crate feature objc2-core-foundation only.
pub unsafe fn preferredTransform(&self) -> CGAffineTransform
objc2-core-foundation only.A CGAffineTransform indicating the transform specified in the movie’s storage container as the preferred transformation of the visual media data for display purposes; the value is often but not always CGAffineTransformIdentity.
Sourcepub unsafe fn setPreferredTransform(
&self,
preferred_transform: CGAffineTransform,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setPreferredTransform( &self, preferred_transform: CGAffineTransform, )
objc2-core-foundation only.Setter for preferredTransform.
Sourcepub unsafe fn timescale(&self) -> CMTimeScale
Available on crate feature objc2-core-media only.
pub unsafe fn timescale(&self) -> CMTimeScale
objc2-core-media only.For file types that contain a ‘moov’ atom, such as QuickTime Movie files, specifies the time scale of the movie.
The default movie time scale is 600. In certain cases, you may want to set this to a different value. For instance, a movie that contains a single audio track should typically have the movie time scale set to the media time scale of that track.
This property should be set on a new empty movie before any edits are performed on the movie.
Sourcepub unsafe fn setTimescale(&self, timescale: CMTimeScale)
Available on crate feature objc2-core-media only.
pub unsafe fn setTimescale(&self, timescale: CMTimeScale)
objc2-core-media only.Setter for timescale.
Sourcepub unsafe fn tracks(&self) -> Retained<NSArray<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMovieTrack only.
pub unsafe fn tracks(&self) -> Retained<NSArray<AVMutableMovieTrack>>
AVAssetTrack and AVMovieTrack only.The tracks in a mutable movie.
The value of this property is an array of tracks the mutable movie contains; the tracks are of type AVMutableMovieTrack.
Source§impl AVMutableMovie
Methods declared on superclass AVMovie.
impl AVMutableMovie
Methods declared on superclass AVMovie.
Sourcepub unsafe fn movieWithURL_options(
url: &NSURL,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>
pub unsafe fn movieWithURL_options( url: &NSURL, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<Self>
Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
Parameter URL: An NSURL object that specifies a file containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
Returns: An AVMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn initWithURL_options(
this: Allocated<Self>,
url: &NSURL,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>
pub unsafe fn initWithURL_options( this: Allocated<Self>, url: &NSURL, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<Self>
Creates an AVMovie object from a movie header stored in a QuickTime movie file or ISO base media file.
Parameter URL: An NSURL object that specifies a file containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
Returns: An AVMovie object
By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn movieWithData_options(
data: &NSData,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>
pub unsafe fn movieWithData_options( data: &NSData, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<Self>
Creates an AVMovie object from a movie header stored in an NSData object.
Parameter data: An NSData object containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
Returns: An AVMovie object
You can use this method to operate on movie headers that are not stored in files; this might include movie headers on the pasteboard (which do not contain media data). In general you should avoid loading an entire movie file with its media data into an instance of NSData! By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Sourcepub unsafe fn initWithData_options(
this: Allocated<Self>,
data: &NSData,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>
pub unsafe fn initWithData_options( this: Allocated<Self>, data: &NSData, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<Self>
Creates an AVMovie object from a movie header stored in an NSData object.
Parameter data: An NSData object containing a movie header.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the AVMovie object.
Returns: An AVMovie object
You can use this method to operate on movie headers that are not stored in files. In general you should avoid loading an entire movie file with its media data into an instance of NSData!
By default, the defaultMediaDataStorage property will be nil and each associated AVMovieTrack’s mediaDataStorage property will be nil. If you want to create an AVMutableMovie from an NSData object and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.
Source§impl AVMutableMovie
Methods declared on superclass AVAsset.
impl AVMutableMovie
Methods declared on superclass AVAsset.
Sourcepub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>
pub unsafe fn assetWithURL(url: &NSURL) -> Retained<Self>
Returns an instance of AVAsset for inspection of a media resource.
Parameter URL: An instance of NSURL that references a media resource.
Returns: An instance of AVAsset.
Returns a newly allocated instance of a subclass of AVAsset initialized with the specified URL.
Source§impl AVMutableMovie
Methods declared on superclass NSObject.
impl AVMutableMovie
Methods declared on superclass NSObject.
Source§impl AVMutableMovie
AVMutableMovieMovieLevelEditing.
impl AVMutableMovie
AVMutableMovieMovieLevelEditing.
Sourcepub unsafe fn isModified(&self) -> bool
pub unsafe fn isModified(&self) -> bool
Whether a movie has been modified.
The value of this property is a BOOL that indicates whether the AVMutableMovie object has been modified since it was created, was last written, or had its modified state cleared via a call to setModified:NO.
Sourcepub unsafe fn setModified(&self, modified: bool)
pub unsafe fn setModified(&self, modified: bool)
Setter for isModified.
Sourcepub unsafe fn defaultMediaDataStorage(
&self,
) -> Option<Retained<AVMediaDataStorage>>
pub unsafe fn defaultMediaDataStorage( &self, ) -> Option<Retained<AVMediaDataStorage>>
The default storage container for media data added to a movie.
The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written, for any track for whose mediaDataStorage property is nil.
Sourcepub unsafe fn setDefaultMediaDataStorage(
&self,
default_media_data_storage: Option<&AVMediaDataStorage>,
)
pub unsafe fn setDefaultMediaDataStorage( &self, default_media_data_storage: Option<&AVMediaDataStorage>, )
Setter for defaultMediaDataStorage.
Sourcepub unsafe fn interleavingPeriod(&self) -> CMTime
Available on crate feature objc2-core-media only.
pub unsafe fn interleavingPeriod(&self) -> CMTime
objc2-core-media only.A CMTime that indicates the duration for interleaving runs of samples of each track.
The default interleaving period is 0.5 seconds.
Sourcepub unsafe fn setInterleavingPeriod(&self, interleaving_period: CMTime)
Available on crate feature objc2-core-media only.
pub unsafe fn setInterleavingPeriod(&self, interleaving_period: CMTime)
objc2-core-media only.Setter for interleavingPeriod.
Sourcepub unsafe fn insertTimeRange_ofAsset_atTime_copySampleData_error(
&self,
time_range: CMTimeRange,
asset: &AVAsset,
start_time: CMTime,
copy_sample_data: bool,
) -> Result<(), Retained<NSError>>
Available on crate feature objc2-core-media only.
pub unsafe fn insertTimeRange_ofAsset_atTime_copySampleData_error( &self, time_range: CMTimeRange, asset: &AVAsset, start_time: CMTime, copy_sample_data: bool, ) -> Result<(), Retained<NSError>>
objc2-core-media only.Inserts all the tracks of a timeRange of an asset into a movie.
Parameter timeRange: The time range of the asset to be inserted.
Parameter asset: An AVAsset object indicating the source of the inserted media. Only instances of AVURLAsset and AVComposition are supported.
Must not be nil.
Parameter startTime: The time in the target movie at which the media is to be inserted.
Parameter copySampleData: A BOOL value that indicates whether sample data is to be copied from the source to the destination during edits.
If YES, the sample data is written to the location specified by the track property mediaDataStorage if non-nil,
or else by the movie property defaultMediaDataStorage if non-nil; if both are nil, the method will fail and return NO.
If NO, sample data will not be written and sample references to the samples in their original container will be added as necessary.
Note that in this case, this method will fail if the source AVAsset is not able to provide sample reference information for the original container.
Parameter outError: If the insertion fails, an NSError object that describes the nature of the failure.
Returns: A BOOL value that indicates the success of the insertion.
This method may add new tracks to the target movie to ensure that all tracks of the asset are represented in the inserted timeRange. Existing content at the specified startTime will be pushed out by the duration of timeRange. Note that metadata will not be automatically copied.
Sourcepub unsafe fn insertEmptyTimeRange(&self, time_range: CMTimeRange)
Available on crate feature objc2-core-media only.
pub unsafe fn insertEmptyTimeRange(&self, time_range: CMTimeRange)
objc2-core-media only.Adds an empty time range to the target movie.
Parameter timeRange: The time range to be made empty. Note that you cannot add empty time ranges to the end of a movie.
Sourcepub unsafe fn removeTimeRange(&self, time_range: CMTimeRange)
Available on crate feature objc2-core-media only.
pub unsafe fn removeTimeRange(&self, time_range: CMTimeRange)
objc2-core-media only.Removes a specified time range from a movie.
Parameter timeRange: The time range to be removed.
Sourcepub unsafe fn scaleTimeRange_toDuration(
&self,
time_range: CMTimeRange,
duration: CMTime,
)
Available on crate feature objc2-core-media only.
pub unsafe fn scaleTimeRange_toDuration( &self, time_range: CMTimeRange, duration: CMTime, )
objc2-core-media only.Changes the duration of a time range of a movie.
Parameter timeRange: The time range to be scaled.
Parameter duration: The new duration of the time range.
Source§impl AVMutableMovie
AVMutableMovieTrackLevelEditing.
impl AVMutableMovie
AVMutableMovieTrackLevelEditing.
Sourcepub unsafe fn mutableTrackCompatibleWithTrack(
&self,
track: &AVAssetTrack,
) -> Option<Retained<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMovieTrack only.
pub unsafe fn mutableTrackCompatibleWithTrack( &self, track: &AVAssetTrack, ) -> Option<Retained<AVMutableMovieTrack>>
AVAssetTrack and AVMovieTrack only.Provides a reference to a track of a mutable movie into which any time range of an AVAssetTrack can be inserted (via -[AVMutableMovieTrack insertTimeRange:ofTrack:atTime:copySampleData:error:]).
Parameter track: A reference to the AVAssetTrack from which a time range may be inserted.
Returns: An AVMutableMovieTrack that can accommodate the insertion. If no such track is available, the result is nil. A new track of the same media type as the AVAssetTrack can be created via -addMutableTrackWithMediaType:copySettingsFromTrack:options:, and this new track will be compatible.
For best performance, the number of tracks in a movie 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.
Sourcepub unsafe fn addMutableTrackWithMediaType_copySettingsFromTrack_options(
&self,
media_type: &AVMediaType,
track: Option<&AVAssetTrack>,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Option<Retained<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack only.
pub unsafe fn addMutableTrackWithMediaType_copySettingsFromTrack_options( &self, media_type: &AVMediaType, track: Option<&AVAssetTrack>, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Option<Retained<AVMutableMovieTrack>>
AVAssetTrack and AVMediaFormat and AVMovieTrack only.Adds an empty track to the target movie.
Parameter mediaType: The media type of the new track (e.g. AVMediaTypeVideo for a video track).
Parameter track: If you wish to transfer settings from an existing track, including width, height, preferred volume, etc., pass a reference to an AVAssetTrack representing that track. Otherwise pass nil.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack object. Pass nil for default initialization behavior.
Returns: An AVMutableMovieTrack object
The trackID of the newly added track is a property of the returned instance of AVMutableMovieTrack. This method throws an exception if media type is not equal to the track’s media type, or if any option is invalid. Note that metadata will not be automatically copied.
Sourcepub unsafe fn addMutableTracksCopyingSettingsFromTracks_options(
&self,
existing_tracks: &NSArray<AVAssetTrack>,
options: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<NSArray<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMovieTrack only.
pub unsafe fn addMutableTracksCopyingSettingsFromTracks_options( &self, existing_tracks: &NSArray<AVAssetTrack>, options: Option<&NSDictionary<NSString, AnyObject>>, ) -> Retained<NSArray<AVMutableMovieTrack>>
AVAssetTrack and AVMovieTrack only.Adds one or more empty tracks to the target movie, copying track settings from the source tracks.
Parameter existingTracks: An array of AVAssetTrack objects.
Parameter options: An NSDictionary object that contains keys for specifying options for the initialization of the new AVMutableMovieTrack objects. Pass nil for default initialization behavior.
Returns: An array of AVMutableMovieTrack objects; the index of a track in this array is the same as the index of its source track in the existingTracks array.
This method creates one or more empty tracks in the target movie and configures those tracks with settings (such as track userdata and metadata, width, height, and preferred volume) copied from the source tracks in the existingTracks array. Also, properties involving pairs of tracks (such as track references) are copied from the source tracks to the target tracks. This method throws an exception if any option is invalid.
Sourcepub unsafe fn removeTrack(&self, track: &AVMovieTrack)
Available on crate features AVAssetTrack and AVMovieTrack only.
pub unsafe fn removeTrack(&self, track: &AVMovieTrack)
AVAssetTrack and AVMovieTrack only.Removes a track from the target movie.
Parameter track: The track to be removed.
Source§impl AVMutableMovie
AVMutableMovieMetadataEditing.
impl AVMutableMovie
AVMutableMovieMetadataEditing.
Sourcepub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>
Available on crate feature AVMetadataItem only.
pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>
AVMetadataItem only.A collection of metadata stored by the movie.
The value of this property is an array of AVMetadataItem objects representing the collection of metadata stored by the movie.
Sourcepub unsafe fn setMetadata(&self, metadata: &NSArray<AVMetadataItem>)
Available on crate feature AVMetadataItem only.
pub unsafe fn setMetadata(&self, metadata: &NSArray<AVMetadataItem>)
AVMetadataItem only.Setter for metadata.
Source§impl AVMutableMovie
AVMutableMovieTrackInspection.
impl AVMutableMovie
AVMutableMovieTrackInspection.
Sourcepub unsafe fn trackWithTrackID(
&self,
track_id: CMPersistentTrackID,
) -> Option<Retained<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMovieTrack and objc2-core-media only.
pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVMutableMovieTrack>>
AVAssetTrack and AVMovieTrack and objc2-core-media only.Provides an instance of AVMutableMovieTrack that represents the track of the specified trackID.
Parameter trackID: The trackID of the requested AVMutableMovieTrack.
Returns: An instance of AVMutableMovieTrack; may be nil if no track of the specified trackID is available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTrackWithTrackID_completionHandler(
&self,
track_id: CMPersistentTrackID,
completion_handler: &Block<dyn Fn(*mut AVMutableMovieTrack, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMovieTrack and block2 and objc2-core-media only.
pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &Block<dyn Fn(*mut AVMutableMovieTrack, *mut NSError)>, )
AVAssetTrack and AVMovieTrack and block2 and objc2-core-media only.Loads an instance of AVMutableMovieTrack that represents the track of the specified trackID.
Parameter trackID: The trackID of the requested AVMutableMovieTrack.
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.
Sourcepub unsafe fn tracksWithMediaType(
&self,
media_type: &AVMediaType,
) -> Retained<NSArray<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack only.
pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVMutableMovieTrack>>
AVAssetTrack and AVMediaFormat and AVMovieTrack only.Provides an array of AVMutableMovieTracks of the asset that present media of the specified media type.
Parameter mediaType: The media type according to which the receiver filters its AVMutableMovieTracks. (Media types are defined in AVMediaFormat.h)
Returns: An NSArray of AVMutableMovieTracks; may be empty if no tracks of the specified media type are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaType_completionHandler(
&self,
media_type: &AVMediaType,
completion_handler: &Block<dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.
pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &Block<dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError)>, )
AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.Loads an array of AVMutableMovieTracks of the asset that present media of the specified media type.
Parameter mediaType: The media type according to which AVAsset filters its AVMutableMovieTracks. (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.
Sourcepub unsafe fn tracksWithMediaCharacteristic(
&self,
media_characteristic: &AVMediaCharacteristic,
) -> Retained<NSArray<AVMutableMovieTrack>>
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack only.
pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVMutableMovieTrack>>
AVAssetTrack and AVMediaFormat and AVMovieTrack only.Provides an array of AVMutableMovieTracks of the asset that present media with the specified characteristic.
Parameter mediaCharacteristic: The media characteristic according to which the receiver filters its AVMutableMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
Returns: An NSArray of AVMutableMovieTracks; may be empty if no tracks with the specified characteristic are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
&self,
media_characteristic: &AVMediaCharacteristic,
completion_handler: &Block<dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.
pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &Block<dyn Fn(*mut NSArray<AVMutableMovieTrack>, *mut NSError)>, )
AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.Loads an array of AVMutableMovieTracks of the asset that present media with the specified characteristic.
Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVMutableMovieTracks. (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.
Source§impl AVMutableMovie
SynchronousAssetInterface.
Redeclarations of async-only AVAsset interfaces to allow synchronous usage in the synchronous subclass.
impl AVMutableMovie
SynchronousAssetInterface. Redeclarations of async-only AVAsset interfaces to allow synchronous usage in the synchronous subclass.
See AVAsset’s interface for more information about these interfaces.
pub unsafe fn metadataForFormat( &self, format: &AVMetadataFormat, ) -> Retained<NSArray<AVMetadataItem>>
AVMetadataFormat and AVMetadataItem only.pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys( &self, locale: &NSLocale, common_keys: Option<&NSArray<AVMetadataKey>>, ) -> Retained<NSArray<AVTimedMetadataGroup>>
AVMetadataFormat and AVTimedMetadataGroup only.pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages( &self, preferred_languages: &NSArray<NSString>, ) -> Retained<NSArray<AVTimedMetadataGroup>>
AVTimedMetadataGroup only.pub unsafe fn mediaSelectionGroupForMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Option<Retained<AVMediaSelectionGroup>>
AVMediaFormat and AVMediaSelectionGroup only.pub unsafe fn unusedTrackID(&self) -> CMPersistentTrackID
objc2-core-media only.Methods from Deref<Target = AVMovie>§
Sourcepub unsafe fn URL(&self) -> Option<Retained<NSURL>>
pub unsafe fn URL(&self) -> Option<Retained<NSURL>>
The URL with which the instance of AVMovie was initialized; may be nil.
Sourcepub unsafe fn data(&self) -> Option<Retained<NSData>>
pub unsafe fn data(&self) -> Option<Retained<NSData>>
The data block with which the instance of AVMovie was initialized; may be nil.
Sourcepub unsafe fn defaultMediaDataStorage(
&self,
) -> Option<Retained<AVMediaDataStorage>>
pub unsafe fn defaultMediaDataStorage( &self, ) -> Option<Retained<AVMediaDataStorage>>
The default storage container for media data added to a movie.
The value of this property is an AVMediaDataStorage object that indicates where sample data that is added to a movie should be written by default.
Sourcepub unsafe fn tracks(&self) -> Retained<NSArray<AVMovieTrack>>
Available on crate features AVAssetTrack and AVMovieTrack only.
pub unsafe fn tracks(&self) -> Retained<NSArray<AVMovieTrack>>
AVAssetTrack and AVMovieTrack only.The tracks in a movie.
The value of this property is an array of tracks the movie contains; the tracks are of type AVMovieTrack.
Sourcepub unsafe fn canContainMovieFragments(&self) -> bool
pub unsafe fn canContainMovieFragments(&self) -> bool
Indicates whether the movie file is capable of being extended by fragments.
The value of this property is YES if an ‘mvex’ box is present in the ‘moov’ box. The ‘mvex’ box is necessary in order to signal the possible presence of later ‘moof’ boxes.
Sourcepub unsafe fn containsMovieFragments(&self) -> bool
pub unsafe fn containsMovieFragments(&self) -> bool
Indicates whether the movie file is extended by at least one movie fragment.
The value of this property is YES if canContainMovieFragments is YES and at least one ‘moof’ box is present after the ‘moov’ box.
Sourcepub unsafe fn movieHeaderWithFileType_error(
&self,
file_type: &AVFileType,
) -> Result<Retained<NSData>, Retained<NSError>>
Available on crate feature AVMediaFormat only.
pub unsafe fn movieHeaderWithFileType_error( &self, file_type: &AVFileType, ) -> Result<Retained<NSData>, Retained<NSError>>
AVMediaFormat only.Creates an NSData object containing the movie header of the AVMovie object.
Parameter fileType: A UTI indicating the specific file format of the movie header (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
Parameter outError: If an error occurs reading the movie header, describes the nature of the failure.
Returns: An NSData object.
The movie header will be a pure reference movie, with no base URL, suitable for use on the pasteboard.
Sourcepub unsafe fn writeMovieHeaderToURL_fileType_options_error(
&self,
url: &NSURL,
file_type: &AVFileType,
options: AVMovieWritingOptions,
) -> Result<(), Retained<NSError>>
Available on crate feature AVMediaFormat only.
pub unsafe fn writeMovieHeaderToURL_fileType_options_error( &self, url: &NSURL, file_type: &AVFileType, options: AVMovieWritingOptions, ) -> Result<(), Retained<NSError>>
AVMediaFormat only.Writes the movie header to a destination URL.
Parameter URL: An NSURL object indicating where to write the movie header.
Parameter fileType: A UTI indicating the specific file format (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
Parameter options: An NSUInteger whose bits specify options for the writing of the movie header. See AVMovieWritingOptions above.
Parameter outError: If an error occurs writing the movie header, describes the nature of the failure.
Note that modifications to instances of AVMutableMovie, to their constituent AVMutableMovieTracks, or to their collections of metadata are committed to storage when their movie headers are written.
Sourcepub unsafe fn isCompatibleWithFileType(&self, file_type: &AVFileType) -> bool
Available on crate feature AVMediaFormat only.
pub unsafe fn isCompatibleWithFileType(&self, file_type: &AVFileType) -> bool
AVMediaFormat only.Indicates whether a movie header for the AVMovie object can be created for the specified file type.
Parameter fileType: A UTI indicating a movie file format (e.g. AVFileTypeQuickTimeMovie for a QuickTime movie).
This method returns a BOOL that indicates whether a movie header of the specified type can be created for the receiver. For example, this method returns NO if the movie contains tracks whose media types or media subtypes are not allowed by the specified file type.
Sourcepub unsafe fn trackWithTrackID(
&self,
track_id: CMPersistentTrackID,
) -> Option<Retained<AVMovieTrack>>
👎Deprecated: Use loadTrackWithTrackID:completionHandler: insteadAvailable on crate features AVAssetTrack and AVMovieTrack and objc2-core-media only.
pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVMovieTrack>>
AVAssetTrack and AVMovieTrack and objc2-core-media only.Provides an instance of AVMovieTrack that represents the track of the specified trackID.
Parameter trackID: The trackID of the requested AVMovieTrack.
Returns: An instance of AVMovieTrack; may be nil if no track of the specified trackID is available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTrackWithTrackID_completionHandler(
&self,
track_id: CMPersistentTrackID,
completion_handler: &Block<dyn Fn(*mut AVMovieTrack, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMovieTrack and block2 and objc2-core-media only.
pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &Block<dyn Fn(*mut AVMovieTrack, *mut NSError)>, )
AVAssetTrack and AVMovieTrack and block2 and objc2-core-media only.Loads an instance of AVMovieTrack that represents the track of the specified trackID.
Parameter trackID: The trackID of the requested AVMovieTrack.
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.
Sourcepub unsafe fn tracksWithMediaType(
&self,
media_type: &AVMediaType,
) -> Retained<NSArray<AVMovieTrack>>
👎Deprecated: Use loadTracksWithMediaType:completionHandler: insteadAvailable on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack only.
pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVMovieTrack>>
AVAssetTrack and AVMediaFormat and AVMovieTrack only.Provides an array of AVMovieTracks of the asset that present media of the specified media type.
Parameter mediaType: The media type according to which the receiver filters its AVMovieTracks. (Media types are defined in AVMediaFormat.h)
Returns: An NSArray of AVMovieTracks; may be empty if no tracks of the specified media type are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaType_completionHandler(
&self,
media_type: &AVMediaType,
completion_handler: &Block<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.
pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &Block<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>, )
AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.Loads an array of AVMovieTracks of the asset that present media of the specified media type.
Parameter mediaType: The media type according to which AVAsset filters its AVMovieTracks. (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.
Sourcepub unsafe fn tracksWithMediaCharacteristic(
&self,
media_characteristic: &AVMediaCharacteristic,
) -> Retained<NSArray<AVMovieTrack>>
👎Deprecated: Use loadTracksWithMediaCharacteristic:completionHandler: insteadAvailable on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack only.
pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVMovieTrack>>
AVAssetTrack and AVMediaFormat and AVMovieTrack only.Provides an array of AVMovieTracks of the asset that present media with the specified characteristic.
Parameter mediaCharacteristic: The media characteristic according to which the receiver filters its AVMovieTracks. (Media characteristics are defined in AVMediaFormat.h)
Returns: An NSArray of AVMovieTracks; may be empty if no tracks with the specified characteristic are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
&self,
media_characteristic: &AVMediaCharacteristic,
completion_handler: &Block<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.
pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &Block<dyn Fn(*mut NSArray<AVMovieTrack>, *mut NSError)>, )
AVAssetTrack and AVMediaFormat and AVMovieTrack and block2 only.Loads an array of AVMovieTracks of the asset that present media with the specified characteristic.
Parameter mediaCharacteristic: The media characteristic according to which AVAsset filters its AVMovieTracks. (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.
Methods from Deref<Target = AVAsset>§
pub unsafe fn duration(&self) -> CMTime
objc2-core-media only.pub unsafe fn preferredRate(&self) -> c_float
pub unsafe fn preferredVolume(&self) -> c_float
pub unsafe fn preferredTransform(&self) -> CGAffineTransform
objc2-core-foundation only.pub unsafe fn naturalSize(&self) -> CGSize
objc2-core-foundation only.Sourcepub unsafe fn minimumTimeOffsetFromLive(&self) -> CMTime
Available on crate feature objc2-core-media only.
pub unsafe fn minimumTimeOffsetFromLive(&self) -> CMTime
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.
pub unsafe fn providesPreciseDurationAndTiming(&self) -> bool
Sourcepub unsafe fn cancelLoading(&self)
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.
Sourcepub unsafe fn referenceRestrictions(&self) -> AVAssetReferenceRestrictions
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.
Sourcepub unsafe fn tracks(&self) -> Retained<NSArray<AVAssetTrack>>
Available on crate feature AVAssetTrack only.
pub unsafe fn tracks(&self) -> Retained<NSArray<AVAssetTrack>>
AVAssetTrack only.Provides the array of AVAssetTracks contained by the asset
Sourcepub unsafe fn trackWithTrackID(
&self,
track_id: CMPersistentTrackID,
) -> Option<Retained<AVAssetTrack>>
👎Deprecated: Use loadTrackWithTrackID:completionHandler: insteadAvailable on crate features AVAssetTrack and objc2-core-media only.
pub unsafe fn trackWithTrackID( &self, track_id: CMPersistentTrackID, ) -> Option<Retained<AVAssetTrack>>
AVAssetTrack and objc2-core-media only.Provides an instance of AVAssetTrack that represents the track of the specified trackID.
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.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTrackWithTrackID_completionHandler(
&self,
track_id: CMPersistentTrackID,
completion_handler: &Block<dyn Fn(*mut AVAssetTrack, *mut NSError)>,
)
Available on crate features AVAssetTrack and block2 and objc2-core-media only.
pub unsafe fn loadTrackWithTrackID_completionHandler( &self, track_id: CMPersistentTrackID, completion_handler: &Block<dyn Fn(*mut AVAssetTrack, *mut NSError)>, )
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.
Sourcepub unsafe fn tracksWithMediaType(
&self,
media_type: &AVMediaType,
) -> Retained<NSArray<AVAssetTrack>>
👎Deprecated: Use loadTracksWithMediaType:completionHandler: insteadAvailable on crate features AVAssetTrack and AVMediaFormat only.
pub unsafe fn tracksWithMediaType( &self, media_type: &AVMediaType, ) -> Retained<NSArray<AVAssetTrack>>
AVAssetTrack and AVMediaFormat only.Provides 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.)
Returns: An NSArray of AVAssetTracks; may be empty if no tracks of the specified media type are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaType_completionHandler(
&self,
media_type: &AVMediaType,
completion_handler: &Block<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and block2 only.
pub unsafe fn loadTracksWithMediaType_completionHandler( &self, media_type: &AVMediaType, completion_handler: &Block<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>, )
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.
Sourcepub unsafe fn tracksWithMediaCharacteristic(
&self,
media_characteristic: &AVMediaCharacteristic,
) -> Retained<NSArray<AVAssetTrack>>
👎Deprecated: Use loadTracksWithMediaCharacteristic:completionHandler: insteadAvailable on crate features AVAssetTrack and AVMediaFormat only.
pub unsafe fn tracksWithMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Retained<NSArray<AVAssetTrack>>
AVAssetTrack and AVMediaFormat only.Provides 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.)
Returns: An NSArray of AVAssetTracks; may be empty if no tracks with the specified characteristic are available.
Becomes callable without blocking when the key “ tracks“ has been loaded
Sourcepub unsafe fn loadTracksWithMediaCharacteristic_completionHandler(
&self,
media_characteristic: &AVMediaCharacteristic,
completion_handler: &Block<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>,
)
Available on crate features AVAssetTrack and AVMediaFormat and block2 only.
pub unsafe fn loadTracksWithMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &Block<dyn Fn(*mut NSArray<AVAssetTrack>, *mut NSError)>, )
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.
Sourcepub unsafe fn trackGroups(&self) -> Retained<NSArray<AVAssetTrackGroup>>
Available on crate feature AVAssetTrackGroup only.
pub unsafe fn trackGroups(&self) -> Retained<NSArray<AVAssetTrackGroup>>
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.
pub unsafe fn creationDate(&self) -> Option<Retained<AVMetadataItem>>
AVMetadataItem only.pub unsafe fn lyrics(&self) -> Option<Retained<NSString>>
pub unsafe fn commonMetadata(&self) -> Retained<NSArray<AVMetadataItem>>
AVMetadataItem only.pub unsafe fn metadata(&self) -> Retained<NSArray<AVMetadataItem>>
AVMetadataItem only.pub unsafe fn availableMetadataFormats( &self, ) -> Retained<NSArray<AVMetadataFormat>>
AVMetadataFormat only.Sourcepub unsafe fn metadataForFormat(
&self,
format: &AVMetadataFormat,
) -> Retained<NSArray<AVMetadataItem>>
👎Deprecated: Use loadMetadataForFormat:completionHandler: insteadAvailable on crate features AVMetadataFormat and AVMetadataItem only.
pub unsafe fn metadataForFormat( &self, format: &AVMetadataFormat, ) -> Retained<NSArray<AVMetadataItem>>
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:].
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.
Becomes callable without blocking when the key “ availableMetadataFormats“ has been loaded
Sourcepub unsafe fn loadMetadataForFormat_completionHandler(
&self,
format: &AVMetadataFormat,
completion_handler: &Block<dyn Fn(*mut NSArray<AVMetadataItem>, *mut NSError)>,
)
Available on crate features AVMetadataFormat and AVMetadataItem and block2 only.
pub unsafe fn loadMetadataForFormat_completionHandler( &self, format: &AVMetadataFormat, completion_handler: &Block<dyn Fn(*mut NSArray<AVMetadataItem>, *mut NSError)>, )
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.
pub unsafe fn availableChapterLocales(&self) -> Retained<NSArray<NSLocale>>
Sourcepub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys(
&self,
locale: &NSLocale,
common_keys: Option<&NSArray<AVMetadataKey>>,
) -> Retained<NSArray<AVTimedMetadataGroup>>
👎Deprecated: Use loadChapterMetadataGroupsWithTitleLocale:containingItemsWithCommonKeys:completionHandler: insteadAvailable on crate features AVMetadataFormat and AVTimedMetadataGroup only.
pub unsafe fn chapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys( &self, locale: &NSLocale, common_keys: Option<&NSArray<AVMetadataKey>>, ) -> Retained<NSArray<AVTimedMetadataGroup>>
AVMetadataFormat and AVTimedMetadataGroup only.Provides an array of chapters.
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.
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:].
Sourcepub unsafe fn loadChapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys_completionHandler(
&self,
locale: &NSLocale,
common_keys: &NSArray<AVMetadataKey>,
completion_handler: &Block<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>,
)
Available on crate features AVMetadataFormat and AVTimedMetadataGroup and block2 only.
pub unsafe fn loadChapterMetadataGroupsWithTitleLocale_containingItemsWithCommonKeys_completionHandler( &self, locale: &NSLocale, common_keys: &NSArray<AVMetadataKey>, completion_handler: &Block<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>, )
AVMetadataFormat and AVTimedMetadataGroup and block2 only.Loads an array of chapters.
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.
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:].
Sourcepub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages(
&self,
preferred_languages: &NSArray<NSString>,
) -> Retained<NSArray<AVTimedMetadataGroup>>
👎Deprecated: Use loadChapterMetadataGroupsBestMatchingPreferredLanguages:completionHandler: insteadAvailable on crate feature AVTimedMetadataGroup only.
pub unsafe fn chapterMetadataGroupsBestMatchingPreferredLanguages( &self, preferred_languages: &NSArray<NSString>, ) -> Retained<NSArray<AVTimedMetadataGroup>>
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.
Parameter preferredLanguages: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user’s list of preferred languages.
Returns: An NSArray of AVTimedMetadataGroup.
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:]. .
Sourcepub unsafe fn loadChapterMetadataGroupsBestMatchingPreferredLanguages_completionHandler(
&self,
preferred_languages: &NSArray<NSString>,
completion_handler: &Block<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>,
)
Available on crate features AVTimedMetadataGroup and block2 only.
pub unsafe fn loadChapterMetadataGroupsBestMatchingPreferredLanguages_completionHandler( &self, preferred_languages: &NSArray<NSString>, completion_handler: &Block<dyn Fn(*mut NSArray<AVTimedMetadataGroup>, *mut NSError)>, )
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.
Parameter preferredLanguages: An array of language identifiers in order of preference, each of which is an IETF BCP 47 (RFC 4646) language identifier. Use +[NSLocale preferredLanguages] to obtain the user’s list of preferred languages.
Parameter completionHandler: A block that is invoked when loading is complete, vending the array of timed metadata groups or an error.
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:].
pub unsafe fn availableMediaCharacteristicsWithMediaSelectionOptions( &self, ) -> Retained<NSArray<AVMediaCharacteristic>>
AVMediaFormat only.Sourcepub unsafe fn mediaSelectionGroupForMediaCharacteristic(
&self,
media_characteristic: &AVMediaCharacteristic,
) -> Option<Retained<AVMediaSelectionGroup>>
👎Deprecated: Use loadMediaSelectionGroupForMediaCharacteristic:completionHandler: insteadAvailable on crate features AVMediaFormat and AVMediaSelectionGroup only.
pub unsafe fn mediaSelectionGroupForMediaCharacteristic( &self, media_characteristic: &AVMediaCharacteristic, ) -> Option<Retained<AVMediaSelectionGroup>>
AVMediaFormat and AVMediaSelectionGroup only.Provides an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
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.
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.
Sourcepub unsafe fn loadMediaSelectionGroupForMediaCharacteristic_completionHandler(
&self,
media_characteristic: &AVMediaCharacteristic,
completion_handler: &Block<dyn Fn(*mut AVMediaSelectionGroup, *mut NSError)>,
)
Available on crate features AVMediaFormat and AVMediaSelectionGroup and block2 only.
pub unsafe fn loadMediaSelectionGroupForMediaCharacteristic_completionHandler( &self, media_characteristic: &AVMediaCharacteristic, completion_handler: &Block<dyn Fn(*mut AVMediaSelectionGroup, *mut NSError)>, )
AVMediaFormat and AVMediaSelectionGroup and block2 only.Loads an instance of AVMediaSelectionGroup that contains one or more options with the specified media characteristic.
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.
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.
Sourcepub unsafe fn preferredMediaSelection(&self) -> Retained<AVMediaSelection>
Available on crate feature AVMediaSelection only.
pub unsafe fn preferredMediaSelection(&self) -> Retained<AVMediaSelection>
AVMediaSelection only.Provides an instance of AVMediaSelection with default selections for each of the receiver’s media selection groups.
Sourcepub unsafe fn allMediaSelections(&self) -> Retained<NSArray<AVMediaSelection>>
Available on crate feature AVMediaSelection only.
pub unsafe fn allMediaSelections(&self) -> Retained<NSArray<AVMediaSelection>>
AVMediaSelection only.Provides an array of all permutations of AVMediaSelection for this asset.
Sourcepub unsafe fn hasProtectedContent(&self) -> bool
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.
Sourcepub unsafe fn canContainFragments(&self) -> bool
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.
Sourcepub unsafe fn containsFragments(&self) -> bool
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.
Sourcepub unsafe fn overallDurationHint(&self) -> CMTime
Available on crate feature objc2-core-media only.
pub unsafe fn overallDurationHint(&self) -> CMTime
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.
Sourcepub unsafe fn isPlayable(&self) -> bool
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.
pub unsafe fn isExportable(&self) -> bool
pub unsafe fn isReadable(&self) -> bool
pub unsafe fn isComposable(&self) -> bool
pub unsafe fn isCompatibleWithSavedPhotosAlbum(&self) -> bool
Sourcepub unsafe fn isCompatibleWithAirPlayVideo(&self) -> bool
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.
pub unsafe fn unusedTrackID(&self) -> CMPersistentTrackID
AVVideoComposition and objc2-core-media only.Sourcepub unsafe fn findUnusedTrackIDWithCompletionHandler(
&self,
completion_handler: &Block<dyn Fn(CMPersistentTrackID, *mut NSError)>,
)
Available on crate features AVVideoComposition and block2 and objc2-core-media only.
pub unsafe fn findUnusedTrackIDWithCompletionHandler( &self, completion_handler: &Block<dyn Fn(CMPersistentTrackID, *mut NSError)>, )
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.
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§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());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
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.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
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 AVMutableMovie
Available on crate feature AVAsynchronousKeyValueLoading only.
impl AVAsynchronousKeyValueLoading for AVMutableMovie
AVAsynchronousKeyValueLoading only.Source§impl AsRef<AVAsset> for AVMutableMovie
impl AsRef<AVAsset> for AVMutableMovie
Source§impl AsRef<AVMovie> for AVMutableMovie
impl AsRef<AVMovie> for AVMutableMovie
Source§impl AsRef<AVMutableMovie> for AVMutableMovie
impl AsRef<AVMutableMovie> for AVMutableMovie
Source§impl AsRef<AnyObject> for AVMutableMovie
impl AsRef<AnyObject> for AVMutableMovie
Source§impl AsRef<NSObject> for AVMutableMovie
impl AsRef<NSObject> for AVMutableMovie
Source§impl Borrow<AVAsset> for AVMutableMovie
impl Borrow<AVAsset> for AVMutableMovie
Source§impl Borrow<AVMovie> for AVMutableMovie
impl Borrow<AVMovie> for AVMutableMovie
Source§impl Borrow<AnyObject> for AVMutableMovie
impl Borrow<AnyObject> for AVMutableMovie
Source§impl Borrow<NSObject> for AVMutableMovie
impl Borrow<NSObject> for AVMutableMovie
Source§impl ClassType for AVMutableMovie
impl ClassType for AVMutableMovie
Source§const NAME: &'static str = "AVMutableMovie"
const NAME: &'static str = "AVMutableMovie"
Source§type ThreadKind = <<AVMutableMovie as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<AVMutableMovie as ClassType>::Super as ClassType>::ThreadKind
Source§impl CopyingHelper for AVMutableMovie
impl CopyingHelper for AVMutableMovie
Source§impl Debug for AVMutableMovie
impl Debug for AVMutableMovie
Source§impl Deref for AVMutableMovie
impl Deref for AVMutableMovie
Source§impl Hash for AVMutableMovie
impl Hash for AVMutableMovie
Source§impl Message for AVMutableMovie
impl Message for AVMutableMovie
Source§impl MutableCopyingHelper for AVMutableMovie
impl MutableCopyingHelper for AVMutableMovie
Source§type Result = AVMutableMovie
type Result = AVMutableMovie
Self if the type has no
mutable counterpart. Read moreSource§impl NSCopying for AVMutableMovie
impl NSCopying for AVMutableMovie
Source§impl NSMutableCopying for AVMutableMovie
impl NSMutableCopying for AVMutableMovie
Source§impl NSObjectProtocol for AVMutableMovie
impl NSObjectProtocol for AVMutableMovie
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_ref