Package com.google.android.exoplayer2.ext.ffmpeg

## Class FfmpegAudioRenderer

- java.lang.Object
- - com.google.android.exoplayer2.BaseRenderer
  - - com.google.android.exoplayer2.audio.DecoderAudioRenderer<com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder>
    - - com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioRenderer

- All Implemented Interfaces:
    `PlayerMessage.Target`, `Renderer`, `RendererCapabilities`, `MediaClock`

      public final class FfmpegAudioRenderer
      extends DecoderAudioRenderer<com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder>

  Decodes and renders audio using FFmpeg.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Renderer

      `Renderer.State, Renderer.VideoScalingMode, Renderer.WakeupListener`

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.RendererCapabilities

      `RendererCapabilities.AdaptiveSupport, RendererCapabilities.Capabilities, RendererCapabilities.FormatSupport, RendererCapabilities.TunnelingSupport`

  - ### Field Summary

    - ### Fields inherited from interface com.google.android.exoplayer2.Renderer

      `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_VIDEO_FRAME_METADATA_LISTENER, MSG_SET_VIDEO_OUTPUT, 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_CROPPING`

    - ### Fields inherited from interface com.google.android.exoplayer2.RendererCapabilities

      `ADAPTIVE_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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `FfmpegAudioRenderer()` |
    `FfmpegAudioRenderer​(Handler eventHandler, AudioRendererEventListener eventListener, AudioProcessor... audioProcessors)` | Creates a new instance.
    `FfmpegAudioRenderer​(Handler eventHandler, AudioRendererEventListener eventListener, AudioSink audioSink)` | Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder` | `createDecoder​(Format format, ExoMediaCrypto mediaCrypto)` | Creates a decoder for the given format.
    `String` | `getName()` | Returns the name of this renderer, for logging and debugging purposes.
    `Format` | `getOutputFormat​(com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder decoder)` | Returns the format of audio buffers output by the decoder.
    `protected int` | `supportsFormatInternal​(Format format)` | Returns the `C.FormatSupport` for the given `Format`.
    `int` | `supportsMixedMimeTypeAdaptation()` | Returns the extent to which the `Renderer` supports adapting between supported formats that have different MIME types.

    - ### Methods inherited from class com.google.android.exoplayer2.audio.DecoderAudioRenderer

      `canReuseDecoder, experimentalSetEnableKeepAudioTrackOnSeek, getMediaClock, getPlaybackParameters, getPositionUs, getSinkFormatSupport, handleMessage, isEnded, isReady, onDisabled, onEnabled, onPositionDiscontinuity, onPositionReset, onQueueInputBuffer, onStarted, onStopped, render, setPlaybackParameters, sinkSupportsFormat, supportsFormat`

    - ### Methods inherited from class com.google.android.exoplayer2.BaseRenderer

      `createRendererException, createRendererException, disable, enable, getCapabilities, getConfiguration, getFormatHolder, getIndex, getLastResetPositionUs, getReadingPositionUs, getState, getStream, getStreamFormats, getTrackType, hasReadStreamToEnd, isCurrentStreamFinal, isSourceReady, maybeThrowStreamError, onReset, onStreamChanged, readSource, replaceStream, reset, resetPosition, setCurrentStreamFinal, setIndex, skipSource, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.android.exoplayer2.Renderer

      `setPlaybackSpeed`

- - ### Constructor Detail

    - #### FfmpegAudioRenderer

          public FfmpegAudioRenderer()

    - #### FfmpegAudioRenderer

          public FfmpegAudioRenderer​(@Nullable
                                     Handler eventHandler,
                                     @Nullable
                                     AudioRendererEventListener eventListener,
                                     AudioProcessor... audioProcessors)

      Creates a new instance.
      Parameters:
        `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 `AudioProcessor`s that will process audio before output.

    - #### FfmpegAudioRenderer

          public FfmpegAudioRenderer​(@Nullable
                                     Handler eventHandler,
                                     @Nullable
                                     AudioRendererEventListener eventListener,
                                     AudioSink audioSink)

      Creates a new instance.
      Parameters:
        `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.
        `audioSink` - The sink to which audio will be output.

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `Renderer`
      Returns the name of this renderer, for logging and debugging purposes. Should typically be the renderer's (un-obfuscated) class name.
      Returns:
        The name of this renderer.

    - #### supportsFormatInternal

          @FormatSupport
          protected int supportsFormatInternal​(Format format)

      Description copied from class: `DecoderAudioRenderer`
      Returns the `C.FormatSupport` for the given `Format`.
      Specified by:
        `supportsFormatInternal` in class `DecoderAudioRenderer<com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder>`
      Parameters:
        `format` - The format, which has an audio `Format.sampleMimeType`.
      Returns:
        The `C.FormatSupport` for this `Format`.

    - #### supportsMixedMimeTypeAdaptation

          @AdaptiveSupport
          public final int supportsMixedMimeTypeAdaptation()

      Description copied from interface: `RendererCapabilities`
      Returns the extent to which the `Renderer` supports adapting between supported formats that have different MIME types.
      Specified by:
        `supportsMixedMimeTypeAdaptation` in interface `RendererCapabilities`
      Overrides:
        `supportsMixedMimeTypeAdaptation` in class `BaseRenderer`
      Returns:
        The `RendererCapabilities.AdaptiveSupport` for adapting between supported formats that have different MIME types.

    - #### createDecoder

          protected com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder createDecoder​(Format format,
                                                                                              @Nullable
                                                                                              ExoMediaCrypto mediaCrypto)
                                                                                       throws FfmpegDecoderException

      Description copied from class: `DecoderAudioRenderer`
      Creates a decoder for the given format.
      Specified by:
        `createDecoder` in class `DecoderAudioRenderer<com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder>`
      Parameters:
        `format` - 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.
      Returns:
        The decoder.
      Throws:
        `FfmpegDecoderException`

    - #### getOutputFormat

          public Format getOutputFormat​(com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder decoder)

      Description copied from class: `DecoderAudioRenderer`
      Returns the format of audio buffers output by the decoder. Will not be called until the first output buffer has been dequeued, so the decoder may use input data to determine the format.
      Specified by:
        `getOutputFormat` in class `DecoderAudioRenderer<com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder>`
      Parameters:
        `decoder` - The decoder.