AVCompositionTrackSegment Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework |
| Availability | Available in iOS 4.0 and later. |
| Declared in | AVCompositionTrackSegment.h |
Overview
An AVCompositionTrackSegment object represents a segment of an AVCompositionTrack object, comprising a URL, and track identifier, and a time mapping from the source track to the composition track.
You typically use this class to save the low-level representation of a composition to storage formats of your choosing and to reconstitute them from storage.
Tasks
Creating a Segment
-
+ compositionTrackSegmentWithTimeRange: -
– initWithTimeRange: -
+ compositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange: -
– initWithURL:trackID:sourceTimeRange:targetTimeRange:
Segment Properties
-
sourceURLproperty -
sourceTrackIDproperty -
emptyproperty
Properties
empty
Indicates whether the segment is empty. (read-only)
Discussion
An empty segment has a valid target time range but sourceURL is nil and the source start time is kCMTimeInvalid; all other fields are undefined.
Availability
- Available in iOS 4.1 and later.
Declared In
AVCompositionTrackSegment.hsourceTrackID
The track ID of the container file of the media presented by the track segment. (read-only)
Discussion
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.hsourceURL
The container file of the media presented by the track segment. (read-only)
Discussion
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.hClass Methods
compositionTrackSegmentWithTimeRange:
Returns a composition track segment that presents an empty track segment.
Parameters
- timeRange
The time range of the empty composition track segment.
Return Value
An composition track segment that presents an empty track segment.
Discussion
This method invokes initWithURL:trackID:sourceTimeRange:targetTimeRange: with a nil URL, a trackID of kCMPersistentTrackID_Invalid, a time mapping with source.start and source.duration equal to kCMTimeInvalid, and with a target equal to timeRange.
This is the standard low-level representation of an empty track segment.
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.hcompositionTrackSegmentWithURL:trackID:sourceTimeRange:targetTimeRange:
Returns a composition track segment that presents a portion of a file referenced by a given URL.
Parameters
- URL
An URL that references the container file to be presented by the track segment.
- trackID
The track identifier that specifies the track of the container file to be presented by the track segment.
- sourceTimeRange
The time range of the track of the container file to be presented by the track segment..
- targetTimeRange
The time range of the composition track during which the track segment is to be presented.
Return Value
A track segment that presents a portion of a file referenced by URL.
Discussion
To specify that the segment be played at the asset’s normal rate, set source.duration == target.duration in the time mapping. Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.hInstance Methods
initWithTimeRange:
Initializes a track segment that presents an empty track segment.
Parameters
- timeRange
The time range of the empty track segment.
Return Value
A track segment that presents an empty track segment.
Discussion
This method invokes initWithURL:trackID:sourceTimeRange:targetTimeRange: with a nil URL, a trackID of kCMPersistentTrackID_Invalid, a time mapping with source.start and source.duration equal to kCMTimeInvalid, and with a target equal to timeRange.
This is the standard low-level representation of an empty track segment.
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.hinitWithURL:trackID:sourceTimeRange:targetTimeRange:
Initializes a track segment that presents a portion of a file referenced by a given URL.
Parameters
- URL
An URL that references the container file to be presented by the track segment.
- trackID
The track identifier that specifies the track of the container file to be presented by the track segment.
- sourceTimeRange
The time range of the track of the container file to be presented by the track segment..
- targetTimeRange
The time range of the composition track during which the track segment is to be presented.
Return Value
A track segment that presents a portion of a file referenced by URL.
Discussion
To specify that the segment be played at the asset’s normal rate, set source.duration == target.duration in the time mapping. Otherwise, the segment will be played at a rate equal to the ratio source.duration / target.duration.
Availability
- Available in iOS 4.0 and later.
Declared In
AVCompositionTrackSegment.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-06-30)