protected void renewExtractor() {
        if(mApiExtractor != null) {
            mApiExtractor.release();
        }
        mApiExtractor = new android.media.MediaExtractor();
    }
MediaExtractor facilitates extraction of demuxed, typically encoded,  media data
from a data source.
<p>It is generally used like this:
<pre>
MediaExtractor extractor = new MediaExtractor();
extractor.setDataSource(...);
int numTracks = extractor.getTrackCount();
for (int i = 0; i &lt; 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, ...) &gt;= 0) {
  int trackIndex = extractor.getSampleTrackIndex();
  long presentationTimeUs = extractor.getSampleTime();
  ...
  extractor.advance();
}

extractor.release();
extractor = null;
</pre>

This class wraps Android API's extractor because it is final and cannot be extended. The ability
for extension is needed to keep the MediaPlayer code clean and encapsulate more sophisticated
processing of data sources.

Created by maguggen on 27.08.2014.

@see android.media.MediaExtractor
MediaPlayer/src/main/java/net/protyposis/android/mediaplayer/MediaExtractor.java