Merge "heif: add muxer support for heic tracks"

This commit is contained in:
TreeHugger Robot
2017-11-22 03:37:55 +00:00
committed by Android (Google) Code Review
5 changed files with 19 additions and 8 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -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);