Class: AVMutableCompositionTrack
- Inherits:
-
AVCompositionTrack
- Object
- NSObject
- AVAssetTrack
- AVCompositionTrack
- AVMutableCompositionTrack
Overview
AVMutableCompositionTrack is a mutable subclass of AVCompositionTrack that lets you for insert, remove, and scale track segments without affecting their low-level representation (that is, the operations you perform are non-destructive on the original).
Instance Attribute Summary (collapse)
-
- extendedLanguageTag
The language tag associated with the track, as an RFC 4646 language tag.
-
- languageCode
The language associated with the track, as an ISO 639-2/T language code.
-
- naturalTimeScale
The timescale in which time values for the track can be operated upon without extraneous numerical conversion.
-
- preferredTransform
The preferred transformation of the visual media data for display purposes.
-
- preferredVolume
The preferred volume of the audible media data.
-
- segments
The composition track’s array of track segments.
Attributes inherited from AVAssetTrack
#asset, #availableMetadataFormats, #commonMetadata, #enabled, #estimatedDataRate, #formatDescriptions, #mediaType, #naturalSize, #nominalFrameRate, #playable, #selfContained, #timeRange, #totalSampleDataLength, #trackID
Instance Method Summary (collapse)
-
- insertEmptyTimeRange:
Adds or extends an empty time range within the receiver.
-
- insertTimeRange:ofTrack:atTime:error:
Inserts a time range of a source track.
-
- insertTimeRanges:ofTracks:atTime:error:
Inserts the timeRanges of multiple source tracks into a track of a composition.
-
- removeTimeRange:
Removes a specified time range from the receiver.
-
- scaleTimeRange:toDuration:
Changes the duration of a time range in the receiver.
-
- validateTrackSegments:error:
Returns a Boolean value that indicates whether a given array of track segments conform to the timing rules for a composition track.
Methods inherited from AVAssetTrack
#hasMediaCharacteristic:, #metadataForFormat:, #samplePresentationTimeForTrackTime:, #segmentForTrackTime:
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (String) extendedLanguageTag
The language tag associated with the track, as an RFC 4646 language tag. If not set, the value is nil.
- (String) languageCode
The language associated with the track, as an ISO 639-2/T language code. If not set, the value is nil.
- (CMTimeScale) naturalTimeScale
The timescale in which time values for the track can be operated upon without extraneous numerical conversion. If not set, the value is the natural time scale of the first non-empty edit, or 600 if there are no non-empty edits.Set the value to 0 to revert to the default behavior.
- (CGAffineTransform) preferredTransform
The preferred transformation of the visual media data for display purposes. If not set, the value is CGAffineTransformIdentity.
- (Float) preferredVolume
The preferred volume of the audible media data. If not set, the value is 1.0.
- (Array) segments
The composition track’s array of track segments.
Instance Method Details
- (Object) insertEmptyTimeRange(timeRange)
Adds or extends an empty time range within the receiver. If you insert an empty time range into the track, any media that was presented during that interval prior to the insertion will be presented instead immediately afterward.The nature of the data inserted depends upon the media type of the track. For example, an empty time range in a sound track presents silence.
- (Boolean) insertTimeRange(timeRange, ofTrack:track, atTime:startTime, error:error)
Inserts a time range of a source track. By default, the inserted track’s time range is presented at its natural duration and rate. You can scale it to a different duration (so that it is presented at a different rate) using scaleTimeRange:toDuration:.Insertion might fail if, for example, the asset that you try to insert is restricted by copy-protection.
- (Boolean) insertTimeRanges(timeRanges, ofTracks:tracks, atTime:startTime, error:error)
Inserts the timeRanges of multiple source tracks into a track of a composition.
This method is equivalent to (but more efficient than) calling -insertTimeRange:ofTrack:atTime:error |
for each timeRange/track pair.If this method returns an error, none of the time ranges will be inserted into the composition track.To specify an empty time range, pass an NSNull object for the track and a time range of starting at kCMTimeInvalid with a duration of the desired empty edit. |
- (Object) removeTimeRange(timeRange)
Removes a specified time range from the receiver. Removing a time range does not cause the track to be removed from the composition. Instead it removes or truncates track segments that intersect with the time range.
- (Object) scaleTimeRange(timeRange, toDuration:duration)
Changes the duration of a time range in the receiver. Each track segment affected by the scaling operation will be presented at a rate equal to source.duration / target.duration of its resulting timeMapping.
- (Boolean) validateTrackSegments(trackSegments, error:error)
Returns a Boolean value that indicates whether a given array of track segments conform to the timing rules for a composition track. You can use this method to ensure that an array of track segments is suitable for setting as the value of the trackSegments property. The timeMapping.target.start of the first track segment must be kCMTimeZero, and the timeMapping.target.start of each subsequent track segment must equal CMTimeRangeGetEnd(.timeMapping.target).If you want to modify the existing trackSegments array, you can create a mutable copy of it, modify the mutable array, and then validate the mutable array using this method.