diff options
| author | 2017-11-22 03:37:55 +0000 | |
|---|---|---|
| committer | 2017-11-22 03:37:55 +0000 | |
| commit | 56cc25489eb2a006a5c19e12dfebf4612e99acad (patch) | |
| tree | fd4016c35cfcefbc4728053d09db10006bdfc064 | |
| parent | f8d639243043fb4cca51f6a75174be6536f1a807 (diff) | |
| parent | e70785fac6541a38df1fbfd2e5af6338de75d680 (diff) | |
Merge "heif: add muxer support for heic tracks"
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | api/test-current.txt | 1 | ||||
| -rw-r--r-- | media/java/android/media/MediaFormat.java | 8 | ||||
| -rw-r--r-- | media/java/android/media/MediaMuxer.java | 16 |
5 files changed, 19 insertions, 8 deletions
diff --git a/api/current.txt b/api/current.txt index ac9bc98c156c..60448eb6e409 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23047,6 +23047,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_HEIF = 3; // 0x3 field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0 field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1 } diff --git a/api/system-current.txt b/api/system-current.txt index 82a6b0147bc2..b0880d8235dd 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -24941,6 +24941,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_HEIF = 3; // 0x3 field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0 field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1 } diff --git a/api/test-current.txt b/api/test-current.txt index 766f855146ec..d9dae94a589d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -23250,6 +23250,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_HEIF = 3; // 0x3 field public static final int MUXER_OUTPUT_MPEG_4 = 0; // 0x0 field public static final int MUXER_OUTPUT_WEBM = 1; // 0x1 } diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index c475e122833a..306ed83c426b 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -721,14 +721,16 @@ public final class MediaFormat { /** * A key for boolean DEFAULT behavior for the track. The track with DEFAULT=true is * selected in the absence of a specific user choice. - * This is currently only used for subtitle tracks, when the user selected - * 'Default' for the captioning locale. + * This is currently used in two scenarios: + * 1) for subtitle tracks, when the user selected 'Default' for the captioning locale. + * 2) for a {@link #MIMETYPE_IMAGE_ANDROID_HEIC} track, indicating the image is the + * primary item in the file. + * The associated value is an integer, where non-0 means TRUE. This is an optional * field; if not specified, DEFAULT is considered to be FALSE. */ public static final String KEY_IS_DEFAULT = "is-default"; - /** * A key for the FORCED field for subtitle tracks. True if it is a * forced subtitle track. Forced subtitle tracks are essential for the diff --git a/media/java/android/media/MediaMuxer.java b/media/java/android/media/MediaMuxer.java index 91e57ee073b0..02c71b283b21 100644 --- a/media/java/android/media/MediaMuxer.java +++ b/media/java/android/media/MediaMuxer.java @@ -258,12 +258,18 @@ final public class MediaMuxer { * in include/media/stagefright/MediaMuxer.h! */ private OutputFormat() {} + /** @hide */ + public static final int MUXER_OUTPUT_FIRST = 0; /** MPEG4 media file format*/ - public static final int MUXER_OUTPUT_MPEG_4 = 0; + public static final int MUXER_OUTPUT_MPEG_4 = MUXER_OUTPUT_FIRST; /** WEBM media file format*/ - public static final int MUXER_OUTPUT_WEBM = 1; + public static final int MUXER_OUTPUT_WEBM = MUXER_OUTPUT_FIRST + 1; /** 3GPP media file format*/ - public static final int MUXER_OUTPUT_3GPP = 2; + public static final int MUXER_OUTPUT_3GPP = MUXER_OUTPUT_FIRST + 2; + /** HEIF media file format*/ + public static final int MUXER_OUTPUT_HEIF = MUXER_OUTPUT_FIRST + 3; + /** @hide */ + public static final int MUXER_OUTPUT_LAST = MUXER_OUTPUT_HEIF; }; /** @hide */ @@ -271,6 +277,7 @@ final public class MediaMuxer { OutputFormat.MUXER_OUTPUT_MPEG_4, OutputFormat.MUXER_OUTPUT_WEBM, OutputFormat.MUXER_OUTPUT_3GPP, + OutputFormat.MUXER_OUTPUT_HEIF, }) @Retention(RetentionPolicy.SOURCE) public @interface Format {} @@ -347,8 +354,7 @@ 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 - && format != OutputFormat.MUXER_OUTPUT_3GPP) { + if (format < OutputFormat.MUXER_OUTPUT_FIRST || format > OutputFormat.MUXER_OUTPUT_LAST) { throw new IllegalArgumentException("format: " + format + " is invalid"); } mNativeObject = nativeSetup(fd, format); |