Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa9d95ed authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add sample flags to MediaParser" into rvc-dev

parents 2c592f0d c648f4ec
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,11 @@ package android.media {
    field public static final String PARSER_NAME_TS = "android.media.mediaparser.TsParser";
    field public static final String PARSER_NAME_TS = "android.media.mediaparser.TsParser";
    field public static final String PARSER_NAME_UNKNOWN = "android.media.mediaparser.UNKNOWN";
    field public static final String PARSER_NAME_UNKNOWN = "android.media.mediaparser.UNKNOWN";
    field public static final String PARSER_NAME_WAV = "android.media.mediaparser.WavParser";
    field public static final String PARSER_NAME_WAV = "android.media.mediaparser.WavParser";
    field public static final int SAMPLE_FLAG_DECODE_ONLY = -2147483648; // 0x80000000
    field public static final int SAMPLE_FLAG_ENCRYPTED = 1073741824; // 0x40000000
    field public static final int SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA = 268435456; // 0x10000000
    field public static final int SAMPLE_FLAG_KEY_FRAME = 1; // 0x1
    field public static final int SAMPLE_FLAG_LAST_SAMPLE = 536870912; // 0x20000000
  }
  }


  public static interface MediaParser.InputReader {
  public static interface MediaParser.InputReader {
+28 −3
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@
package android.media;
package android.media;


import android.annotation.CheckResult;
import android.annotation.CheckResult;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.StringDef;
import android.annotation.StringDef;
@@ -391,8 +392,7 @@ public final class MediaParser {
         *
         *
         * @param trackIndex The index of the track to which the sample corresponds.
         * @param trackIndex The index of the track to which the sample corresponds.
         * @param timeMicros The media timestamp associated with the sample, in microseconds.
         * @param timeMicros The media timestamp associated with the sample, in microseconds.
         * @param flags Flags associated with the sample. See {@link MediaCodec
         * @param flags Flags associated with the sample. See the {@code SAMPLE_FLAG_*} constants.
         *     MediaCodec.BUFFER_FLAG_*}.
         * @param size The size of the sample data, in bytes.
         * @param size The size of the sample data, in bytes.
         * @param offset The number of bytes that have been consumed by {@code
         * @param offset The number of bytes that have been consumed by {@code
         *     onSampleDataFound(int, MediaParser.InputReader)} for the specified track, since the
         *     onSampleDataFound(int, MediaParser.InputReader)} for the specified track, since the
@@ -405,7 +405,7 @@ public final class MediaParser {
        void onSampleCompleted(
        void onSampleCompleted(
                int trackIndex,
                int trackIndex,
                long timeMicros,
                long timeMicros,
                int flags,
                @SampleFlags int flags,
                int size,
                int size,
                int offset,
                int offset,
                @Nullable CryptoInfo cryptoInfo);
                @Nullable CryptoInfo cryptoInfo);
@@ -449,6 +449,31 @@ public final class MediaParser {
        }
        }
    }
    }


    // Sample flags.

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(
            flag = true,
            value = {
                SAMPLE_FLAG_KEY_FRAME,
                SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA,
                SAMPLE_FLAG_LAST_SAMPLE,
                SAMPLE_FLAG_ENCRYPTED,
                SAMPLE_FLAG_DECODE_ONLY
            })
    public @interface SampleFlags {}
    /** Indicates that the sample holds a synchronization sample. */
    public static final int SAMPLE_FLAG_KEY_FRAME = MediaCodec.BUFFER_FLAG_KEY_FRAME;
    /** Indicates that the sample has supplemental data. */
    public static final int SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA = 1 << 28;
    /** Indicates that the sample is known to contain the last media sample of the stream. */
    public static final int SAMPLE_FLAG_LAST_SAMPLE = 1 << 29;
    /** Indicates that the sample is (at least partially) encrypted. */
    public static final int SAMPLE_FLAG_ENCRYPTED = 1 << 30;
    /** Indicates that the sample should be decoded but not rendered. */
    public static final int SAMPLE_FLAG_DECODE_ONLY = 1 << 31;

    // Parser implementation names.
    // Parser implementation names.


    /** @hide */
    /** @hide */
+5 −0
Original line number Original line Diff line number Diff line
@@ -26434,6 +26434,11 @@ package android.media {
    field public static final String PARSER_NAME_TS = "android.media.mediaparser.TsParser";
    field public static final String PARSER_NAME_TS = "android.media.mediaparser.TsParser";
    field public static final String PARSER_NAME_UNKNOWN = "android.media.mediaparser.UNKNOWN";
    field public static final String PARSER_NAME_UNKNOWN = "android.media.mediaparser.UNKNOWN";
    field public static final String PARSER_NAME_WAV = "android.media.mediaparser.WavParser";
    field public static final String PARSER_NAME_WAV = "android.media.mediaparser.WavParser";
    field public static final int SAMPLE_FLAG_DECODE_ONLY = -2147483648; // 0x80000000
    field public static final int SAMPLE_FLAG_ENCRYPTED = 1073741824; // 0x40000000
    field public static final int SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA = 268435456; // 0x10000000
    field public static final int SAMPLE_FLAG_KEY_FRAME = 1; // 0x1
    field public static final int SAMPLE_FLAG_LAST_SAMPLE = 536870912; // 0x20000000
  }
  }
  public static interface MediaParser.InputReader {
  public static interface MediaParser.InputReader {