belongs to Maven artifact androidx.media:media:1.0.0-alpha1

DataSourceDesc

public final class DataSourceDesc
extends Object

java.lang.Object
   ↳ androidx.media.DataSourceDesc


Structure for data source descriptor. Used by MediaItem2.

Users should use DataSourceDesc.Builder to change DataSourceDesc.

See also:

Summary

Nested classes

class DataSourceDesc.Builder

Builder class for DataSourceDesc objects. 

Constants

long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

long POSITION_UNKNOWN

Used when a position is unknown.

int TYPE_CALLBACK

int TYPE_FD

int TYPE_NONE

int TYPE_URI

Public methods

long getEndPosition()

Return the position in milliseconds at which the playback will end.

FileDescriptor getFileDescriptor()

Return the FileDescriptor of this data source.

long getFileDescriptorLength()

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

long getFileDescriptorOffset()

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

Media2DataSource getMedia2DataSource()

Return the Media2DataSource of this data source.

String getMediaId()

Return the media Id of data source.

long getStartPosition()

Return the position in milliseconds at which the playback will start.

int getType()

Return the type of data source.

Uri getUri()

Return the Uri of this data source.

Context getUriContext()

Return the Context used for resolving the Uri of this data source.

List<HttpCookie> getUriCookies()

Return the Uri cookies of this data source.

Map<String, String> getUriHeaders()

Return the Uri headers of this data source.

Inherited methods

Constants

FD_LENGTH_UNKNOWN

long FD_LENGTH_UNKNOWN

Used when the length of file descriptor is unknown.

Constant Value: 576460752303423487 (0x07ffffffffffffff)

POSITION_UNKNOWN

long POSITION_UNKNOWN

Used when a position is unknown.

See also:

Constant Value: 576460752303423487 (0x07ffffffffffffff)

TYPE_CALLBACK

int TYPE_CALLBACK

Constant Value: 1 (0x00000001)

TYPE_FD

int TYPE_FD

Constant Value: 2 (0x00000002)

TYPE_NONE

int TYPE_NONE

Constant Value: 0 (0x00000000)

TYPE_URI

int TYPE_URI

Constant Value: 3 (0x00000003)

Public methods

getEndPosition

long getEndPosition ()

Return the position in milliseconds at which the playback will end. POSITION_UNKNOWN means ending at the end of source content.

Returns
long the position in milliseconds at which the playback will end

getFileDescriptor

FileDescriptor getFileDescriptor ()

Return the FileDescriptor of this data source. It's meaningful only when getType returns TYPE_FD.

Returns
FileDescriptor the FileDescriptor of this data source

getFileDescriptorLength

long getFileDescriptorLength ()

Return the content length associated with the FileDescriptor of this data source. It's meaningful only when getType returns TYPE_FD. FD_LENGTH_UNKNOWN means same as the length of source content.

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

getFileDescriptorOffset

long getFileDescriptorOffset ()

Return the offset associated with the FileDescriptor of this data source. It's meaningful only when getType returns TYPE_FD and it has been set by the DataSourceDesc.Builder.

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

getMedia2DataSource

Media2DataSource getMedia2DataSource ()

Return the Media2DataSource of this data source. It's meaningful only when getType returns TYPE_CALLBACK.

Returns
Media2DataSource the Media2DataSource of this data source

getMediaId

String getMediaId ()

Return the media Id of data source.

Returns
String the media Id of data source

getStartPosition

long getStartPosition ()

Return the position in milliseconds at which the playback will start.

Returns
long the position in milliseconds at which the playback will start

getType

int getType ()

Return the type of data source.

Returns
int the type of data source

getUri

Uri getUri ()

Return the Uri of this data source. It's meaningful only when getType returns TYPE_URI.

Returns
Uri the Uri of this data source

getUriContext

Context getUriContext ()

Return the Context used for resolving the Uri of this data source. It's meaningful only when getType returns TYPE_URI.

Returns
Context the Context used for resolving the Uri of this data source

getUriCookies

List<HttpCookie> getUriCookies ()

Return the Uri cookies of this data source. It's meaningful only when getType returns TYPE_URI.

Returns
List<HttpCookie> the Uri cookies of this data source

getUriHeaders

Map<String, String> getUriHeaders ()

Return the Uri headers of this data source. It's meaningful only when getType returns TYPE_URI.

Returns
Map<String, String> the Uri headers of this data source