MediaExtractor MediaExtractor Class

Definition

MediaExtractor facilitates extraction of demuxed, typically encoded, media data from a data source.

[Android.Runtime.Register("android/media/MediaExtractor", ApiSince=16, DoNotGenerateAcw=true)]
public sealed class MediaExtractor : Java.Lang.Object
type MediaExtractor = class
    inherit Object
Inheritance
MediaExtractorMediaExtractor
Attributes

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

MediaExtractor() MediaExtractor()

Fields

SampleFlagEncrypted SampleFlagEncrypted

M:Android.Media.MediaCodec.QueueSecureInputBuffer(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)

SampleFlagPartialFrame SampleFlagPartialFrame
SampleFlagSync SampleFlagSync

The sample is a sync sample (or in MediaCodec's terminology it is a key frame.

SeekToClosestSync SeekToClosestSync

If possible, seek to the sync sample closest to the specified time

SeekToNextSync SeekToNextSync

If possible, seek to a sync sample at or after the specified time

SeekToPreviousSync SeekToPreviousSync

If possible, seek to a sync sample at or before the specified time

Properties

CachedDuration CachedDuration

Returns an estimate of how much data is presently cached in memory expressed in microseconds.

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
DrmInitData DrmInitData
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasCacheReachedEndOfStream HasCacheReachedEndOfStream

Returns true iff we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data).

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
Metrics Metrics
PeerReference PeerReference Inherited from Object
PsshInfo PsshInfo

Get the PSSH info if present.

SampleFlags SampleFlags

Returns the current sample's flags.

SampleTime SampleTime

Returns the current sample's presentation time in microseconds. or -1 if no more samples are available.

SampleTrackIndex SampleTrackIndex

Returns the track index the current sample originates from (or -1 if no more samples are available)

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
TrackCount TrackCount

Count the number of tracks found in the data source.

Methods

Advance() Advance()

Advance to the next sample.

AdvanceAsync() AdvanceAsync()
Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetCasInfo(Int32) GetCasInfo(Int32)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetSampleCryptoInfo(MediaCodec+CryptoInfo) GetSampleCryptoInfo(MediaCodec+CryptoInfo)

If the sample flags indicate that the current sample is at least partially encrypted, this call returns relevant information about the structure of the sample data required for decryption.

GetTrackFormat(Int32) GetTrackFormat(Int32)

Get the track format at the specified index.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
ReadSampleData(ByteBuffer, Int32) ReadSampleData(ByteBuffer, Int32)

Retrieve the current encoded sample and store it in the byte buffer starting at the given offset.

ReadSampleDataAsync(ByteBuffer, Int32) ReadSampleDataAsync(ByteBuffer, Int32)
Release() Release()

Make sure you call this when you're done to free up any resources instead of relying on the garbage collector to do this for you at some point in the future.

SeekTo(Int64, MediaExtractorSeekTo) SeekTo(Int64, MediaExtractorSeekTo)

All selected tracks seek near the requested time according to the specified mode.

SelectTrack(Int32) SelectTrack(Int32)

Subsequent calls to ReadSampleData(ByteBuffer, Int32), SampleTrackIndex and SampleTime only retrieve information for the subset of tracks selected.

SetDataSource(AssetFileDescriptor) SetDataSource(AssetFileDescriptor)
SetDataSource(Context, Uri, IDictionary<String,String>) SetDataSource(Context, Uri, IDictionary<String,String>)
SetDataSource(FileDescriptor) SetDataSource(FileDescriptor)

Sets the data source (FileDescriptor) to use.

SetDataSource(FileDescriptor, Int64, Int64) SetDataSource(FileDescriptor, Int64, Int64)

Sets the data source (FileDescriptor) to use.

SetDataSource(MediaDataSource) SetDataSource(MediaDataSource)
SetDataSource(String) SetDataSource(String)

Sets the data source (file-path or http URL) to use.

SetDataSource(String, IDictionary<String,String>) SetDataSource(String, IDictionary<String,String>)
SetDataSourceAsync(AssetFileDescriptor) SetDataSourceAsync(AssetFileDescriptor)
SetDataSourceAsync(Context, Uri, IDictionary<String,String>) SetDataSourceAsync(Context, Uri, IDictionary<String,String>)
SetDataSourceAsync(FileDescriptor) SetDataSourceAsync(FileDescriptor)
SetDataSourceAsync(FileDescriptor, Int64, Int64) SetDataSourceAsync(FileDescriptor, Int64, Int64)
SetDataSourceAsync(MediaDataSource) SetDataSourceAsync(MediaDataSource)
SetDataSourceAsync(String) SetDataSourceAsync(String)
SetDataSourceAsync(String, IDictionary<String,String>) SetDataSourceAsync(String, IDictionary<String,String>)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetMediaCas(MediaCas) SetMediaCas(MediaCas)
ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
UnselectTrack(Int32) UnselectTrack(Int32)

Subsequent calls to ReadSampleData(ByteBuffer, Int32), SampleTrackIndex and SampleTime only retrieve information for the subset of tracks selected.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to