audio: add AudioFormat.ENCODING_DTS
Bug: 18292317 Change-Id: I457a6996947d6d24ef7f8f152ee586029036acf5 Signed-off-by: Phil Burk <philburk@google.com>
This commit is contained in:
@@ -14420,6 +14420,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
|
||||
|
||||
@@ -15609,6 +15609,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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user