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

See Also: MediaExtractor Members

Syntax

[Android.Runtime.Register("android/media/MediaExtractor", DoNotGenerateAcw=true)]
public sealed class MediaExtractor : Java.Lang.Object

Remarks

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

It is generally used like this:

java Example

 MediaExtractor extractor = new MediaExtractor();
 extractor.setDataSource(...);
 int numTracks = extractor.getTrackCount();
 for (int i = 0; i < numTracks; ++i) {
   MediaFormat format = extractor.getTrackFormat(i);
   String mime = format.getString(MediaFormat.KEY_MIME);
   if (weAreInterestedInThisTrack) {
     extractor.selectTrack(i);
   }
 }
 ByteBuffer inputBuffer = ByteBuffer.allocate(...)
 while (extractor.readSampleData(inputBuffer, ...) >= 0) {
   int trackIndex = extractor.getSampleTrackIndex();
   long presentationTimeUs = extractor.getSampleTime();
   ...
   extractor.advance();
 }

 extractor.release();
 extractor = null;
 

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16