Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

FileDataSourceDesc

public class FileDataSourceDesc
extends DataSourceDesc

java.lang.Object
   ↳ android.media.DataSourceDesc
     ↳ android.media.FileDataSourceDesc


Structure of data source descriptor for sources using file descriptor. Used by MediaPlayer2#setDataSource, MediaPlayer2#setNextDataSource and MediaPlayer2#setNextDataSources to set data source for playback.

Users should use Builder to create FileDataSourceDesc.

Summary

Nested classes

class FileDataSourceDesc.Builder

Builder class for FileDataSourceDesc objects. 

Constants

long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

Inherited constants

Public methods

long getLength()

Return the content length associated with the ParcelFileDescriptor of this data source.

long getOffset()

Return the offset associated with the ParcelFileDescriptor of this data source.

ParcelFileDescriptor getParcelFileDescriptor()

Return the ParcelFileDescriptor of this data source.

Inherited methods

Constants

FD_LENGTH_UNKNOWN

public static final long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

See also:

Constant Value: 576460752303423487 (0x07ffffffffffffff)

Public methods

getLength

public long getLength ()

Return the content length associated with the ParcelFileDescriptor of this data source. FD_LENGTH_UNKNOWN means same as the length of source content.

Returns
long the content length associated with the ParcelFileDescriptor of this data source

getOffset

public long getOffset ()

Return the offset associated with the ParcelFileDescriptor of this data source. It's meaningful only when it has been set by the Builder.

Returns
long the offset associated with the ParcelFileDescriptor of this data source

getParcelFileDescriptor

public ParcelFileDescriptor getParcelFileDescriptor ()

Return the ParcelFileDescriptor of this data source.

Returns
ParcelFileDescriptor the ParcelFileDescriptor of this data source