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

Commit dd73142b authored by Phil Burk's avatar Phil Burk
Browse files

AudioTrack: Add FLAG_LOW_LATENCY



Allow Java to write directly to the FastMixer to
reduce latency.

Change-Id: I957c82ba430e7ee2780ea00ea96c1f5b23dc47f5
Bug: 21019153
Signed-off-by: default avatarPhil Burk <philburk@google.com>
parent e5480cc5
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -223,10 +223,19 @@ public final class AudioAttributes implements Parcelable {
    @SystemApi
    public final static int FLAG_BYPASS_MUTE = 0x1 << 7;

    /**
     * @hide
     * Flag requesting a low latency path.
     * When using this flag, the sample rate must match the native sample rate
     * of the device. Effects processing is also unavailable.
     */
    public final static int FLAG_LOW_LATENCY = 0x1 << 8;

    private final static int FLAG_ALL = FLAG_AUDIBILITY_ENFORCED | FLAG_SECURE | FLAG_SCO |
            FLAG_BEACON | FLAG_HW_AV_SYNC | FLAG_HW_HOTWORD | FLAG_BYPASS_INTERRUPTION_POLICY |
            FLAG_BYPASS_MUTE;
    private final static int FLAG_ALL_PUBLIC = FLAG_AUDIBILITY_ENFORCED | FLAG_HW_AV_SYNC;
            FLAG_BYPASS_MUTE | FLAG_LOW_LATENCY;
    private final static int FLAG_ALL_PUBLIC = FLAG_AUDIBILITY_ENFORCED |
            FLAG_HW_AV_SYNC | FLAG_LOW_LATENCY;

    private int mUsage = USAGE_UNKNOWN;
    private int mContentType = CONTENT_TYPE_UNKNOWN;