Package limn.video

Enum Class VideoClock.Decision

java.lang.Object
java.lang.Enum<VideoClock.Decision>
limn.video.VideoClock.Decision
All Implemented Interfaces:
Serializable, Comparable<VideoClock.Decision>, Constable
Enclosing class:
VideoClock

public static enum VideoClock.Decision extends Enum<VideoClock.Decision>
What the caller must do with the picture it just asked about.

A queue is drained with exactly this loop, which terminates because a drop is returned only when the call named a strictly better candidate:


 VideoFrame head = queue.peek();
 while (head != null) {
     VideoFrame next = queue.peekSecond();
     Decision d = clock.decide(head.ptsMicros(),
                               next != null ? next.ptsMicros() : VideoClock.NO_PTS);
     if (d == Decision.DROP) { queue.remove(); head.release(); head = queue.peek(); continue; }
     if (d == Decision.PRESENT) { show(head); queue.remove(); }
     break;
 }
 
  • Enum Constant Details

    • PRESENT

      public static final VideoClock.Decision PRESENT
      Show this picture. The only decision that costs a repaint.
    • HOLD

      public static final VideoClock.Decision HOLD
      Do nothing at all (no repaint, no queue advance); the same picture is offered again on the next tick. A periodic callback produces no repaint by itself, so a held tick costs nothing; asking for one anyway turns a still picture into a full-rate repaint of the whole window.
    • DROP

      public static final VideoClock.Decision DROP
      Release this picture unshown and offer the next one. Returned only when the call named a successor whose own moment has also arrived, so a picture is never dropped in favour of nothing: a queue that has run dry always shows its last picture, however late, and the screen never goes blank.
  • Method Details

    • values

      public static VideoClock.Decision[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VideoClock.Decision valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null