PlayerMessage.Target, Renderer, RendererCapabilitiesMediaCodecAudioRenderer, MediaCodecVideoRendererpublic abstract class MediaCodecRenderer extends BaseRenderer
MediaCodec to decode samples for rendering.| Modifier and Type | Class | Description |
|---|---|---|
static class |
MediaCodecRenderer.DecoderInitializationException |
Thrown when a failure occurs instantiating a decoder.
|
Renderer.State, Renderer.VideoScalingMode, Renderer.WakeupListenerRendererCapabilities.AdaptiveSupport, RendererCapabilities.Capabilities, RendererCapabilities.FormatSupport, RendererCapabilities.TunnelingSupport| Modifier and Type | Field | Description |
|---|---|---|
protected static float |
CODEC_OPERATING_RATE_UNSET |
Indicates no codec operating rate should be set.
|
protected DecoderCounters |
decoderCounters |
MSG_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 |
|---|---|
MediaCodecRenderer(int trackType,
MediaCodecAdapter.Factory codecAdapterFactory,
MediaCodecSelector mediaCodecSelector,
boolean enableDecoderFallback,
float assumedMinimumCodecOperatingRate) |
| Modifier and Type | Method | Description |
|---|---|---|
protected DecoderReuseEvaluation |
canReuseCodec(MediaCodecInfo codecInfo,
Format oldFormat,
Format newFormat) |
Evaluates whether the existing
MediaCodec can be kept for a new Format, and if
it can whether it requires reconfiguration. |
protected abstract void |
configureCodec(MediaCodecInfo codecInfo,
MediaCodecAdapter codec,
Format format,
MediaCrypto crypto,
float codecOperatingRate) |
Configures a newly created
MediaCodec. |
protected MediaCodecDecoderException |
createDecoderException(Throwable cause,
MediaCodecInfo codecInfo) |
|
void |
experimentalSetAsynchronousBufferQueueingEnabled(boolean enabled) |
Enable asynchronous input buffer queueing.
|
void |
experimentalSetForceAsyncQueueingSynchronizationWorkaround(boolean enabled) |
Enable the asynchronous queueing synchronization workaround.
|
void |
experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(boolean enabled) |
Enable synchronizing codec interactions with asynchronous buffer queueing.
|
protected boolean |
flushOrReinitializeCodec() |
Flushes the codec.
|
protected boolean |
flushOrReleaseCodec() |
Flushes the codec.
|
protected MediaCodecAdapter |
getCodec() |
|
protected MediaCodecInfo |
getCodecInfo() |
|
protected boolean |
getCodecNeedsEosPropagation() |
Returns whether the codec needs the renderer to propagate the end-of-stream signal directly,
rather than by using an end-of-stream buffer queued to the codec.
|
protected float |
getCodecOperatingRate() |
Returns the operating rate used by the current codec
|
protected float |
getCodecOperatingRateV23(float targetPlaybackSpeed,
Format format,
Format[] streamFormats) |
Returns the
MediaFormat.KEY_OPERATING_RATE value for a given playback speed, current
Format and set of possible stream formats. |
protected MediaFormat |
getCodecOutputMediaFormat() |
|
protected abstract List<MediaCodecInfo> |
getDecoderInfos(MediaCodecSelector mediaCodecSelector,
Format format,
boolean requiresSecureDecoder) |
Returns a list of decoders that can decode media in the specified format, in priority order.
|
protected long |
getOutputStreamOffsetUs() |
Returns the offset that should be subtracted from
bufferPresentationTimeUs in processOutputBuffer(long, long, MediaCodecAdapter, ByteBuffer, int, int, int, long, boolean,
boolean, Format) to get the playback position with respect to the media. |
protected float |
getPlaybackSpeed() |
Returns the current playback speed, as set by
setPlaybackSpeed(float, float). |
protected void |
handleInputBufferSupplementalData(DecoderInputBuffer buffer) |
Handles supplemental data associated with an input buffer.
|
boolean |
isEnded() |
Whether the renderer is ready for the
ExoPlayer instance to transition to Player.STATE_ENDED. |
boolean |
isReady() |
Whether the renderer is able to immediately render media from the current position.
|
protected boolean |
legacyKeepAvailableCodecInfosWithoutCodec() |
Returns whether to keep available codec infos when the codec hasn't been initialized, which is
the behavior before a bug fix.
|
protected void |
maybeInitCodecOrBypass() |
|
protected void |
onCodecInitialized(String name,
long initializedTimestampMs,
long initializationDurationMs) |
Called when a
MediaCodec has been created and configured. |
protected void |
onCodecReleased(String name) |
Called when a
MediaCodec has been released. |
protected void |
onDisabled() |
Called when the renderer is disabled.
|
protected void |
onEnabled(boolean joining,
boolean mayRenderStartOfStream) |
Called when the renderer is enabled.
|
protected DecoderReuseEvaluation |
onInputFormatChanged(FormatHolder formatHolder) |
Called when a new
Format is read from the upstream MediaPeriod. |
protected void |
onOutputFormatChanged(Format format,
MediaFormat mediaFormat) |
Called when one of the output formats changes.
|
protected void |
onPositionReset(long positionUs,
boolean joining) |
Called when the position is reset.
|
protected void |
onProcessedOutputBuffer(long presentationTimeUs) |
Called when an output buffer is successfully processed.
|
protected void |
onProcessedStreamChange() |
Called after the last output buffer before a stream change has been processed.
|
protected void |
onQueueInputBuffer(DecoderInputBuffer buffer) |
Called immediately before an input buffer is queued into the codec.
|
protected void |
onReset() |
Called when the renderer is reset.
|
protected void |
onStarted() |
Called when the renderer is started.
|
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 abstract boolean |
processOutputBuffer(long positionUs,
long elapsedRealtimeUs,
MediaCodecAdapter codec,
ByteBuffer buffer,
int bufferIndex,
int bufferFlags,
int sampleCount,
long bufferPresentationTimeUs,
boolean isDecodeOnlyBuffer,
boolean isLastBuffer,
Format format) |
Processes an output media buffer.
|
protected void |
releaseCodec() |
|
void |
render(long positionUs,
long elapsedRealtimeUs) |
Incrementally renders the
SampleStream. |
protected void |
renderToEndOfStream() |
Incrementally renders any remaining output.
|
protected void |
resetCodecStateForFlush() |
Resets the renderer internal state after a codec flush.
|
protected void |
resetCodecStateForRelease() |
Resets the renderer internal state after a codec release.
|
protected void |
setPendingOutputEndOfStream() |
Notifies the renderer that output end of stream is pending and should be handled on the next
render.
|
protected void |
setPendingPlaybackException(ExoPlaybackException exception) |
Sets an exception to be re-thrown by render.
|
void |
setPlaybackSpeed(float currentPlaybackSpeed,
float targetPlaybackSpeed) |
Indicates the playback speed to this renderer.
|
void |
setRenderTimeLimitMs(long renderTimeLimitMs) |
Set a limit on the time a single
render(long, long) call can spend draining and
filling the decoder. |
protected boolean |
shouldInitCodec(MediaCodecInfo codecInfo) |
|
protected boolean |
shouldUseBypass(Format format) |
Returns whether buffers in the input format can be processed without a codec.
|
int |
supportsFormat(Format format) |
Returns the extent to which the
Renderer supports a given format. |
protected abstract int |
supportsFormat(MediaCodecSelector mediaCodecSelector,
Format format) |
Returns the
RendererCapabilities.Capabilities for the given Format. |
protected static boolean |
supportsFormatDrm(Format format) |
Returns whether this renderer supports the given
Format's DRM scheme. |
int |
supportsMixedMimeTypeAdaptation() |
Returns the extent to which the
Renderer supports adapting between supported formats
that have different MIME types. |
protected void |
updateOutputFormatForTime(long presentationTimeUs) |
Updates the output formats for the specified output buffer timestamp, calling
onOutputFormatChanged(com.google.android.exoplayer2.Format, android.media.MediaFormat) if a change has occurred. |
createRendererException, createRendererException, disable, enable, getCapabilities, getConfiguration, getFormatHolder, getIndex, getLastResetPositionUs, getMediaClock, getReadingPositionUs, getState, getStream, getStreamFormats, getTrackType, handleMessage, hasReadStreamToEnd, isCurrentStreamFinal, isSourceReady, maybeThrowStreamError, readSource, replaceStream, reset, resetPosition, setCurrentStreamFinal, setIndex, skipSource, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNameprotected static final float CODEC_OPERATING_RATE_UNSET
protected DecoderCounters decoderCounters
public MediaCodecRenderer(int trackType,
MediaCodecAdapter.Factory codecAdapterFactory,
MediaCodecSelector mediaCodecSelector,
boolean enableDecoderFallback,
float assumedMinimumCodecOperatingRate)
trackType - The track type that the renderer handles. One of the C.TRACK_TYPE_*
constants defined in C.mediaCodecSelector - A decoder selector.enableDecoderFallback - Whether to enable fallback to lower-priority decoders if decoder
initialization fails. This may result in using a decoder that is less efficient or slower
than the primary decoder.assumedMinimumCodecOperatingRate - A codec operating rate that all codecs instantiated by
this renderer are assumed to meet implicitly (i.e. without the operating rate being set
explicitly using MediaFormat.KEY_OPERATING_RATE).public void setRenderTimeLimitMs(long renderTimeLimitMs)
render(long, long) call can spend draining and
filling the decoder.
This method should be called right after creating an instance of this class.
renderTimeLimitMs - The render time limit in milliseconds, or C.TIME_UNSET for no
limit.public void experimentalSetAsynchronousBufferQueueingEnabled(boolean enabled)
Operates the underlying MediaCodec in asynchronous mode and submits input buffers
from a separate thread to unblock the playback thread.
This method is experimental, and will be renamed or removed in a future release. It should only be called before the renderer is used.
public void experimentalSetForceAsyncQueueingSynchronizationWorkaround(boolean enabled)
When enabled, the queueing threads for MediaCodec instance will synchronize on a
shared lock when submitting buffers to the respective MediaCodec.
This method is experimental, and will be renamed or removed in a future release. It should only be called before the renderer is used.
public void experimentalSetSynchronizeCodecInteractionsWithQueueingEnabled(boolean enabled)
When enabled, codec interactions will wait until all input buffers pending for asynchronous
queueing are submitted to the MediaCodec first. This method is effective only if asynchronous buffer queueing is enabled.
This method is experimental, and will be renamed or removed in a future release. It should only be called before the renderer is used.
@AdaptiveSupport public final int supportsMixedMimeTypeAdaptation()
RendererCapabilitiesRenderer supports adapting between supported formats
that have different MIME types.supportsMixedMimeTypeAdaptation in interface RendererCapabilitiessupportsMixedMimeTypeAdaptation in class BaseRendererRendererCapabilities.AdaptiveSupport for adapting between supported formats that have different
MIME types.@Capabilities public final int supportsFormat(Format format) throws ExoPlaybackException
RendererCapabilitiesRenderer supports a given format.format - The format.RendererCapabilities.Capabilities for this format.ExoPlaybackException - If an error occurs.@Capabilities protected abstract int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) throws MediaCodecUtil.DecoderQueryException
RendererCapabilities.Capabilities for the given Format.mediaCodecSelector - The decoder selector.format - The Format.RendererCapabilities.Capabilities for this Format.MediaCodecUtil.DecoderQueryException - If there was an error querying decoders.protected abstract List<MediaCodecInfo> getDecoderInfos(MediaCodecSelector mediaCodecSelector, Format format, boolean requiresSecureDecoder) throws MediaCodecUtil.DecoderQueryException
mediaCodecSelector - The decoder selector.format - The Format for which a decoder is required.requiresSecureDecoder - Whether a secure decoder is required.MediaCodecInfos corresponding to decoders. May be empty.MediaCodecUtil.DecoderQueryException - Thrown if there was an error querying decoders.protected abstract void configureCodec(MediaCodecInfo codecInfo, MediaCodecAdapter codec, Format format, @Nullable MediaCrypto crypto, float codecOperatingRate)
MediaCodec.codecInfo - Information about the MediaCodec being configured.codec - The MediaCodecAdapter to configure.format - The Format for which the codec is being configured.crypto - For drm protected playbacks, a MediaCrypto to use for decryption.codecOperatingRate - The codec operating rate, or CODEC_OPERATING_RATE_UNSET if
no codec operating rate should be set.protected final void maybeInitCodecOrBypass()
throws ExoPlaybackException
ExoPlaybackExceptionprotected boolean shouldUseBypass(Format format)
This method is only called if the content is not DRM protected, because if the content is DRM protected use of bypass is never possible.
format - The input Format.MediaCodec is supported.protected boolean shouldInitCodec(MediaCodecInfo codecInfo)
protected boolean getCodecNeedsEosPropagation()
protected final void setPendingPlaybackException(ExoPlaybackException exception)
exception - The exception.protected final void updateOutputFormatForTime(long presentationTimeUs)
throws ExoPlaybackException
onOutputFormatChanged(com.google.android.exoplayer2.Format, android.media.MediaFormat) if a change has occurred.
Subclasses should only call this method if operating in a mode where buffers are not dequeued from the decoder, for example when using video tunneling).
ExoPlaybackException - Thrown if an error occurs as a result of the output format change.@Nullable protected final MediaCodecAdapter getCodec()
@Nullable protected final MediaFormat getCodecOutputMediaFormat()
@Nullable protected final MediaCodecInfo getCodecInfo()
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 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 BaseRendererpositionUs - The new playback position in microseconds.joining - Whether this renderer is being enabled to join an ongoing playback.ExoPlaybackException - If an error occurs.public void setPlaybackSpeed(float currentPlaybackSpeed,
float targetPlaybackSpeed)
throws ExoPlaybackException
RendererThe default implementation is a no-op.
currentPlaybackSpeed - The factor by which playback is currently sped up.targetPlaybackSpeed - The target factor by which playback should be sped up. This may be
different from currentPlaybackSpeed, for example, if the speed is temporarily
adjusted for live playback.ExoPlaybackException - If an error occurs handling the playback speed.protected void onDisabled()
BaseRendererThe default implementation is a no-op.
onDisabled in class BaseRendererprotected void onReset()
BaseRendererThe default implementation is a no-op.
onReset in class BaseRendererprotected void releaseCodec()
protected void onStarted()
BaseRendererThe default implementation is a no-op.
onStarted in class BaseRendererprotected void onStopped()
BaseRendererThe default implementation is a no-op.
onStopped in class BaseRendererpublic void render(long positionUs,
long elapsedRealtimeUs)
throws ExoPlaybackException
RendererSampleStream.
If the renderer is in the Renderer.STATE_ENABLED state then each call to this method will do
work toward being ready to render the SampleStream when the renderer is started. If the
renderer is in the Renderer.STATE_STARTED state then calls to this method will render the
SampleStream in sync with the specified media positions.
The renderer may also render the very start of the media at the current position (e.g. the
first frame of a video stream) while still in the Renderer.STATE_ENABLED state, unless it's the
initial start of the media after calling Renderer.enable(RendererConfiguration, Format[],
SampleStream, long, boolean, boolean, long, long) with mayRenderStartOfStream set to
false.
This method should return quickly, and should not block if the renderer is unable to make useful progress.
This method may be called when the renderer is in the following states: Renderer.STATE_ENABLED, Renderer.STATE_STARTED.
positionUs - The current media time in microseconds, measured at the start of the current
iteration of the rendering loop.elapsedRealtimeUs - SystemClock.elapsedRealtime() in microseconds,
measured at the start of the current iteration of the rendering loop.ExoPlaybackException - If an error occurs.protected final boolean flushOrReinitializeCodec()
throws ExoPlaybackException
null.
The implementation of this method calls flushOrReleaseCodec(), and maybeInitCodecOrBypass() if the codec needs to be re-instantiated.
ExoPlaybackException - If an error occurs re-instantiating the codec.protected boolean flushOrReleaseCodec()
null.@CallSuper protected void resetCodecStateForFlush()
@CallSuper protected void resetCodecStateForRelease()
Note that this only needs to reset state variables that are changed in addition to those
already changed in resetCodecStateForFlush().
protected MediaCodecDecoderException createDecoderException(Throwable cause, @Nullable MediaCodecInfo codecInfo)
protected void onCodecInitialized(String name, long initializedTimestampMs, long initializationDurationMs)
MediaCodec has been created and configured.
The default implementation is a no-op.
name - The name of the codec that was initialized.initializedTimestampMs - SystemClock.elapsedRealtime() when initialization
finished.initializationDurationMs - The time taken to initialize the codec in milliseconds.protected void onCodecReleased(String name)
MediaCodec has been released.
The default implementation is a no-op.
name - The name of the codec that was released.@CallSuper @Nullable protected DecoderReuseEvaluation onInputFormatChanged(FormatHolder formatHolder) throws ExoPlaybackException
Format is read from the upstream MediaPeriod.formatHolder - A FormatHolder that holds the new Format.null if the renderer did not have a decoder.ExoPlaybackException - If an error occurs re-initializing the MediaCodec.protected boolean legacyKeepAvailableCodecInfosWithoutCodec()
protected void onOutputFormatChanged(Format format, @Nullable MediaFormat mediaFormat) throws ExoPlaybackException
The default implementation is a no-op.
format - The input Format to which future output now corresponds. If the renderer
is in bypass mode, this is also the output format.mediaFormat - The codec output MediaFormat, or null if the renderer is in
bypass mode.ExoPlaybackException - Thrown if an error occurs configuring the output.protected void handleInputBufferSupplementalData(DecoderInputBuffer buffer) throws ExoPlaybackException
The default implementation is a no-op.
buffer - The input buffer that is about to be queued.ExoPlaybackException - Thrown if an error occurs handling supplemental data.protected void onQueueInputBuffer(DecoderInputBuffer buffer) throws ExoPlaybackException
The default implementation is a no-op.
buffer - The buffer to be queued.ExoPlaybackException - Thrown if an error occurs handling the input buffer.@CallSuper protected void onProcessedOutputBuffer(long presentationTimeUs)
presentationTimeUs - The timestamp associated with the output buffer.protected void onProcessedStreamChange()
protected DecoderReuseEvaluation canReuseCodec(MediaCodecInfo codecInfo, Format oldFormat, Format newFormat)
MediaCodec can be kept for a new Format, and if
it can whether it requires reconfiguration.
The default implementation does not allow decoder reuse.
codecInfo - A MediaCodecInfo describing the decoder.oldFormat - The Format for which the existing instance is configured.newFormat - The new Format.public boolean isEnded()
RendererExoPlayer instance to transition to Player.STATE_ENDED. The player will make this transition as soon as true is returned
by all of its renderers.
This method may be called when the renderer is in the following states: Renderer.STATE_ENABLED, Renderer.STATE_STARTED.
public boolean isReady()
Renderer
If the renderer is in the Renderer.STATE_STARTED state then returning true indicates that the
renderer has everything that it needs to continue playback. Returning false indicates that
the player should pause until the renderer is ready.
If the renderer is in the Renderer.STATE_ENABLED state then returning true indicates that the
renderer is ready for playback to be started. Returning false indicates that it is not.
This method may be called when the renderer is in the following states:
Renderer.STATE_ENABLED, Renderer.STATE_STARTED.
protected float getPlaybackSpeed()
setPlaybackSpeed(float, float).protected float getCodecOperatingRate()
protected float getCodecOperatingRateV23(float targetPlaybackSpeed,
Format format,
Format[] streamFormats)
MediaFormat.KEY_OPERATING_RATE value for a given playback speed, current
Format and set of possible stream formats.
The default implementation returns CODEC_OPERATING_RATE_UNSET.
targetPlaybackSpeed - The target factor by which playback should be sped up. This may be
different from the current playback speed, for example, if the speed is temporarily
adjusted for live playback.format - The Format for which the codec is being configured.streamFormats - The possible stream formats.CODEC_OPERATING_RATE_UNSET if no codec operating
rate should be set.protected abstract boolean processOutputBuffer(long positionUs,
long elapsedRealtimeUs,
@Nullable
MediaCodecAdapter codec,
@Nullable
ByteBuffer buffer,
int bufferIndex,
int bufferFlags,
int sampleCount,
long bufferPresentationTimeUs,
boolean isDecodeOnlyBuffer,
boolean isLastBuffer,
Format format)
throws ExoPlaybackException
When a new ByteBuffer is passed to this method its position and limit delineate the
data to be processed. The return value indicates whether the buffer was processed in full. If
true is returned then the next call to this method will receive a new buffer to be processed.
If false is returned then the same buffer will be passed to the next call. An implementation of
this method is free to modify the buffer and can assume that the buffer will not be externally
modified between successive calls. Hence an implementation can, for example, modify the
buffer's position to keep track of how much of the data it has processed.
Note that the first call to this method following a call to onPositionReset(long,
boolean) will always receive a new ByteBuffer to be processed.
positionUs - The current media time in microseconds, measured at the start of the current
iteration of the rendering loop.elapsedRealtimeUs - SystemClock.elapsedRealtime() in microseconds, measured at the
start of the current iteration of the rendering loop.codec - The MediaCodecAdapter instance, or null in bypass mode were no codec is
used.buffer - The output buffer to process, or null if the buffer data is not made available to
the application layer (see MediaCodec.getOutputBuffer(int)). This buffer
can only be null for video data. Note that the buffer data can still be rendered in this
case by using the bufferIndex.bufferIndex - The index of the output buffer.bufferFlags - The flags attached to the output buffer.sampleCount - The number of samples extracted from the sample queue in the buffer. This
allows handling multiple samples as a batch for efficiency.bufferPresentationTimeUs - The presentation time of the output buffer in microseconds.isDecodeOnlyBuffer - Whether the buffer was marked with C.BUFFER_FLAG_DECODE_ONLY
by the source.isLastBuffer - Whether the buffer is the last sample of the current stream.format - The Format associated with the buffer.ExoPlaybackException - If an error occurs processing the output buffer.protected void renderToEndOfStream()
throws ExoPlaybackException
The default implementation is a no-op.
ExoPlaybackException - Thrown if an error occurs rendering remaining output.protected final void setPendingOutputEndOfStream()
protected final long getOutputStreamOffsetUs()
bufferPresentationTimeUs in processOutputBuffer(long, long, MediaCodecAdapter, ByteBuffer, int, int, int, long, boolean,
boolean, Format) to get the playback position with respect to the media.