Interface Renderer.WakeupListener

  • Enclosing interface:
    Renderer

    public static interface Renderer.WakeupListener
    Some renderers can signal when Renderer.render(long, long) should be called.

    That allows the player to sleep until the next wakeup, instead of calling Renderer.render(long, long) in a tight loop. The aim of this interrupt based scheduling is to save power.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onSleep​(long wakeupDeadlineMs)
      The renderer no longer needs to render until the next wakeup.
      void onWakeup()
      The renderer needs to render some frames.
    • Method Detail

      • onSleep

        void onSleep​(long wakeupDeadlineMs)
        The renderer no longer needs to render until the next wakeup.

        Must be called from the thread ExoPlayer invokes the renderer from.

        Parameters:
        wakeupDeadlineMs - Maximum time in milliseconds until onWakeup() will be called.
      • onWakeup

        void onWakeup()
        The renderer needs to render some frames. The client should call Renderer.render(long, long) at its earliest convenience.

        Can be called from any thread.