Skip to content

Commit df7ee27

Browse files
committed
Remove profile validation
1 parent a09de49 commit df7ee27

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

lib/src/main/java/net/ypresto/androidtranscoder/engine/MediaFormatValidator.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@
1818
import android.media.MediaFormat;
1919

2020
import net.ypresto.androidtranscoder.format.MediaFormatExtraConstants;
21-
import net.ypresto.androidtranscoder.utils.AvcCsdUtils;
22-
import net.ypresto.androidtranscoder.utils.AvcSpsUtils;
23-
24-
import java.nio.ByteBuffer;
2521

2622
class MediaFormatValidator {
27-
// Refer: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles
28-
private static final byte PROFILE_IDC_BASELINE = 66;
29-
private static final byte PROFILE_IDC_HI = 100;
3023

3124
public static void validateVideoOutputFormat(MediaFormat format) {
3225
String mime = format.getString(MediaFormat.KEY_MIME);
@@ -35,12 +28,6 @@ public static void validateVideoOutputFormat(MediaFormat format) {
3528
if (!MediaFormatExtraConstants.MIMETYPE_VIDEO_AVC.equals(mime)) {
3629
throw new InvalidOutputFormatException("Video codecs other than AVC is not supported, actual mime type: " + mime);
3730
}
38-
ByteBuffer spsBuffer = AvcCsdUtils.getSpsBuffer(format);
39-
byte profileIdc = AvcSpsUtils.getProfileIdc(spsBuffer);
40-
boolean availableProfile = (profileIdc == PROFILE_IDC_BASELINE || profileIdc == PROFILE_IDC_HI);
41-
if (!availableProfile) {
42-
throw new InvalidOutputFormatException("Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: " + profileIdc);
43-
}
4431
}
4532

4633
public static void validateAudioOutputFormat(MediaFormat format) {

0 commit comments

Comments
 (0)