Skip to content

Commit

Permalink
Make available high profile
Browse files Browse the repository at this point in the history
  • Loading branch information
shts committed Feb 13, 2019
1 parent e9c411c commit 6261e72
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class MediaFormatValidator {
// Refer: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles
private static final byte PROFILE_IDC_BASELINE = 66;
private static final byte PROFILE_IDC_HI = 100;

public static void validateVideoOutputFormat(MediaFormat format) {
String mime = format.getString(MediaFormat.KEY_MIME);
Expand All @@ -36,7 +37,8 @@ public static void validateVideoOutputFormat(MediaFormat format) {
}
ByteBuffer spsBuffer = AvcCsdUtils.getSpsBuffer(format);
byte profileIdc = AvcSpsUtils.getProfileIdc(spsBuffer);
if (profileIdc != PROFILE_IDC_BASELINE) {
boolean availableProfile = (profileIdc == PROFILE_IDC_BASELINE || profileIdc == PROFILE_IDC_HI);
if (!availableProfile) {
throw new InvalidOutputFormatException("Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: " + profileIdc);
}
}
Expand Down

0 comments on commit 6261e72

Please sign in to comment.