Class NoSampleRenderer

    • Constructor Detail

      • NoSampleRenderer

        public NoSampleRenderer()
        Deprecated.
    • Method Detail

      • getCapabilities

        public final RendererCapabilities getCapabilities()
        Deprecated.
        Description copied from interface: Renderer
        Returns the capabilities of the renderer.
        Specified by:
        getCapabilities in interface Renderer
        Returns:
        The capabilities of the renderer.
      • init

        public final void init​(int index,
                               PlayerId playerId)
        Deprecated.
        Description copied from interface: Renderer
        Initializes the renderer for playback with a player.
        Specified by:
        init in interface Renderer
        Parameters:
        index - The renderer index within the player.
        playerId - The PlayerId of the player.
      • getMediaClock

        @Nullable
        public MediaClock getMediaClock()
        Deprecated.
        Description copied from interface: Renderer
        If the renderer advances its own playback position then this method returns a corresponding MediaClock. If provided, the player will use the returned MediaClock as its source of time during playback. A player may have at most one renderer that returns a MediaClock from this method.
        Specified by:
        getMediaClock in interface Renderer
        Returns:
        The MediaClock tracking the playback position of the renderer, or null.
      • enable

        public final void enable​(RendererConfiguration configuration,
                                 Format[] formats,
                                 SampleStream stream,
                                 long positionUs,
                                 boolean joining,
                                 boolean mayRenderStartOfStream,
                                 long startPositionUs,
                                 long offsetUs)
                          throws ExoPlaybackException
        Deprecated.
        Description copied from interface: Renderer
        Enables the renderer to consume from the specified SampleStream.

        This method may be called when the renderer is in the following states: Renderer.STATE_DISABLED.

        Specified by:
        enable in interface Renderer
        Parameters:
        configuration - The renderer configuration.
        formats - The enabled formats.
        stream - The SampleStream from which the renderer should consume.
        positionUs - The player's current position.
        joining - 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.
        startPositionUs - The start position of the stream in renderer time (microseconds).
        offsetUs - The offset to be added to timestamps of buffers read from stream before they are rendered.
        Throws:
        ExoPlaybackException - If an error occurs.
      • replaceStream

        public final void replaceStream​(Format[] formats,
                                        SampleStream stream,
                                        long startPositionUs,
                                        long offsetUs)
                                 throws ExoPlaybackException
        Deprecated.
        Description copied from interface: Renderer
        Replaces the SampleStream from which samples will be consumed.

        This method may be called when the renderer is in the following states: Renderer.STATE_ENABLED, Renderer.STATE_STARTED.

        Specified by:
        replaceStream in interface Renderer
        Parameters:
        formats - The enabled formats.
        stream - The SampleStream from which the renderer should consume.
        startPositionUs - The start position of the new stream in renderer time (microseconds).
        offsetUs - The offset to be added to timestamps of buffers read from stream before they are rendered.
        Throws:
        ExoPlaybackException - If an error occurs.
      • isCurrentStreamFinal

        public final boolean isCurrentStreamFinal()
        Deprecated.
        Description copied from interface: Renderer
        Returns whether the current SampleStream will be the final one supplied before the renderer is next disabled or reset.
        Specified by:
        isCurrentStreamFinal in interface Renderer
      • resetPosition

        public final void resetPosition​(long positionUs)
                                 throws ExoPlaybackException
        Deprecated.
        Description copied from interface: Renderer
        Signals to the renderer that a position discontinuity has occurred.

        After a position discontinuity, the renderer's SampleStream is guaranteed to provide samples starting from a key frame.

        This method may be called when the renderer is in the following states: Renderer.STATE_ENABLED, Renderer.STATE_STARTED.

        Specified by:
        resetPosition in interface Renderer
        Parameters:
        positionUs - The new playback position in microseconds.
        Throws:
        ExoPlaybackException - If an error occurs handling the reset.
      • reset

        public final void reset()
        Deprecated.
        Description copied from interface: Renderer
        Forces the renderer to give up any resources (e.g. media decoders) that it may be holding. If the renderer is not holding any resources, the call is a no-op.

        This method may be called when the renderer is in the following states: Renderer.STATE_DISABLED.

        Specified by:
        reset in interface Renderer
      • isReady

        public boolean isReady()
        Deprecated.
        Description copied from interface: Renderer
        Whether the renderer is able to immediately render media from the current position.

        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.

        Specified by:
        isReady in interface Renderer
        Returns:
        Whether the renderer is ready to render media.
      • isEnded

        public boolean isEnded()
        Deprecated.
        Description copied from interface: Renderer
        Whether the renderer is ready for the ExoPlayer 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.

        Specified by:
        isEnded in interface Renderer
        Returns:
        Whether the renderer is ready for the player to transition to the ended state.
      • handleMessage

        public void handleMessage​(@com.google.android.exoplayer2.Renderer.MessageType int messageType,
                                  @Nullable
                                  Object message)
                           throws ExoPlaybackException
        Deprecated.
        Description copied from interface: PlayerMessage.Target
        Handles a message delivered to the target.
        Specified by:
        handleMessage in interface PlayerMessage.Target
        Parameters:
        messageType - The message type.
        message - The message payload.
        Throws:
        ExoPlaybackException - If an error occurred whilst handling the message. Should only be thrown by targets that handle messages on the playback thread.
      • onEnabled

        protected void onEnabled​(boolean joining)
                          throws ExoPlaybackException
        Deprecated.
        Called when the renderer is enabled.

        The default implementation is a no-op.

        Parameters:
        joining - Whether this renderer is being enabled to join an ongoing playback.
        Throws:
        ExoPlaybackException - If an error occurs.
      • onRendererOffsetChanged

        protected void onRendererOffsetChanged​(long offsetUs)
                                        throws ExoPlaybackException
        Deprecated.
        Called when the renderer's offset has been changed.

        The default implementation is a no-op.

        Parameters:
        offsetUs - The offset that should be subtracted from positionUs in Renderer.render(long, long) to get the playback position with respect to the media.
        Throws:
        ExoPlaybackException - If an error occurs.
      • onPositionReset

        protected void onPositionReset​(long positionUs,
                                       boolean joining)
                                throws ExoPlaybackException
        Deprecated.
        Called when the position is reset. This occurs when the renderer is enabled after onRendererOffsetChanged(long) has been called, and also when a position discontinuity is encountered.

        The default implementation is a no-op.

        Parameters:
        positionUs - The new playback position in microseconds.
        joining - Whether this renderer is being enabled to join an ongoing playback.
        Throws:
        ExoPlaybackException - If an error occurs.
      • onStarted

        protected void onStarted()
                          throws ExoPlaybackException
        Deprecated.
        Called when the renderer is started.

        The default implementation is a no-op.

        Throws:
        ExoPlaybackException - If an error occurs.
      • onStopped

        protected void onStopped()
        Deprecated.
        Called when the renderer is stopped.

        The default implementation is a no-op.

      • onDisabled

        protected void onDisabled()
        Deprecated.
        Called when the renderer is disabled.

        The default implementation is a no-op.

      • onReset

        protected void onReset()
        Deprecated.
        Called when the renderer is reset.

        The default implementation is a no-op.

      • getConfiguration

        @Nullable
        protected final RendererConfiguration getConfiguration()
        Deprecated.
        Returns the configuration set when the renderer was most recently enabled, or null if the renderer has never been enabled.
      • getIndex

        protected final int getIndex()
        Deprecated.
        Returns the index of the renderer within the player.