public interface AdaptiveMediaSourceEventListener
MediaSource
events.Modifier and Type | Interface and Description |
---|---|
static class |
AdaptiveMediaSourceEventListener.EventDispatcher
Dispatches events to a
AdaptiveMediaSourceEventListener . |
Modifier and Type | Method and Description |
---|---|
void |
onDownstreamFormatChanged(int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaTimeMs)
Called when a downstream format change occurs (i.e.
|
void |
onLoadCanceled(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded)
Called when a load is canceled.
|
void |
onLoadCompleted(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded)
Called when a load ends.
|
void |
onLoadError(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs,
long loadDurationMs,
long bytesLoaded,
IOException error,
boolean wasCanceled)
Called when a load error occurs.
|
void |
onLoadStarted(DataSpec dataSpec,
int dataType,
int trackType,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long mediaStartTimeMs,
long mediaEndTimeMs,
long elapsedRealtimeMs)
Called when a load begins.
|
void |
onUpstreamDiscarded(int trackType,
long mediaStartTimeMs,
long mediaEndTimeMs)
Called when data is removed from the back of a media buffer, typically so that it can be
re-buffered in a different format.
|
void onLoadStarted(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs)
dataSpec
- Defines the data being loaded.dataType
- One of the C
DATA_TYPE_*
constants defining the type of data
being loaded.trackType
- One of the C
TRACK_TYPE_*
constants if the data corresponds
to media of a specific type. C.TRACK_TYPE_UNKNOWN
otherwise.trackFormat
- The format of the track to which the data belongs. Null if the data does
not belong to a track.trackSelectionReason
- One of the C
SELECTION_REASON_*
constants if the
data belongs to a track. C.SELECTION_REASON_UNKNOWN
otherwise.trackSelectionData
- Optional data associated with the selection of the track to which the
data belongs. Null if the data does not belong to a track.mediaStartTimeMs
- The start time of the media being loaded, or C.TIME_UNSET
if
the load is not for media data.mediaEndTimeMs
- The end time of the media being loaded, or C.TIME_UNSET
if the
load is not for media data.elapsedRealtimeMs
- The value of SystemClock.elapsedRealtime()
when the load began.void onLoadCompleted(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded)
dataSpec
- Defines the data being loaded.dataType
- One of the C
DATA_TYPE_*
constants defining the type of data
being loaded.trackType
- One of the C
TRACK_TYPE_*
constants if the data corresponds
to media of a specific type. C.TRACK_TYPE_UNKNOWN
otherwise.trackFormat
- The format of the track to which the data belongs. Null if the data does
not belong to a track.trackSelectionReason
- One of the C
SELECTION_REASON_*
constants if the
data belongs to a track. C.SELECTION_REASON_UNKNOWN
otherwise.trackSelectionData
- Optional data associated with the selection of the track to which the
data belongs. Null if the data does not belong to a track.mediaStartTimeMs
- The start time of the media being loaded, or C.TIME_UNSET
if
the load is not for media data.mediaEndTimeMs
- The end time of the media being loaded, or C.TIME_UNSET
if the
load is not for media data.elapsedRealtimeMs
- The value of SystemClock.elapsedRealtime()
when the load ended.loadDurationMs
- The duration of the load.bytesLoaded
- The number of bytes that were loaded.void onLoadCanceled(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded)
dataSpec
- Defines the data being loaded.dataType
- One of the C
DATA_TYPE_*
constants defining the type of data
being loaded.trackType
- One of the C
TRACK_TYPE_*
constants if the data corresponds
to media of a specific type. C.TRACK_TYPE_UNKNOWN
otherwise.trackFormat
- The format of the track to which the data belongs. Null if the data does
not belong to a track.trackSelectionReason
- One of the C
SELECTION_REASON_*
constants if the
data belongs to a track. C.SELECTION_REASON_UNKNOWN
otherwise.trackSelectionData
- Optional data associated with the selection of the track to which the
data belongs. Null if the data does not belong to a track.mediaStartTimeMs
- The start time of the media being loaded, or C.TIME_UNSET
if
the load is not for media data.mediaEndTimeMs
- The end time of the media being loaded, or C.TIME_UNSET
if the
load is not for media data.elapsedRealtimeMs
- The value of SystemClock.elapsedRealtime()
when the load was
canceled.loadDurationMs
- The duration of the load up to the point at which it was canceled.bytesLoaded
- The number of bytes that were loaded prior to cancelation.void onLoadError(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded, IOException error, boolean wasCanceled)
The error may or may not have resulted in the load being canceled, as indicated by the
wasCanceled
parameter. If the load was canceled, onLoadCanceled(com.google.android.exoplayer2.upstream.DataSpec, int, int, com.google.android.exoplayer2.Format, int, java.lang.Object, long, long, long, long, long)
will
not be called in addition to this method.
dataSpec
- Defines the data being loaded.dataType
- One of the C
DATA_TYPE_*
constants defining the type of data
being loaded.trackType
- One of the C
TRACK_TYPE_*
constants if the data corresponds
to media of a specific type. C.TRACK_TYPE_UNKNOWN
otherwise.trackFormat
- The format of the track to which the data belongs. Null if the data does
not belong to a track.trackSelectionReason
- One of the C
SELECTION_REASON_*
constants if the
data belongs to a track. C.SELECTION_REASON_UNKNOWN
otherwise.trackSelectionData
- Optional data associated with the selection of the track to which the
data belongs. Null if the data does not belong to a track.mediaStartTimeMs
- The start time of the media being loaded, or C.TIME_UNSET
if
the load is not for media data.mediaEndTimeMs
- The end time of the media being loaded, or C.TIME_UNSET
if the
load is not for media data.elapsedRealtimeMs
- The value of SystemClock.elapsedRealtime()
when the error
occurred.loadDurationMs
- The duration of the load up to the point at which the error occurred.bytesLoaded
- The number of bytes that were loaded prior to the error.error
- The load error.wasCanceled
- Whether the load was canceled as a result of the error.void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs)
trackType
- The type of the media. One of the C
TRACK_TYPE_*
constants.mediaStartTimeMs
- The start time of the media being discarded.mediaEndTimeMs
- The end time of the media being discarded.void onDownstreamFormatChanged(int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaTimeMs)
SampleStream
s provided by the source changes).trackType
- The type of the media. One of the C
TRACK_TYPE_*
constants.trackFormat
- The format of the track to which the data belongs. Null if the data does
not belong to a track.trackSelectionReason
- One of the C
SELECTION_REASON_*
constants if the
data belongs to a track. C.SELECTION_REASON_UNKNOWN
otherwise.trackSelectionData
- Optional data associated with the selection of the track to which the
data belongs. Null if the data does not belong to a track.mediaTimeMs
- The media time at which the change occurred.