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

Commit 03299f9c authored by Hangyu Kuang's avatar Hangyu Kuang
Browse files

media: Add 3gpp output format to MediaMuxer.

Test: CTS test.
Bug: 34281643
Change-Id: I45b65728aa1fbde7cee88ca41d7f1bd692fc866c
parent 61c74c6a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21763,6 +21763,7 @@ package android.media {
  }
  public static final class MediaMuxer.OutputFormat {
    field public static final int MUXER_OUTPUT_3GPP = 2; // 0x2
    field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0
    field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1
  }
+1 −0
Original line number Diff line number Diff line
@@ -23320,6 +23320,7 @@ package android.media {
  }
  public static final class MediaMuxer.OutputFormat {
    field public static final int MUXER_OUTPUT_3GPP = 2; // 0x2
    field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0
    field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1
  }
+1 −0
Original line number Diff line number Diff line
@@ -21853,6 +21853,7 @@ package android.media {
  }
  public static final class MediaMuxer.OutputFormat {
    field public static final int MUXER_OUTPUT_3GPP = 2; // 0x2
    field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0
    field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1
  }
+6 −2
Original line number Diff line number Diff line
@@ -83,13 +83,17 @@ final public class MediaMuxer {
        private OutputFormat() {}
        /** MPEG4 media file format*/
        public static final int MUXER_OUTPUT_MPEG_4 = 0;
        /** WEBM media file format*/
        public static final int MUXER_OUTPUT_WEBM   = 1;
        /** 3GPP media file format*/
        public static final int MUXER_OUTPUT_3GPP   = 2;
    };

    /** @hide */
    @IntDef({
        OutputFormat.MUXER_OUTPUT_MPEG_4,
        OutputFormat.MUXER_OUTPUT_WEBM,
        OutputFormat.MUXER_OUTPUT_3GPP,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface Format {}
@@ -166,8 +170,8 @@ final public class MediaMuxer {
    }

    private void setUpMediaMuxer(@NonNull FileDescriptor fd, @Format int format) throws IOException {
        if (format != OutputFormat.MUXER_OUTPUT_MPEG_4 &&
                format != OutputFormat.MUXER_OUTPUT_WEBM) {
        if (format != OutputFormat.MUXER_OUTPUT_MPEG_4 && format != OutputFormat.MUXER_OUTPUT_WEBM
                && format != OutputFormat.MUXER_OUTPUT_3GPP) {
            throw new IllegalArgumentException("format: " + format + " is invalid");
        }
        mNativeObject = nativeSetup(fd, format);