Skip to content
Snippets Groups Projects
Commit 40eac6ed authored by Arun Johnson's avatar Arun Johnson
Browse files

Adding MediaFormat keys for large frame audio

Bug: 298052174

Change-Id: I369affbb103cbf860a2fabfc1b85f0c44750ed82
parent b87d24f3
No related branches found
No related tags found
No related merge requests found
...@@ -23603,6 +23603,8 @@ package android.media { ...@@ -23603,6 +23603,8 @@ package android.media {
field public static final String KEY_AUDIO_SESSION_ID = "audio-session-id"; field public static final String KEY_AUDIO_SESSION_ID = "audio-session-id";
field public static final String KEY_BITRATE_MODE = "bitrate-mode"; field public static final String KEY_BITRATE_MODE = "bitrate-mode";
field public static final String KEY_BIT_RATE = "bitrate"; field public static final String KEY_BIT_RATE = "bitrate";
field @FlaggedApi("com.android.media.codec.flags.large_audio_frame") public static final String KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE = "buffer-batch-max-output-size";
field @FlaggedApi("com.android.media.codec.flags.large_audio_frame") public static final String KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE = "buffer-batch-threshold-output-size";
field public static final String KEY_CAPTION_SERVICE_NUMBER = "caption-service-number"; field public static final String KEY_CAPTION_SERVICE_NUMBER = "caption-service-number";
field public static final String KEY_CAPTURE_RATE = "capture-rate"; field public static final String KEY_CAPTURE_RATE = "capture-rate";
field public static final String KEY_CHANNEL_COUNT = "channel-count"; field public static final String KEY_CHANNEL_COUNT = "channel-count";
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package android.media; package android.media;
import static com.android.media.codec.flags.Flags.FLAG_CODEC_IMPORTANCE; import static com.android.media.codec.flags.Flags.FLAG_CODEC_IMPORTANCE;
import static com.android.media.codec.flags.Flags.FLAG_LARGE_AUDIO_FRAME;
import android.annotation.FlaggedApi; import android.annotation.FlaggedApi;
import android.annotation.IntDef; import android.annotation.IntDef;
...@@ -121,6 +122,10 @@ import java.util.stream.Collectors; ...@@ -121,6 +122,10 @@ import java.util.stream.Collectors;
* <tr><td>{@link #KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT}</td> * <tr><td>{@link #KEY_MPEGH_REFERENCE_CHANNEL_LAYOUT}</td>
* <td>Integer</td><td><b>decoder-only</b>, optional, if content is MPEG-H audio, * <td>Integer</td><td><b>decoder-only</b>, optional, if content is MPEG-H audio,
* specifies the preferred reference channel layout of the stream.</td></tr> * specifies the preferred reference channel layout of the stream.</td></tr>
* <tr><td>{@link #KEY_MAX_BUFFER_BATCH_OUTPUT_SIZE}</td><td>Integer</td><td>optional, used with
* large audio frame support, specifies max size of output buffer in bytes.</td></tr>
* <tr><td>{@link #KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE}</td><td>Integer</td><td>optional,
* used with large audio frame support, specifies threshold output size in bytes.</td></tr>
* </table> * </table>
* *
* Subtitle formats have the following keys: * Subtitle formats have the following keys:
...@@ -458,6 +463,50 @@ public final class MediaFormat { ...@@ -458,6 +463,50 @@ public final class MediaFormat {
*/ */
public static final String KEY_MAX_INPUT_SIZE = "max-input-size"; public static final String KEY_MAX_INPUT_SIZE = "max-input-size";
/**
* A key describing the maximum output buffer size in bytes when using
* large buffer mode containing multiple access units.
*
* When not-set - codec functions with one access-unit per frame.
* When set less than the size of two access-units - will make codec
* operate in single access-unit per output frame.
* When set to a value too big - The component or the framework will
* override this value to a reasonable max size not exceeding typical
* 10 seconds of data (device dependent) when set to a value larger than
* that. The value final value used will be returned in the output format.
*
* The associated value is an integer
*
* @see FEATURE_MultipleFrames
*/
@FlaggedApi(FLAG_LARGE_AUDIO_FRAME)
public static final String KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE = "buffer-batch-max-output-size";
/**
* A key describing the threshold output size in bytes when using large buffer
* mode containing multiple access units.
*
* This is an optional parameter.
*
* If not set - the component can set this to a reasonable value.
* If set larger than max size, the components will
* clip this setting to maximum buffer batching output size.
*
* The component will return a partial output buffer if the output buffer reaches or
* surpass this limit.
*
* Threshold size should be always less or equal to KEY_MAX_BUFFER_BATCH_OUTPUT_SIZE.
* The final setting of this value as determined by the component will be returned
* in the output format
*
* The associated value is an integer
*
* @see FEATURE_MultipleFrames
*/
@FlaggedApi(FLAG_LARGE_AUDIO_FRAME)
public static final String KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE =
"buffer-batch-threshold-output-size";
/** /**
* A key describing the pixel aspect ratio width. * A key describing the pixel aspect ratio width.
* The associated value is an integer * The associated value is an integer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment