Instance Method

mutableTrackCompatibleWithTrack:

Returns a track in the receiver into which any time range of a given asset track can be inserted.

Declaration

- (AVMutableCompositionTrack *)mutableTrackCompatibleWithTrack:(AVAssetTrack *)track;

Parameters

track

An AVAssetTrack from which a time range may be inserted.

Return Value

A mutable track in the receiver into which any time range of track can be inserted. If no such track is available, the returns nil.

Discussion

For best performance, you should keep 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 you want to present media data of the same type serially, even from multiple assets, you should use a single track of that media type. You use this method to identify a suitable existing target track for an insertion.

If there is no compatible track available, you can create a new track of the same media type as track using addMutableTrackWithMediaType:preferredTrackID:.

This method is similar to compatibleTrackForCompositionTrack: (AVAsset).

See Also

Managing Tracks

tracks

An array of mutable composition tracks contained by the composition.

- addMutableTrackWithMediaType:preferredTrackID:

Adds an empty track to the receiver.

- removeTrack:

Removes a specified track from the receiver.

- trackWithTrackID:

Provides a composition track associated with the specified track ID.

- tracksWithMediaCharacteristic:

Provides the composition tracks of the specified media characteristic associated with an asset.

- tracksWithMediaType:

Provides the composition tracks of the specified media type associated with an asset.