diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2018-12-23 11:40:19 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-12-28 15:09:41 -0300 |
commit | 3ed15179dee363ef281456445df143021dec994c (patch) | |
tree | fb0c7f1f4c2653527cd5c0f9c0ca34d82641fdb2 /profiles | |
parent | 338bc55c7a1a34e3d8c3afeba1283249cb5930dd (diff) | |
download | bluez-3ed15179dee363ef281456445df143021dec994c.tar.gz |
a2dp-codecs: Properly define macros and struct for LDAC codec
Diffstat (limited to 'profiles')
-rw-r--r-- | profiles/audio/a2dp-codecs.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/profiles/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h index 649e2411b..6f667d3aa 100644 --- a/profiles/audio/a2dp-codecs.h +++ b/profiles/audio/a2dp-codecs.h @@ -200,6 +200,17 @@ #define LDAC_VENDOR_ID 0x0000012d #define LDAC_CODEC_ID 0x00aa +#define LDAC_SAMPLING_FREQ_44100 0x20 +#define LDAC_SAMPLING_FREQ_48000 0x10 +#define LDAC_SAMPLING_FREQ_88200 0x08 +#define LDAC_SAMPLING_FREQ_96000 0x04 +#define LDAC_SAMPLING_FREQ_176400 0x02 +#define LDAC_SAMPLING_FREQ_192000 0x01 + +#define LDAC_CHANNEL_MODE_MONO 0x04 +#define LDAC_CHANNEL_MODE_DUAL 0x02 +#define LDAC_CHANNEL_MODE_STEREO 0x01 + typedef struct { uint8_t vendor_id4; uint8_t vendor_id3; @@ -225,6 +236,12 @@ typedef struct { .codec_id1 = (((c) >> 8) & 0xff), \ }) +typedef struct { + a2dp_vendor_codec_t info; + uint8_t frequency; + uint8_t channel_mode; +} __attribute__ ((packed)) a2dp_ldac_t; + #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ __BYTE_ORDER == __LITTLE_ENDIAN @@ -268,11 +285,6 @@ typedef struct { uint8_t frequency:4; } __attribute__ ((packed)) a2dp_aptx_t; -typedef struct { - a2dp_vendor_codec_t info; - uint8_t unknown[2]; -} __attribute__ ((packed)) a2dp_ldac_t; - #elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ __BYTE_ORDER == __BIG_ENDIAN @@ -316,11 +328,6 @@ typedef struct { uint8_t channel_mode:4; } __attribute__ ((packed)) a2dp_aptx_t; -typedef struct { - a2dp_vendor_codec_t info; - uint8_t unknown[2]; -} __attribute__ ((packed)) a2dp_ldac_t; - #else #error "Unknown byte order" #endif |