Interface AnalyticsCollector
-
- All Superinterfaces:
BandwidthMeter.EventListener
,DrmSessionEventListener
,MediaSourceEventListener
,Player.Listener
- All Known Implementing Classes:
DefaultAnalyticsCollector
@Deprecated public interface AnalyticsCollector extends Player.Listener, MediaSourceEventListener, BandwidthMeter.EventListener, DrmSessionEventListener
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Interface for data collectors that forward analytics events toAnalyticsListeners
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.upstream.BandwidthMeter.EventListener
BandwidthMeter.EventListener.EventDispatcher
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.drm.DrmSessionEventListener
DrmSessionEventListener.EventDispatcher
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.MediaSourceEventListener
MediaSourceEventListener.EventDispatcher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addListener(AnalyticsListener listener)
Deprecated.Adds a listener for analytics events.void
notifySeekStarted()
Deprecated.Notify analytics collector that a seek operation will start.void
onAudioCodecError(Exception audioCodecError)
Deprecated.Called when an audio decoder encounters an error.void
onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a audio decoder is created.void
onAudioDecoderReleased(String decoderName)
Deprecated.Called when a audio decoder is released.void
onAudioDisabled(DecoderCounters counters)
Deprecated.Called when the audio renderer is disabled.void
onAudioEnabled(DecoderCounters counters)
Deprecated.Called when the audio renderer is enabled.void
onAudioInputFormatChanged(Format format, DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the audio renderer changes.void
onAudioPositionAdvancing(long playoutStartSystemTimeMs)
Deprecated.Called when the audio position has increased for the first time since the last pause or position reset.void
onAudioSinkError(Exception audioSinkError)
Deprecated.Called whenAudioSink
has encountered an error.void
onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Deprecated.Called when an audio underrun occurs.void
onDroppedFrames(int count, long elapsedMs)
Deprecated.Called to report the number of frames dropped by the video renderer.void
onRenderedFirstFrame(Object output, long renderTimeMs)
Deprecated.Called when a frame is rendered for the first time since setting the output, or since the renderer was reset, or since the stream being rendered was changed.void
onVideoCodecError(Exception videoCodecError)
Deprecated.Called when a video decoder encounters an error.void
onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a video decoder is created.void
onVideoDecoderReleased(String decoderName)
Deprecated.Called when a video decoder is released.void
onVideoDisabled(DecoderCounters counters)
Deprecated.Called when the video renderer is disabled.void
onVideoEnabled(DecoderCounters counters)
Deprecated.Called when the video renderer is enabled.void
onVideoFrameProcessingOffset(long totalProcessingOffsetUs, int frameCount)
Deprecated.Called to report the video processing offset of video frames processed by the video renderer.void
onVideoInputFormatChanged(Format format, DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the video renderer changes.void
release()
Deprecated.Releases the collector.void
removeListener(AnalyticsListener listener)
Deprecated.Removes a previously added analytics event listener.void
setPlayer(Player player, Looper looper)
Deprecated.Sets the player for which data will be collected.void
updateMediaPeriodQueueInfo(List<MediaSource.MediaPeriodId> queue, MediaSource.MediaPeriodId readingPeriod)
Deprecated.Updates the playback queue information used for event association.-
Methods inherited from interface com.google.android.exoplayer2.upstream.BandwidthMeter.EventListener
onBandwidthSample
-
Methods inherited from interface com.google.android.exoplayer2.drm.DrmSessionEventListener
onDrmKeysLoaded, onDrmKeysRemoved, onDrmKeysRestored, onDrmSessionAcquired, onDrmSessionAcquired, onDrmSessionManagerError, onDrmSessionReleased
-
Methods inherited from interface com.google.android.exoplayer2.source.MediaSourceEventListener
onDownstreamFormatChanged, onLoadCanceled, onLoadCompleted, onLoadError, onLoadStarted, onUpstreamDiscarded
-
Methods inherited from interface com.google.android.exoplayer2.Player.Listener
onAudioAttributesChanged, onAudioSessionIdChanged, onAvailableCommandsChanged, onCues, onCues, onDeviceInfoChanged, onDeviceVolumeChanged, onEvents, onIsLoadingChanged, onIsPlayingChanged, onLoadingChanged, onMaxSeekToPreviousPositionChanged, onMediaItemTransition, onMediaMetadataChanged, onMetadata, onPlaybackParametersChanged, onPlaybackStateChanged, onPlaybackSuppressionReasonChanged, onPlayerError, onPlayerErrorChanged, onPlayerStateChanged, onPlaylistMetadataChanged, onPlayWhenReadyChanged, onPositionDiscontinuity, onPositionDiscontinuity, onRenderedFirstFrame, onRepeatModeChanged, onSeekBackIncrementChanged, onSeekForwardIncrementChanged, onShuffleModeEnabledChanged, onSkipSilenceEnabledChanged, onSurfaceSizeChanged, onTimelineChanged, onTracksChanged, onTrackSelectionParametersChanged, onVideoSizeChanged, onVolumeChanged
-
-
-
-
Method Detail
-
addListener
void addListener(AnalyticsListener listener)
Deprecated.Adds a listener for analytics events.- Parameters:
listener
- The listener to add.
-
removeListener
void removeListener(AnalyticsListener listener)
Deprecated.Removes a previously added analytics event listener.- Parameters:
listener
- The listener to remove.
-
setPlayer
void setPlayer(Player player, Looper looper)
Deprecated.Sets the player for which data will be collected. Must only be called if no player has been set yet or the current player is idle.
-
release
void release()
Deprecated.Releases the collector. Must be called after the player for which data is collected has been released.
-
updateMediaPeriodQueueInfo
void updateMediaPeriodQueueInfo(List<MediaSource.MediaPeriodId> queue, @Nullable MediaSource.MediaPeriodId readingPeriod)
Deprecated.Updates the playback queue information used for event association.Should only be called by the player controlling the queue and not from app code.
- Parameters:
queue
- The playback queue of media periods identified by theirMediaSource.MediaPeriodId
.readingPeriod
- The media period in the queue that is currently being read by renderers, or null if the queue is empty.
-
notifySeekStarted
void notifySeekStarted()
Deprecated.Notify analytics collector that a seek operation will start. Should be called before the player adjusts its state and position to the seek.
-
onAudioEnabled
void onAudioEnabled(DecoderCounters counters)
Deprecated.Called when the audio renderer is enabled.- Parameters:
counters
-DecoderCounters
that will be updated by the audio renderer for as long as it remains enabled.
-
onAudioDecoderInitialized
void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a audio decoder is created.- Parameters:
decoderName
- The audio decoder that was created.initializedTimestampMs
-SystemClock.elapsedRealtime()
when initialization finished.initializationDurationMs
- The time taken to initialize the decoder in milliseconds.
-
onAudioInputFormatChanged
void onAudioInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the audio renderer changes.- Parameters:
format
- The new format.decoderReuseEvaluation
- The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, ornull
if the renderer did not have a decoder.
-
onAudioPositionAdvancing
void onAudioPositionAdvancing(long playoutStartSystemTimeMs)
Deprecated.Called when the audio position has increased for the first time since the last pause or position reset.- Parameters:
playoutStartSystemTimeMs
- The approximate derivedSystem.currentTimeMillis()
at which playout started.
-
onAudioUnderrun
void onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Deprecated.Called when an audio underrun occurs.- Parameters:
bufferSize
- The size of the audio output buffer, in bytes.bufferSizeMs
- The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio.C.TIME_UNSET
if the output buffer contains non-PCM encoded audio.elapsedSinceLastFeedMs
- The time since audio was last written to the output buffer.
-
onAudioDecoderReleased
void onAudioDecoderReleased(String decoderName)
Deprecated.Called when a audio decoder is released.- Parameters:
decoderName
- The audio decoder that was released.
-
onAudioDisabled
void onAudioDisabled(DecoderCounters counters)
Deprecated.Called when the audio renderer is disabled.- Parameters:
counters
-DecoderCounters
that were updated by the audio renderer.
-
onAudioSinkError
void onAudioSinkError(Exception audioSinkError)
Deprecated.Called whenAudioSink
has encountered an error.If the sink writes to a platform
AudioTrack
, this will be called for allAudioTrack
errors.- Parameters:
audioSinkError
- The error that occurred. Typically anAudioSink.InitializationException
, aAudioSink.WriteException
, or anAudioSink.UnexpectedDiscontinuityException
.
-
onAudioCodecError
void onAudioCodecError(Exception audioCodecError)
Deprecated.Called when an audio decoder encounters an error.- Parameters:
audioCodecError
- The error. Typically aMediaCodec.CodecException
if the renderer usesMediaCodec
, or aDecoderException
if the renderer uses a software decoder.
-
onVideoEnabled
void onVideoEnabled(DecoderCounters counters)
Deprecated.Called when the video renderer is enabled.- Parameters:
counters
-DecoderCounters
that will be updated by the video renderer for as long as it remains enabled.
-
onVideoDecoderInitialized
void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a video decoder is created.- Parameters:
decoderName
- The decoder that was created.initializedTimestampMs
-SystemClock.elapsedRealtime()
when initialization finished.initializationDurationMs
- The time taken to initialize the decoder in milliseconds.
-
onVideoInputFormatChanged
void onVideoInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the video renderer changes.- Parameters:
format
- The new format.decoderReuseEvaluation
- The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, ornull
if the renderer did not have a decoder.
-
onDroppedFrames
void onDroppedFrames(int count, long elapsedMs)
Deprecated.Called to report the number of frames dropped by the video renderer. Dropped frames are reported whenever the renderer is stopped having dropped frames, and optionally, whenever the count reaches a specified threshold whilst the renderer is started.- Parameters:
count
- The number of dropped frames.elapsedMs
- The duration in milliseconds over which the frames were dropped. This duration is timed from when the renderer was started or from when dropped frames were last reported (whichever was more recent), and not from when the first of the reported drops occurred.
-
onVideoDecoderReleased
void onVideoDecoderReleased(String decoderName)
Deprecated.Called when a video decoder is released.- Parameters:
decoderName
- The video decoder that was released.
-
onVideoDisabled
void onVideoDisabled(DecoderCounters counters)
Deprecated.Called when the video renderer is disabled.- Parameters:
counters
-DecoderCounters
that were updated by the video renderer.
-
onRenderedFirstFrame
void onRenderedFirstFrame(Object output, long renderTimeMs)
Deprecated.Called when a frame is rendered for the first time since setting the output, or since the renderer was reset, or since the stream being rendered was changed.- Parameters:
output
- The output of the video renderer. Normally aSurface
, however some video renderers may have other output types (e.g., aVideoDecoderOutputBufferRenderer
).renderTimeMs
- TheSystemClock.elapsedRealtime()
when the frame was rendered.
-
onVideoFrameProcessingOffset
void onVideoFrameProcessingOffset(long totalProcessingOffsetUs, int frameCount)
Deprecated.Called to report the video processing offset of video frames processed by the video renderer.Video processing offset represents how early a video frame is processed compared to the player's current position. For each video frame, the offset is calculated as Pvf - Ppl where Pvf is the presentation timestamp of the video frame and Ppl is the current position of the player. Positive values indicate the frame was processed early enough whereas negative values indicate that the player's position had progressed beyond the frame's timestamp when the frame was processed (and the frame was probably dropped).
The renderer reports the sum of video processing offset samples (one sample per processed video frame: dropped, skipped or rendered) and the total number of samples.
- Parameters:
totalProcessingOffsetUs
- The sum of all video frame processing offset samples for the video frames processed by the renderer in microseconds.frameCount
- The number of samples included in thetotalProcessingOffsetUs
.
-
onVideoCodecError
void onVideoCodecError(Exception videoCodecError)
Deprecated.Called when a video decoder encounters an error.This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry.
Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException)
is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.- Parameters:
videoCodecError
- The error. Typically aMediaCodec.CodecException
if the renderer usesMediaCodec
, or aDecoderException
if the renderer uses a software decoder.
-
-