summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Danny Fernandes <dannyfernandes@google.com> 2011-02-04 01:33:49 -0800
committer Danny Fernandes <dannyfernandes@google.com> 2011-02-04 12:45:31 -0800
commit7b3f26328bb2555a1728db38780a4cb3be00a893 (patch)
tree66a5281d82173e7a7ca7d66996b56bf1a773788e
parent160c18a4d209f56766fdd90e4711c8e29fd407e6 (diff)
Fixed 3419090 Throwing exception for unsupported video codec profiles and level
Change-Id: I89e8723a6b89338ecedcfabf8b0c63ed2f7e9468
-rwxr-xr-xmedia/java/android/media/videoeditor/MediaProperties.java5
-rwxr-xr-xmedia/java/android/media/videoeditor/MediaVideoItem.java5
2 files changed, 10 insertions, 0 deletions
diff --git a/media/java/android/media/videoeditor/MediaProperties.java b/media/java/android/media/videoeditor/MediaProperties.java
index a2e01f6f7817..34186e98de02 100755
--- a/media/java/android/media/videoeditor/MediaProperties.java
+++ b/media/java/android/media/videoeditor/MediaProperties.java
@@ -198,6 +198,11 @@ public class MediaProperties {
public static final int FILE_UNSUPPORTED = 255;
/**
+ * Undefined video codec profiles
+ */
+ public static final int UNDEFINED_VIDEO_PROFILE = 255;
+
+ /**
* The array of the supported file formats
*/
private static final int[] SUPPORTED_VIDEO_FILE_FORMATS = new int[] {
diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java
index bbadd621fab9..d35058496b8b 100755
--- a/media/java/android/media/videoeditor/MediaVideoItem.java
+++ b/media/java/android/media/videoeditor/MediaVideoItem.java
@@ -139,6 +139,11 @@ public class MediaVideoItem extends MediaItem {
throw new IllegalArgumentException("Unsupported Video Codec Format in Input File");
}
+ /* Check if the profile is unsupported. */
+ if (properties.profileAndLevel == MediaProperties.UNDEFINED_VIDEO_PROFILE) {
+ throw new IllegalArgumentException("Unsupported Video Codec Profile in Input File");
+ }
+
mWidth = properties.width;
mHeight = properties.height;
mAspectRatio = mMANativeHelper.getAspectRatio(properties.width,