Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove lines below here, as profile validation is already not necessary.
#73 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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