Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f58ba650 authored by James Dong's avatar James Dong
Browse files

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

Change-Id: I3fc4f49ae0a210f53b1bab68716f4e558b3d91c5
related-to-bug: 5419452
parent f6497e45
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)) {
+3 −0
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;