Commit ee565300 by olly Committed by Oliver Woodman

Enhance DefaultTrackSelector part 1

- Enforce viewport constraints for fixed video track selection.
- Select best fixed video track, not the first one.
- Better handling of video tracks with unknown dimensions.
- Mini bug fix.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129226593
parent 2395f136
......@@ -411,6 +411,14 @@ public final class Format implements Parcelable {
}
/**
* Returns the number of pixels if this is a video format whose {@link #width} and {@link #height}
* are known, or {@link #NO_VALUE} otherwise
*/
public int getPixelCount() {
return width == NO_VALUE || height == NO_VALUE ? NO_VALUE : (width * height);
}
/**
* Returns a {@link MediaFormat} representation of this format.
*/
@SuppressLint("InlinedApi")
......
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