Merge "Support AMR as a file type so that it can be imported into movie studio"

This commit is contained in:
James Dong
2011-10-10 15:22:04 -07:00
committed by Android (Google) Code Review
3 changed files with 8 additions and 3 deletions

View File

@@ -147,14 +147,16 @@ public class AudioTrack {
} catch (Exception e) {
throw new IllegalArgumentException(e.getMessage() + " : " + filename);
}
switch (mMANativeHelper.getFileType(properties.fileType)) {
int fileType = mMANativeHelper.getFileType(properties.fileType);
switch (fileType) {
case MediaProperties.FILE_3GP:
case MediaProperties.FILE_MP4:
case MediaProperties.FILE_MP3:
case MediaProperties.FILE_AMR:
break;
default: {
throw new IllegalArgumentException("Unsupported input file type");
throw new IllegalArgumentException("Unsupported input file type: " + fileType);
}
}
switch (mMANativeHelper.getAudioCodecType(properties.audioFormat)) {

View File

@@ -3239,6 +3239,9 @@ class MediaArtistNativeHelper {
case FileType.M4V:
retValue = MediaProperties.FILE_M4V;
break;
case FileType.AMR:
retValue = MediaProperties.FILE_AMR;
break;
default:
retValue = -1;

View File

@@ -286,7 +286,7 @@ public class MediaProperties {
*/
public static final int FILE_3GP = 0;
public static final int FILE_MP4 = 1;
// 2 is for AMRNB
public static final int FILE_AMR = 2;
public static final int FILE_MP3 = 3;
// 4 is for PCM
public static final int FILE_JPEG = 5;