Class ExperimentalFfmpegVideoRenderer

java.lang.Object
androidx.media3.exoplayer.BaseRenderer
androidx.media3.exoplayer.video.DecoderVideoRenderer
androidx.media3.decoder.ffmpeg.ExperimentalFfmpegVideoRenderer
All Implemented Interfaces:
androidx.media3.exoplayer.PlayerMessage.Target, androidx.media3.exoplayer.Renderer, androidx.media3.exoplayer.RendererCapabilities

@UnstableApi public final class ExperimentalFfmpegVideoRenderer extends androidx.media3.exoplayer.video.DecoderVideoRenderer
NOTE: This class if under development and is not yet functional.

Decodes and renders video using FFmpeg.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface androidx.media3.exoplayer.Renderer

    androidx.media3.exoplayer.Renderer.MessageType, androidx.media3.exoplayer.Renderer.State, androidx.media3.exoplayer.Renderer.WakeupListener

    Nested classes/interfaces inherited from interface androidx.media3.exoplayer.RendererCapabilities

    androidx.media3.exoplayer.RendererCapabilities.AdaptiveSupport, androidx.media3.exoplayer.RendererCapabilities.AudioOffloadSupport, androidx.media3.exoplayer.RendererCapabilities.Capabilities, androidx.media3.exoplayer.RendererCapabilities.DecoderSupport, androidx.media3.exoplayer.RendererCapabilities.HardwareAccelerationSupport, androidx.media3.exoplayer.RendererCapabilities.Listener, androidx.media3.exoplayer.RendererCapabilities.TunnelingSupport
  • Field Summary

    Fields inherited from class androidx.media3.exoplayer.video.DecoderVideoRenderer

    decoderCounters

    Fields inherited from interface androidx.media3.exoplayer.Renderer

    DEFAULT_DURATION_TO_PROGRESS_US, MSG_CUSTOM_BASE, MSG_SET_AUDIO_ATTRIBUTES, MSG_SET_AUDIO_SESSION_ID, MSG_SET_AUX_EFFECT_INFO, MSG_SET_CAMERA_MOTION_LISTENER, MSG_SET_CHANGE_FRAME_RATE_STRATEGY, MSG_SET_IMAGE_OUTPUT, MSG_SET_PREFERRED_AUDIO_DEVICE, MSG_SET_PRIORITY, MSG_SET_SCALING_MODE, MSG_SET_SKIP_SILENCE_ENABLED, MSG_SET_VIDEO_EFFECTS, MSG_SET_VIDEO_FRAME_METADATA_LISTENER, MSG_SET_VIDEO_OUTPUT, MSG_SET_VIDEO_OUTPUT_RESOLUTION, MSG_SET_VOLUME, MSG_SET_WAKEUP_LISTENER, MSG_TRANSFER_RESOURCES, STATE_DISABLED, STATE_ENABLED, STATE_STARTED

    Fields inherited from interface androidx.media3.exoplayer.RendererCapabilities

    ADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED, ADAPTIVE_SEAMLESS, ADAPTIVE_SUPPORT_MASK, AUDIO_OFFLOAD_GAPLESS_SUPPORTED, AUDIO_OFFLOAD_NOT_SUPPORTED, AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED, AUDIO_OFFLOAD_SUPPORT_MASK, AUDIO_OFFLOAD_SUPPORTED, DECODER_SUPPORT_FALLBACK, DECODER_SUPPORT_FALLBACK_MIMETYPE, DECODER_SUPPORT_MASK, DECODER_SUPPORT_PRIMARY, FORMAT_SUPPORT_MASK, HARDWARE_ACCELERATION_NOT_SUPPORTED, HARDWARE_ACCELERATION_SUPPORT_MASK, HARDWARE_ACCELERATION_SUPPORTED, TUNNELING_NOT_SUPPORTED, TUNNELING_SUPPORT_MASK, TUNNELING_SUPPORTED
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExperimentalFfmpegVideoRenderer(long allowedJoiningTimeMs, android.os.Handler eventHandler, androidx.media3.exoplayer.video.VideoRendererEventListener eventListener, int maxDroppedFramesToNotify)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected androidx.media3.exoplayer.DecoderReuseEvaluation
    canReuseDecoder(String decoderName, androidx.media3.common.Format oldFormat, androidx.media3.common.Format newFormat)
     
    protected androidx.media3.decoder.Decoder<androidx.media3.decoder.DecoderInputBuffer,androidx.media3.decoder.VideoDecoderOutputBuffer,FfmpegDecoderException>
    createDecoder(androidx.media3.common.Format format, androidx.media3.decoder.CryptoConfig cryptoConfig)
     
     
    protected void
    renderOutputBufferToSurface(androidx.media3.decoder.VideoDecoderOutputBuffer outputBuffer, android.view.Surface surface)
     
    protected void
    setDecoderOutputMode(@androidx.media3.common.C.VideoOutputMode int outputMode)
     
    final @androidx.media3.exoplayer.RendererCapabilities.Capabilities int
    supportsFormat(androidx.media3.common.Format format)
     

    Methods inherited from class androidx.media3.exoplayer.video.DecoderVideoRenderer

    dropOutputBuffer, enableMayRenderStartOfStream, flushDecoder, handleMessage, isEnded, isReady, maybeDropBuffersToKeyframe, onDisabled, onEnabled, onInputFormatChanged, onPositionReset, onProcessedOutputBuffer, onQueueInputBuffer, onStarted, onStopped, onStreamChanged, releaseDecoder, render, renderOutputBuffer, setOutput, shouldDropBuffersToKeyframe, shouldDropOutputBuffer, shouldForceRenderOutputBuffer, skipOutputBuffer, updateDroppedBufferCounters

    Methods inherited from class androidx.media3.exoplayer.BaseRenderer

    clearListener, createRendererException, createRendererException, disable, enable, getCapabilities, getClock, getConfiguration, getFormatHolder, getIndex, getLastResetPositionUs, getMediaClock, getPlayerId, getReadingPositionUs, getState, getStream, getStreamFormats, getStreamOffsetUs, getTimeline, getTrackType, hasReadStreamToEnd, init, isCurrentStreamFinal, isSourceReady, maybeThrowStreamError, onInit, onRelease, onRendererCapabilitiesChanged, onReset, onTimelineChanged, readSource, release, replaceStream, reset, resetPosition, setCurrentStreamFinal, setListener, setTimeline, skipSource, start, stop, supportsMixedMimeTypeAdaptation

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface androidx.media3.exoplayer.Renderer

    getDurationToProgressUs, setPlaybackSpeed
  • Constructor Details

    • ExperimentalFfmpegVideoRenderer

      public ExperimentalFfmpegVideoRenderer(long allowedJoiningTimeMs, @Nullable android.os.Handler eventHandler, @Nullable androidx.media3.exoplayer.video.VideoRendererEventListener eventListener, int maxDroppedFramesToNotify)
      Creates a new instance.
      Parameters:
      allowedJoiningTimeMs - The maximum duration in milliseconds for which this video renderer can attempt to seamlessly join an ongoing playback.
      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.
      maxDroppedFramesToNotify - The maximum number of frames that can be dropped between invocations of VideoRendererEventListener.onDroppedFrames(int, long).
  • Method Details

    • getName

      public String getName()
    • supportsFormat

      public final @androidx.media3.exoplayer.RendererCapabilities.Capabilities int supportsFormat(androidx.media3.common.Format format)
    • createDecoder

      protected androidx.media3.decoder.Decoder<androidx.media3.decoder.DecoderInputBuffer,androidx.media3.decoder.VideoDecoderOutputBuffer,FfmpegDecoderException> createDecoder(androidx.media3.common.Format format, @Nullable androidx.media3.decoder.CryptoConfig cryptoConfig) throws FfmpegDecoderException
      Specified by:
      createDecoder in class androidx.media3.exoplayer.video.DecoderVideoRenderer
      Throws:
      FfmpegDecoderException
    • renderOutputBufferToSurface

      protected void renderOutputBufferToSurface(androidx.media3.decoder.VideoDecoderOutputBuffer outputBuffer, android.view.Surface surface) throws FfmpegDecoderException
      Specified by:
      renderOutputBufferToSurface in class androidx.media3.exoplayer.video.DecoderVideoRenderer
      Throws:
      FfmpegDecoderException
    • setDecoderOutputMode

      protected void setDecoderOutputMode(@androidx.media3.common.C.VideoOutputMode int outputMode)
      Specified by:
      setDecoderOutputMode in class androidx.media3.exoplayer.video.DecoderVideoRenderer
    • canReuseDecoder

      protected androidx.media3.exoplayer.DecoderReuseEvaluation canReuseDecoder(String decoderName, androidx.media3.common.Format oldFormat, androidx.media3.common.Format newFormat)
      Overrides:
      canReuseDecoder in class androidx.media3.exoplayer.video.DecoderVideoRenderer