getRecommendedResolution
public static <any> getRecommendedResolution(int originalWidth,
int originalHeight)
Returns the recommended resolution that take into account the capability of hardware decoders.
The input originalWidth & originalHeight are clamp into the range of hardware decoder's supported width &
height.
See android.util.Range#clamp(Comparable).
The aspect ratio of the returning resolution will remain the same as that of the original resolution.
- Parameters:
originalWidth - The width of the original resolution.
originalHeight - The height of the original resolution.
- Returns:
- The recommended resolution,
Pair#first as the recommended width and Pair#second as the
recommended height. Return null if there's no suitable resolution.