diff options
author | Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl> | 2015-11-13 11:59:39 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-16 10:05:42 +0200 |
commit | 101b439a6a3815d0ffcaa86ac0b099ef9061778a (patch) | |
tree | 74ee062ede645e38ad31bc6d0ac624eede53571a | |
parent | 3e8b659270d9621968a77da96bd1bbe5de11d11f (diff) | |
download | bluez-101b439a6a3815d0ffcaa86ac0b099ef9061778a.tar.gz |
tools/avinfo: Add partial support for Sony LDAC
Contents of Vendor Specific Value in codec information is unknown at
the moment so only raw value is printed.
-rw-r--r-- | profiles/audio/a2dp-codecs.h | 8 | ||||
-rw-r--r-- | tools/avinfo.c | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/profiles/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h index 4d2584d0a..e9da0bf8d 100644 --- a/profiles/audio/a2dp-codecs.h +++ b/profiles/audio/a2dp-codecs.h @@ -141,6 +141,9 @@ #define APTX_SAMPLING_FREQ_44100 0x02 #define APTX_SAMPLING_FREQ_48000 0x01 +#define LDAC_VENDOR_ID 0x0000012d +#define LDAC_CODEC_ID 0x00aa + typedef struct { uint32_t vendor_id; uint16_t codec_id; @@ -186,6 +189,11 @@ 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 __BYTE_ORDER == __BIG_ENDIAN typedef struct { diff --git a/tools/avinfo.c b/tools/avinfo.c index 3f406ca1e..cc756f101 100644 --- a/tools/avinfo.c +++ b/tools/avinfo.c @@ -181,6 +181,16 @@ static void print_aptx(a2dp_aptx_t *aptx) printf("\n"); } +static void print_ldac(a2dp_ldac_t *ldac) +{ + printf("\t\tVendor Specific Value (LDAC)"); + + printf("\n\t\t\tUnknown: %02x %02x", ldac->unknown[0], + ldac->unknown[1]); + + printf("\n"); +} + static void print_vendor(a2dp_vendor_codec_t *vendor) { uint32_t vendor_id = btohl(vendor->vendor_id); @@ -194,6 +204,8 @@ static void print_vendor(a2dp_vendor_codec_t *vendor) if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID) print_aptx((void *) vendor); + else if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID) + print_ldac((void *) vendor); } static void print_mpeg24(a2dp_aac_t *aac) |