Package limn.video
Enum Class VideoClock.Decision
- All Implemented Interfaces:
Serializable,Comparable<VideoClock.Decision>,Constable
- Enclosing class:
VideoClock
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;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic VideoClock.DecisionReturns the enum constant of this class with the specified name.static VideoClock.Decision[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PRESENT
Show this picture. The only decision that costs a repaint. -
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
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
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
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 nameNullPointerException- if the argument is null
-