public class FilePathDataSource extends DefaultDataSource
DataSource backed by a file absolute path.
This class actually wraps a FileDescriptorDataSource for the apply() operations.
We could pass the path directly to MediaExtractor and MediaMetadataRetriever, but that is
discouraged since they could not be able to open the file from another process.
See MediaExtractor.setDataSource(String) documentation.DataSource.Chunk| Constructor and Description |
|---|
FilePathDataSource(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyExtractor(android.media.MediaExtractor extractor) |
protected void |
applyRetriever(android.media.MediaMetadataRetriever retriever) |
protected void |
release() |
void |
rewind()
Rewinds this source, moving it to its default state.
|
canReadTrack, getDurationUs, getLocation, getOrientation, getReadUs, getTrackFormat, isDrained, readTrack, releaseTrack, seekTo, selectTrackprotected void applyExtractor(@NonNull
android.media.MediaExtractor extractor)
throws java.io.IOException
applyExtractor in class DefaultDataSourcejava.io.IOExceptionprotected void applyRetriever(@NonNull
android.media.MediaMetadataRetriever retriever)
applyRetriever in class DefaultDataSourceprotected void release()
release in class DefaultDataSourcepublic void rewind()
DataSourceDataSource.getReadUs() should be 0
- DataSource.isDrained() should be false
- DataSource.readTrack(Chunk) should return the very first bytesrewind in interface DataSourcerewind in class DefaultDataSource