Class FakeRenderer

    • Field Detail

      • isEnded

        public boolean isEnded
      • positionResetCount

        public int positionResetCount
      • sampleBufferReadCount

        public int sampleBufferReadCount
      • enabledCount

        public int enabledCount
      • resetCount

        public int resetCount
    • Constructor Detail

      • FakeRenderer

        public FakeRenderer​(@com.google.android.exoplayer2.C.TrackType int trackType)
    • 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.
      • onPositionReset

        protected void onPositionReset​(long positionUs,
                                       boolean joining)
                                throws ExoPlaybackException
        Description copied from class: BaseRenderer
        Called when the position is reset. This occurs when the renderer is enabled after BaseRenderer.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.

        Overrides:
        onPositionReset in class BaseRenderer
        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.
      • onEnabled

        protected void onEnabled​(boolean joining,
                                 boolean mayRenderStartOfStream)
                          throws ExoPlaybackException
        Description copied from class: BaseRenderer
        Called when the renderer is enabled.

        The default implementation is a no-op.

        Overrides:
        onEnabled in class BaseRenderer
        Parameters:
        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.
        Throws:
        ExoPlaybackException - If an error occurs.
      • onReset

        protected void onReset()
        Description copied from class: BaseRenderer
        Called when the renderer is reset.

        The default implementation is a no-op.

        Overrides:
        onReset in class BaseRenderer
      • isReady

        public boolean isReady()
        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.

        Returns:
        Whether the renderer is ready to render media.
      • isEnded

        public boolean isEnded()
        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.

        Returns:
        Whether the renderer is ready for the player to transition to the ended state.
      • onDisabled

        protected void onDisabled()
        Description copied from class: BaseRenderer
        Called when the renderer is disabled.

        The default implementation is a no-op.

        Overrides:
        onDisabled in class BaseRenderer
      • onFormatChanged

        protected void onFormatChanged​(Format format)
        Called when the renderer reads a new format.
      • getFormatsRead

        public List<Format> getFormatsRead()
        Returns the list of formats read by the renderer.
      • shouldProcessBuffer

        protected boolean shouldProcessBuffer​(long bufferTimeUs,
                                              long playbackPositionUs)
        Called before the renderer processes a buffer.
        Parameters:
        bufferTimeUs - The buffer timestamp, in microseconds.
        playbackPositionUs - The playback position, in microseconds
        Returns:
        Whether the buffer should be processed.