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

Commit 51ce5c16 authored by Phil Burk's avatar Phil Burk Committed by Android (Google) Code Review
Browse files

Merge "audio: add AudioFormat.ENCODING_DTS"

parents 456432ea e12189de
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14456,6 +14456,8 @@ package android.media {
    field public static final int CHANNEL_OUT_SURROUND = 1052; // 0x41c
    field public static final int ENCODING_AC3 = 5; // 0x5
    field public static final int ENCODING_DEFAULT = 1; // 0x1
    field public static final int ENCODING_DTS = 7; // 0x7
    field public static final int ENCODING_DTS_HD = 8; // 0x8
    field public static final int ENCODING_E_AC3 = 6; // 0x6
    field public static final int ENCODING_INVALID = 0; // 0x0
    field public static final int ENCODING_PCM_16BIT = 2; // 0x2
+2 −0
Original line number Diff line number Diff line
@@ -15652,6 +15652,8 @@ package android.media {
    field public static final int CHANNEL_OUT_SURROUND = 1052; // 0x41c
    field public static final int ENCODING_AC3 = 5; // 0x5
    field public static final int ENCODING_DEFAULT = 1; // 0x1
    field public static final int ENCODING_DTS = 7; // 0x7
    field public static final int ENCODING_DTS_HD = 8; // 0x8
    field public static final int ENCODING_E_AC3 = 6; // 0x6
    field public static final int ENCODING_INVALID = 0; // 0x0
    field public static final int ENCODING_PCM_16BIT = 2; // 0x2
+10 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#define ENCODING_PCM_FLOAT  4
#define ENCODING_AC3        5
#define ENCODING_E_AC3      6
#define ENCODING_DTS        7
#define ENCODING_DTS_HD     8
#define ENCODING_INVALID    0
#define ENCODING_DEFAULT    1

@@ -46,6 +48,10 @@ static inline audio_format_t audioFormatToNative(int audioFormat)
        return AUDIO_FORMAT_AC3;
    case ENCODING_E_AC3:
        return AUDIO_FORMAT_E_AC3;
    case ENCODING_DTS:
        return AUDIO_FORMAT_DTS;
    case ENCODING_DTS_HD:
        return AUDIO_FORMAT_DTS_HD;
    case ENCODING_DEFAULT:
        return AUDIO_FORMAT_DEFAULT;
    default:
@@ -66,6 +72,10 @@ static inline int audioFormatFromNative(audio_format_t nativeFormat)
        return ENCODING_AC3;
    case AUDIO_FORMAT_E_AC3:
        return ENCODING_E_AC3;
    case AUDIO_FORMAT_DTS:
        return ENCODING_DTS;
    case AUDIO_FORMAT_DTS_HD:
        return ENCODING_DTS_HD;
    case AUDIO_FORMAT_DEFAULT:
        return ENCODING_DEFAULT;
    default:
+16 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public class AudioFormat {
    public static final int ENCODING_DEFAULT = 1;

    // These values must be kept in sync with core/jni/android_media_AudioFormat.h
    // Also sync av/services/audiopolicy/managerdefault/ConfigParsingUtils.h
    /** Audio data format: PCM 16 bit per sample. Guaranteed to be supported by devices. */
    public static final int ENCODING_PCM_16BIT = 2;
    /** Audio data format: PCM 8 bit per sample. Not guaranteed to be supported by devices. */
@@ -48,6 +49,10 @@ public class AudioFormat {
    public static final int ENCODING_AC3 = 5;
    /** Audio data format: E-AC-3 compressed */
    public static final int ENCODING_E_AC3 = 6;
    /** Audio data format: DTS compressed */
    public static final int ENCODING_DTS = 7;
    /** Audio data format: DTS HD compressed */
    public static final int ENCODING_DTS_HD = 8;

    /** Invalid audio channel configuration */
    /** @deprecated use CHANNEL_INVALID instead  */
@@ -235,6 +240,8 @@ public class AudioFormat {
        case ENCODING_PCM_FLOAT:
        case ENCODING_AC3:
        case ENCODING_E_AC3:
        case ENCODING_DTS:
        case ENCODING_DTS_HD:
            return true;
        default:
            return false;
@@ -252,6 +259,8 @@ public class AudioFormat {
            return true;
        case ENCODING_AC3:
        case ENCODING_E_AC3:
        case ENCODING_DTS:
        case ENCODING_DTS_HD:
            return false;
        case ENCODING_INVALID:
        default:
@@ -400,6 +409,8 @@ public class AudioFormat {
         *     {@link AudioFormat#ENCODING_PCM_FLOAT},
         *     {@link AudioFormat#ENCODING_AC3},
         *     {@link AudioFormat#ENCODING_E_AC3}.
         *     {@link AudioFormat#ENCODING_DTS},
         *     {@link AudioFormat#ENCODING_DTS_HD}.
         * @return the same Builder instance.
         * @throws java.lang.IllegalArgumentException
         */
@@ -413,6 +424,8 @@ public class AudioFormat {
                case ENCODING_PCM_FLOAT:
                case ENCODING_AC3:
                case ENCODING_E_AC3:
                case ENCODING_DTS:
                case ENCODING_DTS_HD:
                    mEncoding = encoding;
                    break;
                case ENCODING_INVALID:
@@ -478,7 +491,9 @@ public class AudioFormat {
        ENCODING_PCM_16BIT,
        ENCODING_PCM_FLOAT,
        ENCODING_AC3,
        ENCODING_E_AC3
        ENCODING_E_AC3,
        ENCODING_DTS,
        ENCODING_DTS_HD
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface Encoding {}