@UnstableApi
public interface MediaClock

Known direct subclasses
DecoderAudioRenderer

Decodes and renders audio using a Decoder.

FakeMediaClockRenderer

Fake abstract Renderer which is also a MediaClock.

MediaCodecAudioRenderer

Decodes and renders audio using MediaCodec and an AudioSink.

StandaloneMediaClock

A MediaClock whose position advances with real time based on the playback parameters when started.


Tracks the progression of media time.

Summary

Public methods

abstract PlaybackParameters

Returns the active playback parameters.

abstract long

Returns the current media position in microseconds.

default boolean

Returns whether there is a skipped silence since the last call to this method.

abstract void

Attempts to set the playback parameters.

Public methods

getPlaybackParameters

abstract PlaybackParameters getPlaybackParameters()

Returns the active playback parameters.

getPositionUs

abstract long getPositionUs()

Returns the current media position in microseconds.

hasSkippedSilenceSinceLastCall

default boolean hasSkippedSilenceSinceLastCall()

Returns whether there is a skipped silence since the last call to this method.

setPlaybackParameters

abstract void setPlaybackParameters(PlaybackParameters playbackParameters)

Attempts to set the playback parameters. The media clock may override the speed if changing the playback parameters is not supported.

Parameters
PlaybackParameters playbackParameters

The playback parameters to attempt to set.