Loading apex/media/framework/java/android/media/MediaParser.java +28 −2 Original line number Original line Diff line number Diff line Loading @@ -484,6 +484,31 @@ public final class MediaParser { // MediaParser parameters. // MediaParser parameters. /** @hide */ @Retention(RetentionPolicy.SOURCE) @StringDef( prefix = {"PARAMETER_"}, value = { PARAMETER_ADTS_ENABLE_CBR_SEEKING, PARAMETER_AMR_ENABLE_CBR_SEEKING, PARAMETER_FLAC_DISABLE_ID3, PARAMETER_MP4_IGNORE_EDIT_LISTS, PARAMETER_MP4_IGNORE_TFDT_BOX, PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES, PARAMETER_MATROSKA_DISABLE_CUES_SEEKING, PARAMETER_MP3_DISABLE_ID3, PARAMETER_MP3_ENABLE_CBR_SEEKING, PARAMETER_MP3_ENABLE_INDEX_SEEKING, PARAMETER_TS_MODE, PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES, PARAMETER_TS_IGNORE_AAC_STREAM, PARAMETER_TS_IGNORE_AVC_STREAM, PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM, PARAMETER_TS_DETECT_ACCESS_UNITS, PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS }) public @interface ParameterName {} /** /** * Sets whether constant bitrate seeking should be enabled for ADTS parsing. {@code boolean} * Sets whether constant bitrate seeking should be enabled for ADTS parsing. {@code boolean} * expected. Default value is {@code false}. * expected. Default value is {@code false}. Loading Loading @@ -701,7 +726,8 @@ public final class MediaParser { * @throws IllegalStateException If called after calling {@link #advance} on the same instance. * @throws IllegalStateException If called after calling {@link #advance} on the same instance. */ */ @NonNull @NonNull public MediaParser setParameter(@NonNull String parameterName, @NonNull Object value) { public MediaParser setParameter( @NonNull @ParameterName String parameterName, @NonNull Object value) { if (mExtractor != null) { if (mExtractor != null) { throw new IllegalStateException( throw new IllegalStateException( "setParameters() must be called before the first advance() call."); "setParameters() must be called before the first advance() call."); Loading Loading @@ -729,7 +755,7 @@ public final class MediaParser { * constants. * constants. * @return Whether the given {@code parameterName} is supported. * @return Whether the given {@code parameterName} is supported. */ */ public boolean supportsParameter(@NonNull String parameterName) { public boolean supportsParameter(@NonNull @ParameterName String parameterName) { return EXPECTED_TYPE_BY_PARAMETER_NAME.containsKey(parameterName); return EXPECTED_TYPE_BY_PARAMETER_NAME.containsKey(parameterName); } } Loading Loading
apex/media/framework/java/android/media/MediaParser.java +28 −2 Original line number Original line Diff line number Diff line Loading @@ -484,6 +484,31 @@ public final class MediaParser { // MediaParser parameters. // MediaParser parameters. /** @hide */ @Retention(RetentionPolicy.SOURCE) @StringDef( prefix = {"PARAMETER_"}, value = { PARAMETER_ADTS_ENABLE_CBR_SEEKING, PARAMETER_AMR_ENABLE_CBR_SEEKING, PARAMETER_FLAC_DISABLE_ID3, PARAMETER_MP4_IGNORE_EDIT_LISTS, PARAMETER_MP4_IGNORE_TFDT_BOX, PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES, PARAMETER_MATROSKA_DISABLE_CUES_SEEKING, PARAMETER_MP3_DISABLE_ID3, PARAMETER_MP3_ENABLE_CBR_SEEKING, PARAMETER_MP3_ENABLE_INDEX_SEEKING, PARAMETER_TS_MODE, PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES, PARAMETER_TS_IGNORE_AAC_STREAM, PARAMETER_TS_IGNORE_AVC_STREAM, PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM, PARAMETER_TS_DETECT_ACCESS_UNITS, PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS }) public @interface ParameterName {} /** /** * Sets whether constant bitrate seeking should be enabled for ADTS parsing. {@code boolean} * Sets whether constant bitrate seeking should be enabled for ADTS parsing. {@code boolean} * expected. Default value is {@code false}. * expected. Default value is {@code false}. Loading Loading @@ -701,7 +726,8 @@ public final class MediaParser { * @throws IllegalStateException If called after calling {@link #advance} on the same instance. * @throws IllegalStateException If called after calling {@link #advance} on the same instance. */ */ @NonNull @NonNull public MediaParser setParameter(@NonNull String parameterName, @NonNull Object value) { public MediaParser setParameter( @NonNull @ParameterName String parameterName, @NonNull Object value) { if (mExtractor != null) { if (mExtractor != null) { throw new IllegalStateException( throw new IllegalStateException( "setParameters() must be called before the first advance() call."); "setParameters() must be called before the first advance() call."); Loading Loading @@ -729,7 +755,7 @@ public final class MediaParser { * constants. * constants. * @return Whether the given {@code parameterName} is supported. * @return Whether the given {@code parameterName} is supported. */ */ public boolean supportsParameter(@NonNull String parameterName) { public boolean supportsParameter(@NonNull @ParameterName String parameterName) { return EXPECTED_TYPE_BY_PARAMETER_NAME.containsKey(parameterName); return EXPECTED_TYPE_BY_PARAMETER_NAME.containsKey(parameterName); } } Loading