Exoplayer: Why ExoPlayer2 don't use MediaExtractor?

Created on 20 Mar 2017  路  2Comments  路  Source: google/ExoPlayer

When I try to learn ExoPlayer2 source code, I found that it do not using MediaExtractor + MediaCodec as usual rather than implement Mp4Extractor itself. There any problem with MediaExtractor ?

question

Most helpful comment

There are a few reasons:

  • MediaExtractor uses a threading model that's not well suited to ExoPlayer.
  • It also doesn't provide as much control over buffering as we'd like.
  • Implementation of the extractors under MediaExtractor varies between versions of Android.
  • Extractors under MediaExtractor lack some functionality that we're able to support in ExoPlayer extractors.

Implementing our own extractors avoids all of the above. It also means that we can add new features to the extractors and have them work on all versions of Android, rather than adding them into the platform and have them work on new versions of Android only.

All 2 comments

There are a few reasons:

  • MediaExtractor uses a threading model that's not well suited to ExoPlayer.
  • It also doesn't provide as much control over buffering as we'd like.
  • Implementation of the extractors under MediaExtractor varies between versions of Android.
  • Extractors under MediaExtractor lack some functionality that we're able to support in ExoPlayer extractors.

Implementing our own extractors avoids all of the above. It also means that we can add new features to the extractors and have them work on all versions of Android, rather than adding them into the platform and have them work on new versions of Android only.

@ojw28 Thank your for your reply in time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

R00We picture R00We  路  3Comments

Ufosek picture Ufosek  路  3Comments

talklittle picture talklittle  路  3Comments

qeadsw picture qeadsw  路  3Comments

mkaflowski picture mkaflowski  路  3Comments