Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVAssetReaderMBS class.

AVAssetReaderMBS.addOutput(output as AVAssetReaderOutputMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds a given output to the receiver.

output: The reader output to add.

Outputs are created with a reference to one or more AVAssetTrack objects. Adding an output to an asset reader indicates to the reader that it should source from those tracks. The tracks must be owned by the asset returned by the reader's asset property.
You cannot add an output after reading has started.

AVAssetReaderMBS.asset as AVAssetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The asset with which the receiver was initialized. (read-only)

Concrete instances of AVAssetReader with specific AVAssetTrack instances must obtain those tracks from the asset returned by this property.

AVAssetReaderMBS.canAddOutput(output as AVAssetReaderOutputMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether a given output can be added to the receiver.

output: The reader output to be tested.

Returns true if output can be added to the receiver, otherwise false.
You cannot add an output that reads from a track of an asset other than the asset used to initialize the receiver.

AVAssetReaderMBS.cancelReading

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Cancels any background work and prevents the receiver's outputs from reading more samples.

If you want to stop reading samples from the receiver before reaching the end of its time range, you should call this method to stop any background read ahead operations that the may have been in progress.

Some examples using this method:

AVAssetReaderMBS.Constructor(item as AVAssetMBS, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an asset reader for reading media data from a specified asset.

asset: The asset from which media data is to be read.
Error: If initialization of the reader fails, upon return contains an error that describes the problem.

AVAssetReaderMBS.error as NSErrorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Describes the error that occurred if the status is AVAssetReaderStatusFailed. (read-only)

This property is thread safe.

The value of this property describes what caused the reader to no longer be able to read its asset. If the reader's status is not AVAssetReaderStatusFailed, the value of this property is nil.

AVAssetReaderMBS.outputs as AVAssetReaderOutputMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The outputs from which clients of reader can read media data. (read-only)

The array contains concrete instances of AVAssetReaderOutput associated with the reader.

AVAssetReaderMBS.startReading

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Prepares the receiver for obtaining sample buffers from the asset.

Returns true if the reader is able to start reading, otherwise false.

This method validates the entire collection of settings for outputs for tracks, for audio mixdown, and for video composition and initiates reading of all outputs.

status signals the terminal state of the asset reader, and if a failure occurs, error describes the failure.

Some examples using this method:

AVAssetReaderMBS.status as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The status of the reading of sample buffers from the asset. (read-only)

This property is thread safe. For possible values, see "Reader Status Constants."

The value of this property indicates whether reading is in progress, has completed successfully, has been canceled, or has failed. You should check the value of this property copyNextSampleBuffer (AVAssetReaderOutput) returns nil to determine why no more samples could be read.

AVAssetReaderMBS.timeRange as CMTimeRangeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The time range of the asset that should be read.

The intersection of the value of this property and CMTimeRangeMake(kCMTimeZero, asset.duration) determines the time range of the asset from which media data will be read.

The default value is CMTimeRangeMake(kCMTimeZero, kCMTimePositiveInfinity). You cannot change the value of this property after reading has started.
(Read and Write computed property)

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


The biggest plugin in space...