Question

I need to know where/how the MediaPlayer caches audio/video content when it is "streamed" via progressive download, by default.

We're evaluating options for an Android media player app. One item of concern is preventing the content from being copied (to the extent that is possible). Progressive download has a lot of upsides, but we need to make sure we're taking reasonable steps to protect the media. I must be doing the wrong searches in the wrong places, because I haven't been able to find any details on this. I've scoured the file system of our test device trying to find any cached files from our test progressive download app - to no avail (which is potentially good, for our purposes).

Was it helpful?

Solution

In Android, MediaPlayer is a top-level class which abstracts the underlying player engine(s). In the MediaPlayer, the overall processing is divided as 3 major components as

MediaTrack ==> OMXCodec / ACodec ==> Sink

Where MediaTrack is a track specific implementation which is based out of MediaExtractor which is the parser engine.

MediaExtractor is initialized with a DataSource which abstracts the input source. For your progressive download, the implementation of DataSource will be the main focus as this will provide the buffers to the downstream components. Since Android platform works on pull model, DataSource will control the rate of providing the data.

In AOSP, you could refer to a sample implementation as in http://androidxref.com/4.2.2_r1/xref/frameworks/base/media/java/android/media/MediaPlayer.java#2132 . Some further information on the HTTPSource implementation could be referred at http://androidxref.com/4.2.2_r1/xref/frameworks/av/media/libstagefright/HTTPBase.cpp#47

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top