From 8a39021dfaf401cabb7f46b83d936ed88bf209d9 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Tue, 17 Sep 2013 18:58:14 -0700 Subject: Misc. media API changes - MediaCodec.setParameter signature to take android.os.Bundle - PARAMETER_KEY_VIDEO_BITRATE value - comments for MediaFormat.KEY_LANGUAGE and createSubtitleFormat Change-Id: I092e9830cb21df08b331854cbd28c758db06bc10 Signed-off-by: Lajos Molnar Bug: 10461617 --- media/java/android/media/MediaCodec.java | 12 +++++++----- media/java/android/media/MediaFormat.java | 11 ++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'media') diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 1250cbc..5175830 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -20,7 +20,9 @@ import android.media.MediaCodecInfo; import android.media.MediaCodecList; import android.media.MediaCrypto; import android.media.MediaFormat; +import android.os.Bundle; import android.view.Surface; + import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Map; @@ -576,7 +578,7 @@ final public class MediaCodec { * Change a video encoder's target bitrate on the fly. The value is an * Integer object containing the new bitrate in bps. */ - public static final String PARAMETER_KEY_VIDEO_BITRATE = "videoBitrate"; + public static final String PARAMETER_KEY_VIDEO_BITRATE = "video-bitrate"; /** * Temporarily suspend/resume encoding of input data. While suspended @@ -598,7 +600,7 @@ final public class MediaCodec { /** * Communicate additional parameter changes to the component instance. */ - public final void setParameters(Map params) { + public final void setParameters(Bundle params) { if (params == null) { return; } @@ -607,9 +609,9 @@ final public class MediaCodec { Object[] values = new Object[params.size()]; int i = 0; - for (Map.Entry entry: params.entrySet()) { - keys[i] = entry.getKey(); - values[i] = entry.getValue(); + for (final String key: params.keySet()) { + keys[i] = key; + values[i] = params.get(key); ++i; } diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java index 16ae43d..313db20 100644 --- a/media/java/android/media/MediaFormat.java +++ b/media/java/android/media/MediaFormat.java @@ -85,8 +85,8 @@ public final class MediaFormat { public static final String KEY_MIME = "mime"; /** - * A key describing the language of the content. - * The associated value is a string. + * A key describing the language of the content, using either ISO 639-1 + * or 639-2/T codes. The associated value is a string. */ public static final String KEY_LANGUAGE = "language"; @@ -370,9 +370,10 @@ public final class MediaFormat { /** * 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.) + * @param language The language of the content, using either ISO 639-1 or 639-2/T + * codes. Specify null or "und" if language information is only included + * in the content. (This will also work if there are multiple language + * tracks in the content.) */ public static final MediaFormat createSubtitleFormat( String mime, -- cgit v1.1