Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MediaCodecFormatSelector
public class MediaCodecFormatSelector {
public static MediaCodecFormatSelector forDevice() {
String deviceName = Device.getDeviceName();
if (deviceName.equalsIgnoreCase("samsung gt-i9300")
&& isBadMediaCodecSupport()) {
return new SamsungGalaxyS3MediaCodecFormatSelector();
else if (isBadMediaCodecSupport() && isAffectedDevice(deviceName)) {
return new NoMediaCodecSupportFormatSelector();
} else {
return new MediaCodecFormatSelector();
}
}
private static boolean isBadMediaCodecSupport() {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment