PlayerMessage.Target, Renderer, RendererCapabilitiespublic class FakeVideoRenderer extends FakeRenderer
FakeRenderer that supports C.TRACK_TYPE_VIDEO.Renderer.State, Renderer.VideoScalingMode, Renderer.WakeupListenerRendererCapabilities.AdaptiveSupport, RendererCapabilities.Capabilities, RendererCapabilities.FormatSupport, RendererCapabilities.TunnelingSupportisEnded, positionResetCount, sampleBufferReadCountMSG_CUSTOM_BASE, MSG_SET_AUDIO_ATTRIBUTES, MSG_SET_AUDIO_SESSION_ID, MSG_SET_AUX_EFFECT_INFO, MSG_SET_CAMERA_MOTION_LISTENER, MSG_SET_SCALING_MODE, MSG_SET_SKIP_SILENCE_ENABLED, MSG_SET_SURFACE, MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER, MSG_SET_VIDEO_FRAME_METADATA_LISTENER, MSG_SET_VOLUME, MSG_SET_WAKEUP_LISTENER, STATE_DISABLED, STATE_ENABLED, STATE_STARTED, VIDEO_SCALING_MODE_DEFAULT, VIDEO_SCALING_MODE_SCALE_TO_FIT, VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPINGADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED, ADAPTIVE_SEAMLESS, ADAPTIVE_SUPPORT_MASK, FORMAT_EXCEEDS_CAPABILITIES, FORMAT_HANDLED, FORMAT_SUPPORT_MASK, FORMAT_UNSUPPORTED_DRM, FORMAT_UNSUPPORTED_SUBTYPE, FORMAT_UNSUPPORTED_TYPE, TUNNELING_NOT_SUPPORTED, TUNNELING_SUPPORT_MASK, TUNNELING_SUPPORTED| Constructor | Description |
|---|---|
FakeVideoRenderer(Handler handler,
VideoRendererEventListener eventListener) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
onDisabled() |
Called when the renderer is disabled.
|
protected void |
onEnabled(boolean joining,
boolean mayRenderStartOfStream) |
Called when the renderer is enabled.
|
protected void |
onFormatChanged(Format format) |
Called when the renderer reads a new format.
|
protected void |
onPositionReset(long positionUs,
boolean joining) |
Called when the position is reset.
|
protected void |
onStopped() |
Called when the renderer is stopped.
|
protected void |
onStreamChanged(Format[] formats,
long startPositionUs,
long offsetUs) |
Called when the renderer's stream has changed.
|
protected boolean |
shouldProcessBuffer(long bufferTimeUs,
long playbackPositionUs) |
Called before the renderer processes a buffer.
|
createRendererException, createRendererException, disable, enable, getCapabilities, getConfiguration, getFormatHolder, getIndex, getLastResetPositionUs, getMediaClock, getReadingPositionUs, getState, getStream, getStreamFormats, getTrackType, handleMessage, hasReadStreamToEnd, isCurrentStreamFinal, isSourceReady, maybeThrowStreamError, onReset, onStarted, readSource, replaceStream, reset, resetPosition, setCurrentStreamFinal, setIndex, skipSource, start, stop, supportsMixedMimeTypeAdaptationgetFormatsRead, getName, isEnded, isReady, render, supportsFormatclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetPlaybackSpeedpublic FakeVideoRenderer(Handler handler, VideoRendererEventListener eventListener)
protected void onEnabled(boolean joining,
boolean mayRenderStartOfStream)
throws ExoPlaybackException
BaseRendererThe default implementation is a no-op.
onEnabled in class BaseRendererjoining - Whether this renderer is being enabled to join an ongoing playback.mayRenderStartOfStream - Whether this renderer is allowed to render the start of the
stream even if the state is not Renderer.STATE_STARTED yet.ExoPlaybackException - If an error occurs.protected void onStreamChanged(Format[] formats, long startPositionUs, long offsetUs) throws ExoPlaybackException
BaseRendererBaseRenderer.onEnabled(boolean, boolean) has been called, and also when the stream has been
replaced whilst the renderer is enabled or started.
The default implementation is a no-op.
onStreamChanged in class BaseRendererformats - The enabled formats.startPositionUs - The start position of the new stream in renderer time (microseconds).offsetUs - The offset that will be added to the timestamps of buffers read via BaseRenderer.readSource(FormatHolder, DecoderInputBuffer, boolean) so that decoder input buffers have
monotonically increasing timestamps.ExoPlaybackException - If an error occurs.protected void onStopped()
BaseRendererThe default implementation is a no-op.
onStopped in class BaseRendererprotected void onDisabled()
BaseRendererThe default implementation is a no-op.
onDisabled in class FakeRendererprotected void onPositionReset(long positionUs,
boolean joining)
throws ExoPlaybackException
BaseRendererBaseRenderer.onStreamChanged(Format[], long, long) has been called, and also when a position discontinuity
is encountered.
After a position reset, the renderer's SampleStream is guaranteed to provide samples
starting from a key frame.
The default implementation is a no-op.
onPositionReset in class FakeRendererpositionUs - The new playback position in microseconds.joining - Whether this renderer is being enabled to join an ongoing playback.ExoPlaybackException - If an error occurs.protected void onFormatChanged(Format format)
FakeRendereronFormatChanged in class FakeRendererprotected boolean shouldProcessBuffer(long bufferTimeUs,
long playbackPositionUs)
FakeRenderershouldProcessBuffer in class FakeRendererbufferTimeUs - The buffer timestamp, in microseconds.playbackPositionUs - The playback position, in microseconds