Package apple.avfoundation
Class AVAssetTrack
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.avfoundation.AVAssetTrack
-
- All Implemented Interfaces:
AVAsynchronousKeyValueLoading,NSCopying,NSObject
- Direct Known Subclasses:
AVCompositionTrack,AVFragmentedAssetTrack,AVMovieTrack
public class AVAssetTrack extends NSObject implements NSCopying, AVAsynchronousKeyValueLoading
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
Nested classes/interfaces inherited from interface apple.avfoundation.protocol.AVAsynchronousKeyValueLoading
AVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAVAssetTrack(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static AVAssetTrackalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)AVAssetasset()provides a reference to the AVAsset of which the AVAssetTrack is a partNSArray<? extends AVAssetTrack>associatedTracksOfType(java.lang.String trackAssociationType)associatedTracksOfType: Provides an NSArray of AVAssetTracks, one for each track associated with the receiver with the specified type of track association.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)NSArray<java.lang.String>availableMetadataFormats()provides an NSArray of NSStrings, each representing a format of metadata that's available for the track (e.g.NSArray<java.lang.String>availableTrackAssociationTypes()Provides an NSArray of NSStrings, each representing a type of track association that the receiver has with one or more of the other tracks of the asset (e.g.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()NSArray<? extends AVMetadataItem>commonMetadata()provides access to an array of AVMetadataItems for each common metadata key for which a value is availablejava.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()floatestimatedDataRate()indicates the estimated data rate of the media data referenced by the track, in units of bits per secondjava.lang.StringextendedLanguageTag()indicates the language tag associated with the track, as an IETF BCP 47 (RFC 4646) language identifier; may be nil if no language tag is indicatedNSArray<?>formatDescriptions()provides an array of CMFormatDescriptions each of which indicates the format of media samples referenced by the track; a track that presents uniform media, e.g. encoded according to the same encoding settings, will provide an array with a count of 1booleanhasAudioSampleDependencies()indicates whether this audio track has dependencies (e.g. kAudioFormatMPEGD_USAC)static longhash_static()booleanhasMediaCharacteristic(java.lang.String mediaCharacteristic)hasMediaCharacteristic: Reports whether the track references media with the specified media characteristic.AVAssetTrackinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisDecodable()Indicates whether the receiver is decodable in the current environment; if YES, the track can be decoded even though decoding may be too slow for real time playback.booleanisEnabled()indicates whether the track is enabled according to state stored in its container or construct; note that its presentation state can be changed from this default via AVPlayerItemTrackbooleanisPlayable()Indicates whether the receiver is playable in the current environment; if YES, an AVPlayerItemTrack of an AVPlayerItem initialized with the receiver's asset can be enabled for playback.booleanisSelfContained()indicates whether the track references sample data only within its storage containerstatic booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)java.lang.StringlanguageCode()indicates the language associated with the track, as an ISO 639-2/T language code; may be nil if no language is indicatedvoidloadValuesAsynchronouslyForKeysCompletionHandler(NSArray<java.lang.String> keys, AVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler handler)loadValuesAsynchronouslyForKeys:completionHandler: Directs the target to load the values of any of the specified keys that are not already loaded.java.lang.StringmediaType()indicates the media type for this track, e.g.NSArray<? extends AVMetadataItem>metadata()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:].NSArray<? extends AVMetadataItem>metadataForFormat(java.lang.String format)metadataForFormat: Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format.CMTimeminFrameDuration()indicates the minimum duration of the track's frames; the value will be kCMTimeInvalid if the minimum frame duration is not known or cannot be calculatedCGSizenaturalSize()indicates the natural dimensions of the media data referenced by the track as a CGSizeintnaturalTimeScale()indicates a timescale in which time values for the track can be operated upon without extraneous numerical conversionstatic java.lang.Objectnew_objc()floatnominalFrameRate()[@property] nominalFrameRate For tracks that carry a full frame per media sample, indicates the frame rate of the track in units of frames per second.CGAffineTransformpreferredTransform()indicates the transform specified in the track's storage container as the preferred transformation of the visual media data for display purposes; its value is often but not always CGAffineTransformIdentityfloatpreferredVolume()indicates the volume specified in the track's storage container as the preferred volume of the audible media databooleanrequiresFrameReordering()[@property] requiresFrameReordering Indicates whether samples in the track may have different values for their presentation and decode timestamps.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)CMTimesamplePresentationTimeForTrackTime(CMTime trackTime)samplePresentationTimeForTrackTime: Maps the specified trackTime through the appropriate time mapping and returns the resulting sample presentation time.AVAssetTrackSegmentsegmentForTrackTime(CMTime trackTime)segmentForTrackTime: Supplies the AVAssetTrackSegment from the segments array with a target timeRange that either contains the specified track time or is the closest to it among the target timeRanges of the track's segments.NSArray<? extends AVAssetTrackSegment>segments()Provides an array of AVAssetTrackSegments with time mappings from the timeline of the track's media samples to the timeline of the track.static voidsetVersion_static(long aVersion)longstatusOfValueForKeyError(java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> outError)statusOfValueForKey: Reports whether the value for a key is immediately available without blocking.static org.moe.natj.objc.Classsuperclass_static()CMTimeRangetimeRange()Indicates the timeRange of the track within the overall timeline of the asset; a track with CMTIME_COMPARE_INLINE(timeRange.start, >, kCMTimeZero) will initially present an empty interval.longtotalSampleDataLength()indicates the total number of bytes of sample data required by the trackinttrackID()indicates the persistent unique identifier for this track of the assetstatic longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static AVAssetTrack alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
asset
public AVAsset asset()
provides a reference to the AVAsset of which the AVAssetTrack is a part
-
associatedTracksOfType
public NSArray<? extends AVAssetTrack> associatedTracksOfType(java.lang.String trackAssociationType)
associatedTracksOfType: Provides an NSArray of AVAssetTracks, one for each track associated with the receiver with the specified type of track association. Becomes callable without blocking when the key @"availableTrackAssociationTypes" has been loaded.- Parameters:
trackAssociationType- The type of track association for which associated tracks are requested.- Returns:
- An NSArray containing AVAssetTracks; may be empty if there is no associated tracks of the specified type.
-
availableMetadataFormats
public NSArray<java.lang.String> availableMetadataFormats()
provides an NSArray of NSStrings, each representing a format of metadata that's available for the track (e.g. QuickTime userdata, etc.) Metadata formats are defined in AVMetadataItem.h.
-
availableTrackAssociationTypes
public NSArray<java.lang.String> availableTrackAssociationTypes()
Provides an NSArray of NSStrings, each representing a type of track association that the receiver has with one or more of the other tracks of the asset (e.g. AVTrackAssociationTypeChapterList, AVTrackAssociationTypeTimecode, etc.). Track association types are defined immediately above.
-
commonMetadata
public NSArray<? extends AVMetadataItem> commonMetadata()
provides access to an array of AVMetadataItems for each common metadata key for which a value is available
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
estimatedDataRate
public float estimatedDataRate()
indicates the estimated data rate of the media data referenced by the track, in units of bits per second
-
extendedLanguageTag
public java.lang.String extendedLanguageTag()
indicates the language tag associated with the track, as an IETF BCP 47 (RFC 4646) language identifier; may be nil if no language tag is indicated
-
formatDescriptions
public NSArray<?> formatDescriptions()
provides an array of CMFormatDescriptions each of which indicates the format of media samples referenced by the track; a track that presents uniform media, e.g. encoded according to the same encoding settings, will provide an array with a count of 1
-
hasMediaCharacteristic
public boolean hasMediaCharacteristic(java.lang.String mediaCharacteristic)
hasMediaCharacteristic: Reports whether the track references media with the specified media characteristic.- Parameters:
mediaCharacteristic- The media characteristic of interest, e.g. AVMediaCharacteristicVisual, AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, etc., as defined above.- Returns:
- YES if the track references media with the specified characteristic, otherwise NO.
-
init
public AVAssetTrack init()
-
isEnabled
public boolean isEnabled()
indicates whether the track is enabled according to state stored in its container or construct; note that its presentation state can be changed from this default via AVPlayerItemTrack
-
isPlayable
public boolean isPlayable()
Indicates whether the receiver is playable in the current environment; if YES, an AVPlayerItemTrack of an AVPlayerItem initialized with the receiver's asset can be enabled for playback.
-
isSelfContained
public boolean isSelfContained()
indicates whether the track references sample data only within its storage container
-
languageCode
public java.lang.String languageCode()
indicates the language associated with the track, as an ISO 639-2/T language code; may be nil if no language is indicated
-
loadValuesAsynchronouslyForKeysCompletionHandler
public void loadValuesAsynchronouslyForKeysCompletionHandler(NSArray<java.lang.String> keys, AVAsynchronousKeyValueLoading.Block_loadValuesAsynchronouslyForKeysCompletionHandler handler)
Description copied from interface:AVAsynchronousKeyValueLoadingloadValuesAsynchronouslyForKeys:completionHandler: Directs the target to load the values of any of the specified keys that are not already loaded.- Specified by:
loadValuesAsynchronouslyForKeysCompletionHandlerin interfaceAVAsynchronousKeyValueLoading- Parameters:
keys- An instance of NSArray, containing NSStrings for the specified keys.handler- The block to be invoked when loading succeeds, fails, or is cancelled.
-
mediaType
public java.lang.String mediaType()
indicates the media type for this track, e.g. AVMediaTypeVideo, AVMediaTypeAudio, etc., as defined in AVMediaFormat.h.
-
metadata
public NSArray<? extends AVMetadataItem> metadata()
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:].
-
metadataForFormat
public NSArray<? extends AVMetadataItem> metadataForFormat(java.lang.String format)
metadataForFormat: Provides an NSArray of AVMetadataItems, one for each metadata item in the container of the specified format. Becomes callable without blocking when the key @"availableMetadataFormats" has been loaded- Parameters:
format- The metadata format for which items are requested.- Returns:
- An NSArray containing AVMetadataItems.
-
minFrameDuration
public CMTime minFrameDuration()
indicates the minimum duration of the track's frames; the value will be kCMTimeInvalid if the minimum frame duration is not known or cannot be calculated
-
naturalSize
public CGSize naturalSize()
indicates the natural dimensions of the media data referenced by the track as a CGSize
-
naturalTimeScale
public int naturalTimeScale()
indicates a timescale in which time values for the track can be operated upon without extraneous numerical conversion
-
nominalFrameRate
public float nominalFrameRate()
[@property] nominalFrameRate For tracks that carry a full frame per media sample, indicates the frame rate of the track in units of frames per second. For field-based video tracks that carry one field per media sample, the value of this property is the field rate, not the frame rate.
-
preferredTransform
public CGAffineTransform preferredTransform()
indicates the transform specified in the track's storage container as the preferred transformation of the visual media data for display purposes; its value is often but not always CGAffineTransformIdentity
-
preferredVolume
public float preferredVolume()
indicates the volume specified in the track's storage container as the preferred volume of the audible media data
-
requiresFrameReordering
public boolean requiresFrameReordering()
[@property] requiresFrameReordering Indicates whether samples in the track may have different values for their presentation and decode timestamps.
-
samplePresentationTimeForTrackTime
public CMTime samplePresentationTimeForTrackTime(CMTime trackTime)
samplePresentationTimeForTrackTime: Maps the specified trackTime through the appropriate time mapping and returns the resulting sample presentation time.- Parameters:
trackTime- The trackTime for which a sample presentation time is requested.- Returns:
- A CMTime; will be invalid if the trackTime is out of range
-
segmentForTrackTime
public AVAssetTrackSegment segmentForTrackTime(CMTime trackTime)
segmentForTrackTime: Supplies the AVAssetTrackSegment from the segments array with a target timeRange that either contains the specified track time or is the closest to it among the target timeRanges of the track's segments. If the trackTime does not map to a sample presentation time (e.g. it's outside the track's timeRange), the segment closest in time to the specified trackTime is returned.- Parameters:
trackTime- The trackTime for which an AVAssetTrackSegment is requested.- Returns:
- An AVAssetTrackSegment.
-
segments
public NSArray<? extends AVAssetTrackSegment> segments()
Provides an array of AVAssetTrackSegments with time mappings from the timeline of the track's media samples to the timeline of the track. Empty edits, i.e. timeRanges for which no media data is available to be presented, have a value of AVAssetTrackSegment.empty equal to YES.
-
statusOfValueForKeyError
public long statusOfValueForKeyError(java.lang.String key, org.moe.natj.general.ptr.Ptr<NSError> outError)Description copied from interface:AVAsynchronousKeyValueLoadingstatusOfValueForKey: Reports whether the value for a key is immediately available without blocking. Clients can use -statusOfValueForKey: to determine the availability of the value of any key of interest. However, this method alone does not prompt the receiver to load the value of a key that's not yet available. To request values for keys that may not already be loaded, without blocking, use -loadValuesAsynchronouslyForKeys:completionHandler:, await invocation of the completion handler, and test the availability of each key via -statusOfValueForKey: before invoking its getter. Even if access to values of some keys may be readily available, as can occur with receivers initialized with URLs for resources on local volumes, extensive I/O or parsing may be needed for these same receivers to provide values for other keys. A duration for a local MP3 file, for example, may be expensive to obtain, even if the values for other AVAsset properties may be trivial to obtain. Blocking that may occur when calling the getter for any key should therefore be avoided in the general case by loading values for all keys of interest via -loadValuesAsynchronouslyForKeys:completionHandler: and testing the availability of the requested values before fetching them by calling getters. The sole exception to this general rule is in usage on Mac OS X on the desktop, where it may be acceptable to block in cases in which the client is preparing objects for use on background threads or in operation queues. On iOS, values should always be loaded asynchronously prior to calling getters for the values, in any usage scenario.- Specified by:
statusOfValueForKeyErrorin interfaceAVAsynchronousKeyValueLoading- Parameters:
key- An instance of NSString containing the specified key.outError- If the status of the value for the key is AVKeyValueStatusFailed, *outError is set to a non-nil NSError that describes the failure that occurred.- Returns:
- The value's current loading status.
-
timeRange
public CMTimeRange timeRange()
Indicates the timeRange of the track within the overall timeline of the asset; a track with CMTIME_COMPARE_INLINE(timeRange.start, >, kCMTimeZero) will initially present an empty interval.
-
totalSampleDataLength
public long totalSampleDataLength()
indicates the total number of bytes of sample data required by the track
-
trackID
public int trackID()
indicates the persistent unique identifier for this track of the asset
-
isDecodable
public boolean isDecodable()
Indicates whether the receiver is decodable in the current environment; if YES, the track can be decoded even though decoding may be too slow for real time playback.
-
hasAudioSampleDependencies
public boolean hasAudioSampleDependencies()
indicates whether this audio track has dependencies (e.g. kAudioFormatMPEGD_USAC)
-
-