Merge "MediaFormat: added subtitle format" into klp-dev
This commit is contained in:
@ -12601,6 +12601,7 @@ package android.media {
|
|||||||
ctor public MediaFormat();
|
ctor public MediaFormat();
|
||||||
method public final boolean containsKey(java.lang.String);
|
method public final boolean containsKey(java.lang.String);
|
||||||
method public static final android.media.MediaFormat createAudioFormat(java.lang.String, int, int);
|
method public static final android.media.MediaFormat createAudioFormat(java.lang.String, int, int);
|
||||||
|
method public static final android.media.MediaFormat createSubtitleFormat(java.lang.String, java.lang.String);
|
||||||
method public static final android.media.MediaFormat createVideoFormat(java.lang.String, int, int);
|
method public static final android.media.MediaFormat createVideoFormat(java.lang.String, int, int);
|
||||||
method public final java.nio.ByteBuffer getByteBuffer(java.lang.String);
|
method public final java.nio.ByteBuffer getByteBuffer(java.lang.String);
|
||||||
method public final float getFloat(java.lang.String);
|
method public final float getFloat(java.lang.String);
|
||||||
@ -12623,6 +12624,7 @@ package android.media {
|
|||||||
field public static final java.lang.String KEY_HEIGHT = "height";
|
field public static final java.lang.String KEY_HEIGHT = "height";
|
||||||
field public static final java.lang.String KEY_IS_ADTS = "is-adts";
|
field public static final java.lang.String KEY_IS_ADTS = "is-adts";
|
||||||
field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval";
|
field public static final java.lang.String KEY_I_FRAME_INTERVAL = "i-frame-interval";
|
||||||
|
field public static final java.lang.String KEY_LANGUAGE = "language";
|
||||||
field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size";
|
field public static final java.lang.String KEY_MAX_INPUT_SIZE = "max-input-size";
|
||||||
field public static final java.lang.String KEY_MIME = "mime";
|
field public static final java.lang.String KEY_MIME = "mime";
|
||||||
field public static final java.lang.String KEY_SAMPLE_RATE = "sample-rate";
|
field public static final java.lang.String KEY_SAMPLE_RATE = "sample-rate";
|
||||||
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* The format of the media data is specified as string/value pairs.
|
* The format of the media data is specified as string/value pairs.
|
||||||
*
|
*
|
||||||
* Keys common to all formats, <b>all keys not marked optional are mandatory</b>:
|
* Keys common to all audio/video formats, <b>all keys not marked optional are mandatory</b>:
|
||||||
*
|
*
|
||||||
* <table>
|
* <table>
|
||||||
* <tr><th>Name</th><th>Value Type</th><th>Description</th></tr>
|
* <tr><th>Name</th><th>Value Type</th><th>Description</th></tr>
|
||||||
@ -57,6 +57,11 @@ import java.util.Map;
|
|||||||
* <tr><td>{@link #KEY_FLAC_COMPRESSION_LEVEL}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is FLAC audio, specifies the desired compression level.</td></tr>
|
* <tr><td>{@link #KEY_FLAC_COMPRESSION_LEVEL}</td><td>Integer</td><td><b>encoder-only</b>, optional, if content is FLAC audio, specifies the desired compression level.</td></tr>
|
||||||
* </table>
|
* </table>
|
||||||
*
|
*
|
||||||
|
* Subtitle formats have the following keys:
|
||||||
|
* <table>
|
||||||
|
* <tr><td>{@link #KEY_MIME}</td><td>String</td><td>The type of the format.</td></tr>
|
||||||
|
* <tr><td>{@link #KEY_LANGUAGE}</td><td>String</td><td>The language of the content.</td></tr>
|
||||||
|
* </table>
|
||||||
*/
|
*/
|
||||||
public final class MediaFormat {
|
public final class MediaFormat {
|
||||||
private Map<String, Object> mMap;
|
private Map<String, Object> mMap;
|
||||||
@ -67,6 +72,12 @@ public final class MediaFormat {
|
|||||||
*/
|
*/
|
||||||
public static final String KEY_MIME = "mime";
|
public static final String KEY_MIME = "mime";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A key describing the language of the content.
|
||||||
|
* The associated value is a string.
|
||||||
|
*/
|
||||||
|
public static final String KEY_LANGUAGE = "language";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key describing the sample rate of an audio format.
|
* A key describing the sample rate of an audio format.
|
||||||
* The associated value is an integer
|
* The associated value is an integer
|
||||||
@ -276,6 +287,23 @@ public final class MediaFormat {
|
|||||||
return format;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a minimal subtitle format.
|
||||||
|
* @param mime The mime type of the content.
|
||||||
|
* @param language The language of the content. Specify "und" if language
|
||||||
|
* information is only included in the content (similarly, if there
|
||||||
|
* are multiple language tracks in the content.)
|
||||||
|
*/
|
||||||
|
public static final MediaFormat createSubtitleFormat(
|
||||||
|
String mime,
|
||||||
|
String language) {
|
||||||
|
MediaFormat format = new MediaFormat();
|
||||||
|
format.setString(KEY_MIME, mime);
|
||||||
|
format.setString(KEY_LANGUAGE, language);
|
||||||
|
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a minimal video format.
|
* Creates a minimal video format.
|
||||||
* @param mime The mime type of the content.
|
* @param mime The mime type of the content.
|
||||||
|
Reference in New Issue
Block a user