public static final class FormatEvaluator.RandomEvaluator extends Object implements FormatEvaluator
FormatEvaluator.AdaptiveEvaluator, FormatEvaluator.Evaluation, FormatEvaluator.FixedEvaluator, FormatEvaluator.RandomEvaluator
Constructor and Description |
---|
RandomEvaluator() |
RandomEvaluator(int seed) |
Modifier and Type | Method and Description |
---|---|
void |
disable()
Disables the evaluator.
|
void |
enable()
Enables the evaluator.
|
void |
evaluate(List<? extends MediaChunk> queue,
long playbackPositionUs,
Format[] formats,
FormatEvaluator.Evaluation evaluation)
Update the supplied evaluation.
|
public RandomEvaluator()
public RandomEvaluator(int seed)
seed
- A seed for the underlying random number generator.public void enable()
FormatEvaluator
enable
in interface FormatEvaluator
public void disable()
FormatEvaluator
disable
in interface FormatEvaluator
public void evaluate(List<? extends MediaChunk> queue, long playbackPositionUs, Format[] formats, FormatEvaluator.Evaluation evaluation)
FormatEvaluator
When the method is invoked, evaluation
will contain the currently selected
format (null for the first evaluation), the most recent trigger (TRIGGER_INITIAL for the
first evaluation) and the current queue size. The implementation should update these
fields as necessary.
The trigger should be considered "sticky" for as long as a given representation is selected, and so should only be changed if the representation is also changed.
evaluate
in interface FormatEvaluator
queue
- A read only representation of the currently buffered MediaChunk
s.playbackPositionUs
- The current playback position.formats
- The formats from which to select, ordered by decreasing bandwidth.evaluation
- The evaluation.