Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

AVAssetTrackMBS.associatedTracksOfType(trackAssociationType as string) as AVAssetTrackMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: An array containing other tracks associated with the track using the specified association type.
Notes:
trackAssociationType: The association type for which associated tracks are requested.

Returns an array of AVAssetTrack objects associated with the track by trackAssociationType. May be empty if no tracks are associated through the specified association type.

You can call this method without blocking after availableTrackAssociationTypes has been loaded.
Available in OS X v10.9 and later.

Feedback, Comments & Corrections

AVAssetTrackMBS.availableMetadataFormats as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array containing the metadata formats available for the track. (read-only)
Notes: The array contains String objects, one for each metadata format that's available for the track (such as QuickTime user data). For possible values, see AVMetadataItem.

Feedback, Comments & Corrections

AVAssetTrackMBS.availableTrackAssociationTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: An array of association types used to associate other tracks with the track. (read-only)
Notes:
The array contains strings, one for each type of association for which the track has associated tracks. For possible values, see "Track Association Types" in Apple's documentation.
Available in OS X v10.9 and later.

Feedback, Comments & Corrections

AVAssetTrackMBS.commonMetadata as AVMetadataItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array of AVMetadataItem objects for each common metadata key for which a value is available. (read-only)

Feedback, Comments & Corrections

AVAssetTrackMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The private constructor.

Feedback, Comments & Corrections

AVAssetTrackMBS.copy as AVAssetTrackMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Creates a copy of the object.

Feedback, Comments & Corrections

AVAssetTrackMBS.formatDescriptions as CMFormatDescriptionMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The formats of media samples referenced by the track. (read-only)
Notes: The array contains CMFormatDescriptions, each of which indicates the format of media samples referenced by the track. A track that presents uniform media (for example, encoded according to the same encoding settings) will provide an array with a count of 1.

Feedback, Comments & Corrections

AVAssetTrackMBS.hasMediaCharacteristic(mediaCharacteristic as string) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns a Boolean value that indicates whether the track references media with the specified media characteristic.
Notes:
mediaCharacteristic: The media characteristic of interest.
For possible values, see "Media Characteristics" in AV Foundation Constants Reference, for example AVMediaCharacteristicVisual, AVMediaCharacteristicAudible, or AVMediaCharacteristicLegible.

Returns true if the track references media with the specified characteristic, otherwise false.

Feedback, Comments & Corrections

AVAssetTrackMBS.loadValuesAsynchronouslyForKeys(keys() as string, tag as Variant = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Tells the asset to load the values of any of the specified keys that are not already loaded.
Notes:
keys: An array containing the required keys.

Calls AVFoundationMBS.AssetTrackLoadValuesAsynchronouslyForKeysFinished on completion.
The completion event will be invoked exactly once per invocation of this method:

  • Synchronously if an I/O error or other format-related error occurs immediately.
  • Asynchronously at a subsequent time if a loading error occurs at a later stage of processing, or if cancelLoading is invoked on an AVAsset instance.

The completion states of the keys you specify in keys are not necessarily the same—some may be loaded, and others may have failed. You must check the status of each key individually.

If you want to receive error reporting for loading that's still pending, you can call this method at any time—even after an asset has begun to load data for operations in progress or already completed. If a fatal error has already occurred, the completion event is invoked synchronously.

Feedback, Comments & Corrections

AVAssetTrackMBS.metadataForFormat(Format as string) as AVMetadataItemMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: An array of metadata items, one for each metadata item in the container of the specified format.
Notes:
format: The metadata format for which items are requested.

Returns an array of AVMetadataItem objects, one for each metadata item in the container of the format specified by format, or empty array if there is no metadata of the specified format.

You can call this method without blocking after availableMetadataFormats has been loaded.

Feedback, Comments & Corrections

AVAssetTrackMBS.preferredTransform as CGAffineTransformMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The transform specified in the track's storage container as the preferred transformation of the visual media data for display purposes. (read-only)
Notes: The value of this property is often, but not always, CGAffineTransformIdentity.

Feedback, Comments & Corrections

AVAssetTrackMBS.samplePresentationTimeForTrackTime(trackTime as CMTimeMBS) as CMTimeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Maps the specified track time through the appropriate time mapping and returns the resulting sample presentation time.
Notes:
trackTime: The track time for which a sample presentation time is requested.
Returns the sample presentation time corresponding to trackTime; the value will be invalid if trackTime is out of range.

Feedback, Comments & Corrections

AVAssetTrackMBS.segmentForTrackTime(trackTime as CMTimeMBS) as AVAssetTrackSegmentMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The track segment that corresponds to the specified track time.
Notes:
trackTime: The track time for which you want the segment.
Returns the track segment from the segments array that corresponds to trackTime, or nil if trackTime is out of range.

Feedback, Comments & Corrections

AVAssetTrackMBS.segments as AVAssetTrackSegmentMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The time mappings from the track's media samples to the timeline of the track. (read-only)
Notes:
The array contains instances of AVAssetTrackSegment.

Empty edits (that is, time ranges for which no media data is available to be presented) have source.start and source.duration equal to kCMTimeInvalid.

Feedback, Comments & Corrections

AVAssetTrackMBS.statusOfValueForKey(key as string, byref error as NSErrorMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Reports whether the value for a given key is immediately available without blocking. (required)
Notes:
key: The key whose status you want.
error: If the status of the value for the key is AVKeyValueStatusFailed, upon return contains an NSError object that describes the failure that occurred.

Returns the current loading status of the value for key. For possible values, see "Protocol Methods."

You use this method to determine the availability of the value for a key. This method does not cause an asset 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 and wait for invocation of the completion handler to be informed of availability.

Feedback, Comments & Corrections

AVAssetTrackMBS.timeRange as CMTimeRangeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The time range of the track within the overall timeline of the asset. (read-only)
Notes: A track with CMTimeCompare(timeRange.start, kCMTimeZero) == 1 will initially present an empty time range.

Feedback, Comments & Corrections

AVAssetTrackMBS.trackSamples(formatOptions as Dictionary) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method AVFoundation MBS AVFoundation Plugin 15.4 Yes No No Yes, macOS only No
Function: Queries the track Samples
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4v")
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)
dim tracks() as AVAssetTrackMBS = a.tracksWithMediaType(AVFoundationMBS.AVMediaTypeAudio)
dim track as AVAssetTrackMBS = tracks(0)

dim d as new Dictionary
dim n as Integer = OSTypeFromStringMBS(AVFoundationMBS.kAudioFormatLinearPCM)
d.Value(AVFoundationMBS.AVFormatIDKey) = n
d.Value(AVFoundationMBS.AVLinearPCMBitDepthKey) = 16
d.Value(AVFoundationMBS.AVLinearPCMIsBigEndianKey) = false
d.Value(AVFoundationMBS.AVLinearPCMIsFloatKey) = false
d.Value(AVFoundationMBS.AVLinearPCMIsNonInterleaved) = false

dim SampleData as MemoryBlock = track.trackSamples(d)

window1.Backdrop = RenderSamplesMBS(SampleData, SampleData.Size / 2, 1, window1.Width, window1.Height, 1, &c88B5C4, &c274C5A, &c203F4E, 15)
Notes:
Returns nil in case of errors.
Track should be an audio or muxed track.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS AVFoundation Plugin.




Links
MBS Xojo Plugins