Merge "Add the "enable emsg" flag" into rvc-dev am: 73113a6997

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11986788

Change-Id: Ie776c345fe23dc929fb08deeb85c004d73c66e31
This commit is contained in:
TreeHugger Robot
2020-06-25 21:24:22 +00:00
committed by Automerger Merge Worker

View File

@@ -870,6 +870,14 @@ public final class MediaParser {
*/
public static final String PARAMETER_OVERRIDE_IN_BAND_CAPTION_DECLARATIONS =
"android.media.mediaParser.overrideInBandCaptionDeclarations";
/**
* Sets whether a track for EMSG events should be exposed in case of parsing a container that
* supports them. {@code boolean} expected. Default value is {@link false}.
*
* @hide
*/
public static final String PARAMETER_EXPOSE_EMSG_TRACK =
"android.media.mediaParser.exposeEmsgTrack";
// Private constants.
@@ -1309,6 +1317,10 @@ public final class MediaParser {
: 0;
return new MatroskaExtractor(flags);
case PARSER_NAME_FMP4:
flags |=
getBooleanParameter(PARAMETER_EXPOSE_EMSG_TRACK)
? FragmentedMp4Extractor.FLAG_ENABLE_EMSG_TRACK
: 0;
flags |=
getBooleanParameter(PARAMETER_MP4_IGNORE_EDIT_LISTS)
? FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS
@@ -2108,6 +2120,7 @@ public final class MediaParser {
PARAMETER_EXPOSE_CHUNK_INDEX_AS_MEDIA_FORMAT, Boolean.class);
expectedTypeByParameterName.put(
PARAMETER_OVERRIDE_IN_BAND_CAPTION_DECLARATIONS, Boolean.class);
expectedTypeByParameterName.put(PARAMETER_EXPOSE_EMSG_TRACK, Boolean.class);
// We do not check PARAMETER_EXPOSE_CAPTION_FORMATS here, and we do it in setParameters
// instead. Checking that the value is a List is insufficient to catch wrong parameter
// value types.