Commit 861d6749 by Oliver Woodman

Remove ability to extend the default FormatEvaluator implementations.

parent 9f77c400
...@@ -84,7 +84,7 @@ public interface FormatEvaluator { ...@@ -84,7 +84,7 @@ public interface FormatEvaluator {
/** /**
* Always selects the first format. * Always selects the first format.
*/ */
public static class FixedEvaluator implements FormatEvaluator { public static final class FixedEvaluator implements FormatEvaluator {
@Override @Override
public void enable() { public void enable() {
...@@ -107,7 +107,7 @@ public interface FormatEvaluator { ...@@ -107,7 +107,7 @@ public interface FormatEvaluator {
/** /**
* Selects randomly between the available formats. * Selects randomly between the available formats.
*/ */
public static class RandomEvaluator implements FormatEvaluator { public static final class RandomEvaluator implements FormatEvaluator {
private final Random random; private final Random random;
...@@ -145,7 +145,7 @@ public interface FormatEvaluator { ...@@ -145,7 +145,7 @@ public interface FormatEvaluator {
* reference implementation only. It is recommended that application developers implement their * reference implementation only. It is recommended that application developers implement their
* own adaptive evaluator to more precisely suit their use case. * own adaptive evaluator to more precisely suit their use case.
*/ */
public static class AdaptiveEvaluator implements FormatEvaluator { public static final class AdaptiveEvaluator implements FormatEvaluator {
public static final int DEFAULT_MAX_INITIAL_BITRATE = 800000; public static final int DEFAULT_MAX_INITIAL_BITRATE = 800000;
...@@ -259,8 +259,9 @@ public interface FormatEvaluator { ...@@ -259,8 +259,9 @@ public interface FormatEvaluator {
/** /**
* Compute the ideal format ignoring buffer health. * Compute the ideal format ignoring buffer health.
*/ */
protected Format determineIdealFormat(Format[] formats, long bitrateEstimate) { private Format determineIdealFormat(Format[] formats, long bitrateEstimate) {
long effectiveBitrate = computeEffectiveBitrateEstimate(bitrateEstimate); long effectiveBitrate = bitrateEstimate == BandwidthMeter.NO_ESTIMATE
? maxInitialBitrate : (long) (bitrateEstimate * bandwidthFraction);
for (int i = 0; i < formats.length; i++) { for (int i = 0; i < formats.length; i++) {
Format format = formats[i]; Format format = formats[i];
if (format.bitrate <= effectiveBitrate) { if (format.bitrate <= effectiveBitrate) {
...@@ -271,14 +272,6 @@ public interface FormatEvaluator { ...@@ -271,14 +272,6 @@ public interface FormatEvaluator {
return formats[formats.length - 1]; return formats[formats.length - 1];
} }
/**
* Apply overhead factor, or default value in absence of estimate.
*/
protected long computeEffectiveBitrateEstimate(long bitrateEstimate) {
return bitrateEstimate == BandwidthMeter.NO_ESTIMATE
? maxInitialBitrate : (long) (bitrateEstimate * bandwidthFraction);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment