mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add HD content filtering to DefaultTrackSelectionPolicy
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=126324788
This commit is contained in:
parent
a476e090bc
commit
9f017d71ef
1 changed files with 10 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ public class DefaultTrackSelectionPolicy extends TrackSelectionPolicy {
|
||||||
private String preferredLanguage;
|
private String preferredLanguage;
|
||||||
private boolean allowMixedMimeAdaptiveness;
|
private boolean allowMixedMimeAdaptiveness;
|
||||||
private boolean allowNonSeamlessAdaptiveness;
|
private boolean allowNonSeamlessAdaptiveness;
|
||||||
|
private boolean filterHdFormats;
|
||||||
private int maxVideoWidth;
|
private int maxVideoWidth;
|
||||||
private int maxVideoHeight;
|
private int maxVideoHeight;
|
||||||
|
|
||||||
|
|
@ -43,6 +44,13 @@ public class DefaultTrackSelectionPolicy extends TrackSelectionPolicy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFilterHdFormats(boolean filterHdFormats) {
|
||||||
|
if (this.filterHdFormats != filterHdFormats) {
|
||||||
|
this.filterHdFormats = filterHdFormats;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void allowMixedMimeAdaptiveness(boolean allowMixedMimeAdaptiveness) {
|
public void allowMixedMimeAdaptiveness(boolean allowMixedMimeAdaptiveness) {
|
||||||
if (this.allowMixedMimeAdaptiveness != allowMixedMimeAdaptiveness) {
|
if (this.allowMixedMimeAdaptiveness != allowMixedMimeAdaptiveness) {
|
||||||
this.allowMixedMimeAdaptiveness = allowMixedMimeAdaptiveness;
|
this.allowMixedMimeAdaptiveness = allowMixedMimeAdaptiveness;
|
||||||
|
|
@ -99,6 +107,8 @@ public class DefaultTrackSelectionPolicy extends TrackSelectionPolicy {
|
||||||
int requiredAdaptiveSupport = allowNonSeamlessAdaptiveness
|
int requiredAdaptiveSupport = allowNonSeamlessAdaptiveness
|
||||||
? TrackRenderer.ADAPTIVE_NOT_SEAMLESS | TrackRenderer.ADAPTIVE_SEAMLESS
|
? TrackRenderer.ADAPTIVE_NOT_SEAMLESS | TrackRenderer.ADAPTIVE_SEAMLESS
|
||||||
: TrackRenderer.ADAPTIVE_SEAMLESS;
|
: TrackRenderer.ADAPTIVE_SEAMLESS;
|
||||||
|
int maxVideoWidth = Math.min(this.maxVideoWidth, filterHdFormats ? 1279 : Integer.MAX_VALUE);
|
||||||
|
int maxVideoHeight = Math.min(this.maxVideoHeight, filterHdFormats ? 719 : Integer.MAX_VALUE);
|
||||||
boolean allowMixedMimeTypes = allowMixedMimeAdaptiveness
|
boolean allowMixedMimeTypes = allowMixedMimeAdaptiveness
|
||||||
&& (renderer.supportsMixedMimeTypeAdaptation() & requiredAdaptiveSupport) != 0;
|
&& (renderer.supportsMixedMimeTypeAdaptation() & requiredAdaptiveSupport) != 0;
|
||||||
int largestAdaptiveGroup = -1;
|
int largestAdaptiveGroup = -1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue