public final class LibopusAudioRenderer extends SimpleDecoderAudioRenderer
STATE_DISABLED, STATE_ENABLED, STATE_STARTEDADAPTIVE_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 and Description |
|---|
LibopusAudioRenderer() |
LibopusAudioRenderer(Handler eventHandler,
AudioRendererEventListener eventListener,
AudioProcessor... audioProcessors) |
LibopusAudioRenderer(Handler eventHandler,
AudioRendererEventListener eventListener,
DrmSessionManager<ExoMediaCrypto> drmSessionManager,
boolean playClearSamplesWithoutKeys,
AudioProcessor... audioProcessors) |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.android.exoplayer2.ext.opus.OpusDecoder |
createDecoder(Format format,
ExoMediaCrypto mediaCrypto)
Creates a decoder for the given format.
|
protected Format |
getOutputFormat()
Returns the format of audio buffers output by the decoder.
|
protected int |
supportsFormatInternal(Format format)
Returns the
RendererCapabilities.FORMAT_SUPPORT_MASK component of the return value for
SimpleDecoderAudioRenderer.supportsFormat(Format). |
getMediaClock, getPlaybackParameters, getPositionUs, handleMessage, isEnded, isReady, onAudioSessionId, onAudioTrackPositionDiscontinuity, onAudioTrackUnderrun, onDisabled, onEnabled, onPositionReset, onStarted, onStopped, render, setPlaybackParameters, supportsFormatdisable, enable, getCapabilities, getConfiguration, getIndex, getState, getStream, getTrackType, hasReadStreamToEnd, isCurrentStreamFinal, isSourceReady, maybeThrowStreamError, onStreamChanged, readSource, replaceStream, resetPosition, setCurrentStreamFinal, setIndex, skipSource, start, stop, supportsMixedMimeTypeAdaptationpublic LibopusAudioRenderer()
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener, AudioProcessor... audioProcessors)
eventHandler - A handler to use when delivering events to eventListener. May be
null if delivery of events is not required.eventListener - A listener of events. May be null if delivery of events is not required.audioProcessors - Optional AudioProcessors that will process audio before output.public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener, DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys, AudioProcessor... audioProcessors)
eventHandler - A handler to use when delivering events to eventListener. May be
null if delivery of events is not required.eventListener - A listener of events. May be null if delivery of events is not required.drmSessionManager - For use with encrypted media. May be null if support for encrypted
media is not required.playClearSamplesWithoutKeys - Encrypted media may contain clear (un-encrypted) regions.
For example a media file may start with a short clear region so as to allow playback to
begin in parallel with key acquisition. This parameter specifies whether the renderer is
permitted to play clear regions of encrypted media files before drmSessionManager
has obtained the keys necessary to decrypt encrypted regions of the media.audioProcessors - Optional AudioProcessors that will process audio before output.protected int supportsFormatInternal(Format format)
SimpleDecoderAudioRendererRendererCapabilities.FORMAT_SUPPORT_MASK component of the return value for
SimpleDecoderAudioRenderer.supportsFormat(Format).supportsFormatInternal in class SimpleDecoderAudioRendererformat - The format.protected com.google.android.exoplayer2.ext.opus.OpusDecoder createDecoder(Format format, ExoMediaCrypto mediaCrypto) throws OpusDecoderException
SimpleDecoderAudioRenderercreateDecoder in class SimpleDecoderAudioRendererformat - The format for which a decoder is required.mediaCrypto - The ExoMediaCrypto object required for decoding encrypted content.
Maybe null and can be ignored if decoder does not handle encrypted content.OpusDecoderExceptionprotected Format getOutputFormat()
SimpleDecoderAudioRendererThe default implementation returns a 16-bit PCM format with the same channel count and sample rate as the input.
getOutputFormat in class SimpleDecoderAudioRenderer