diff options
author | Preetam Singh Ranawat <apranawat@codeaurora.org> | 2015-07-20 13:35:14 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:29:22 -0600 |
commit | 29f425beecb6b306e225c39ce9f015d1638ecb0c (patch) | |
tree | 4d3d869c57ba4383d53d0d8da18d2e1338260a1d /audio/include | |
parent | de5abe4649e4bdf701060995a2f6ec3732090a50 (diff) | |
download | android_system_media-29f425beecb6b306e225c39ce9f015d1638ecb0c.tar.gz android_system_media-29f425beecb6b306e225c39ce9f015d1638ecb0c.tar.bz2 android_system_media-29f425beecb6b306e225c39ce9f015d1638ecb0c.zip |
audio : Add PCM offload formats
-add 16 and 24 bit PCM offlaod formats
Change-Id: Ib4229440dc362905753ef8e6444cbf0940fca885
Diffstat (limited to 'audio/include')
-rw-r--r-- | audio/include/system/audio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/audio/include/system/audio.h b/audio/include/system/audio.h index 922a90d4..eb9635a0 100644 --- a/audio/include/system/audio.h +++ b/audio/include/system/audio.h @@ -254,6 +254,7 @@ typedef enum { AUDIO_FORMAT_AMR_NB = 0x02000000UL, AUDIO_FORMAT_AMR_WB = 0x03000000UL, AUDIO_FORMAT_AAC = 0x04000000UL, + AUDIO_FORMAT_PCM_OFFLOAD = 0x1C000000UL, AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL, /* Deprecated, Use AUDIO_FORMAT_AAC_HE_V1*/ AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL, /* Deprecated, Use AUDIO_FORMAT_AAC_HE_V2*/ AUDIO_FORMAT_VORBIS = 0x07000000UL, @@ -301,6 +302,11 @@ typedef enum { AUDIO_FORMAT_AAC_SUB_HE_V2), AUDIO_FORMAT_AAC_ELD = (AUDIO_FORMAT_AAC | AUDIO_FORMAT_AAC_SUB_ELD), + /*Offload PCM formats*/ + AUDIO_FORMAT_PCM_16_BIT_OFFLOAD = (AUDIO_FORMAT_PCM_OFFLOAD | + AUDIO_FORMAT_PCM_SUB_16_BIT), + AUDIO_FORMAT_PCM_24_BIT_OFFLOAD = (AUDIO_FORMAT_PCM_OFFLOAD | + AUDIO_FORMAT_PCM_SUB_8_24_BIT), } audio_format_t; /* For the channel mask for position assignment representation */ @@ -1371,6 +1377,12 @@ static inline bool audio_is_valid_format(audio_format_t format) case AUDIO_FORMAT_DTS: case AUDIO_FORMAT_DTS_HD: return true; + case AUDIO_FORMAT_PCM_OFFLOAD: + if (format != AUDIO_FORMAT_PCM_16_BIT_OFFLOAD && + format != AUDIO_FORMAT_PCM_24_BIT_OFFLOAD) { + return false; + } + return true; default: return false; } @@ -1388,12 +1400,14 @@ static inline size_t audio_bytes_per_sample(audio_format_t format) switch (format) { case AUDIO_FORMAT_PCM_32_BIT: case AUDIO_FORMAT_PCM_8_24_BIT: + case AUDIO_FORMAT_PCM_24_BIT_OFFLOAD: size = sizeof(int32_t); break; case AUDIO_FORMAT_PCM_24_BIT_PACKED: size = sizeof(uint8_t) * 3; break; case AUDIO_FORMAT_PCM_16_BIT: + case AUDIO_FORMAT_PCM_16_BIT_OFFLOAD: size = sizeof(int16_t); break; case AUDIO_FORMAT_PCM_8_BIT: |