10#ifndef BLUEZQT_A2DPCODECS_H
11#define BLUEZQT_A2DPCODECS_H
18#define A2DP_CODEC_SBC 0x00
19#define A2DP_CODEC_MPEG12 0x01
20#define A2DP_CODEC_MPEG24 0x02
21#define A2DP_CODEC_ATRAC 0x04
22#define A2DP_CODEC_VENDOR 0xFF
24#define SBC_SAMPLING_FREQ_16000 (1 << 3)
25#define SBC_SAMPLING_FREQ_32000 (1 << 2)
26#define SBC_SAMPLING_FREQ_44100 (1 << 1)
27#define SBC_SAMPLING_FREQ_48000 1
29#define SBC_CHANNEL_MODE_MONO (1 << 3)
30#define SBC_CHANNEL_MODE_DUAL_CHANNEL (1 << 2)
31#define SBC_CHANNEL_MODE_STEREO (1 << 1)
32#define SBC_CHANNEL_MODE_JOINT_STEREO 1
34#define SBC_BLOCK_LENGTH_4 (1 << 3)
35#define SBC_BLOCK_LENGTH_8 (1 << 2)
36#define SBC_BLOCK_LENGTH_12 (1 << 1)
37#define SBC_BLOCK_LENGTH_16 1
39#define SBC_SUBBANDS_4 (1 << 1)
40#define SBC_SUBBANDS_8 1
42#define SBC_ALLOCATION_SNR (1 << 1)
43#define SBC_ALLOCATION_LOUDNESS 1
48#define MPEG_CHANNEL_MODE_MONO (1 << 3)
49#define MPEG_CHANNEL_MODE_DUAL_CHANNEL (1 << 2)
50#define MPEG_CHANNEL_MODE_STEREO (1 << 1)
51#define MPEG_CHANNEL_MODE_JOINT_STEREO 1
53#define MPEG_LAYER_MP1 (1 << 2)
54#define MPEG_LAYER_MP2 (1 << 1)
55#define MPEG_LAYER_MP3 1
57#define MPEG_SAMPLING_FREQ_16000 (1 << 5)
58#define MPEG_SAMPLING_FREQ_22050 (1 << 4)
59#define MPEG_SAMPLING_FREQ_24000 (1 << 3)
60#define MPEG_SAMPLING_FREQ_32000 (1 << 2)
61#define MPEG_SAMPLING_FREQ_44100 (1 << 1)
62#define MPEG_SAMPLING_FREQ_48000 1
64#define MPEG_BIT_RATE_VBR 0x8000
65#define MPEG_BIT_RATE_320000 0x4000
66#define MPEG_BIT_RATE_256000 0x2000
67#define MPEG_BIT_RATE_224000 0x1000
68#define MPEG_BIT_RATE_192000 0x0800
69#define MPEG_BIT_RATE_160000 0x0400
70#define MPEG_BIT_RATE_128000 0x0200
71#define MPEG_BIT_RATE_112000 0x0100
72#define MPEG_BIT_RATE_96000 0x0080
73#define MPEG_BIT_RATE_80000 0x0040
74#define MPEG_BIT_RATE_64000 0x0020
75#define MPEG_BIT_RATE_56000 0x0010
76#define MPEG_BIT_RATE_48000 0x0008
77#define MPEG_BIT_RATE_40000 0x0004
78#define MPEG_BIT_RATE_32000 0x0002
79#define MPEG_BIT_RATE_FREE 0x0001
81#define AAC_OBJECT_TYPE_MPEG2_AAC_LC 0x80
82#define AAC_OBJECT_TYPE_MPEG4_AAC_LC 0x40
83#define AAC_OBJECT_TYPE_MPEG4_AAC_LTP 0x20
84#define AAC_OBJECT_TYPE_MPEG4_AAC_SCA 0x10
86#define AAC_SAMPLING_FREQ_8000 0x0800
87#define AAC_SAMPLING_FREQ_11025 0x0400
88#define AAC_SAMPLING_FREQ_12000 0x0200
89#define AAC_SAMPLING_FREQ_16000 0x0100
90#define AAC_SAMPLING_FREQ_22050 0x0080
91#define AAC_SAMPLING_FREQ_24000 0x0040
92#define AAC_SAMPLING_FREQ_32000 0x0020
93#define AAC_SAMPLING_FREQ_44100 0x0010
94#define AAC_SAMPLING_FREQ_48000 0x0008
95#define AAC_SAMPLING_FREQ_64000 0x0004
96#define AAC_SAMPLING_FREQ_88200 0x0002
97#define AAC_SAMPLING_FREQ_96000 0x0001
99#define AAC_CHANNELS_1 0x02
100#define AAC_CHANNELS_2 0x01
102#define AAC_GET_BITRATE(a) ((a).bitrate1 << 16 | \
103 (a).bitrate2 << 8 | (a).bitrate3)
104#define AAC_GET_FREQUENCY(a) ((a).frequency1 << 4 | (a).frequency2)
106#define AAC_SET_BITRATE(a, b) \
108 (a).bitrate1 = (b >> 16) & 0x7f; \
109 (a).bitrate2 = (b >> 8) & 0xff; \
110 (a).bitrate3 = b & 0xff; \
112#define AAC_SET_FREQUENCY(a, f) \
114 (a).frequency1 = (f >> 4) & 0xff; \
115 (a).frequency2 = f & 0x0f; \
118#define AAC_INIT_BITRATE(b) \
119 .bitrate1 = (b >> 16) & 0x7f, \
120 .bitrate2 = (b >> 8) & 0xff, \
121 .bitrate3 = b & 0xff,
122#define AAC_INIT_FREQUENCY(f) \
123 .frequency1 = (f >> 4) & 0xff, \
124 .frequency2 = f & 0x0f,
126#define APTX_VENDOR_ID 0x0000004f
127#define APTX_CODEC_ID 0x0001
129#define APTX_CHANNEL_MODE_MONO 0x01
130#define APTX_CHANNEL_MODE_STEREO 0x02
132#define APTX_SAMPLING_FREQ_16000 0x08
133#define APTX_SAMPLING_FREQ_32000 0x04
134#define APTX_SAMPLING_FREQ_44100 0x02
135#define APTX_SAMPLING_FREQ_48000 0x01
137#define LDAC_VENDOR_ID 0x0000012d
138#define LDAC_CODEC_ID 0x00aa
143} __attribute__ ((packed)) a2dp_vendor_codec_t;
145#if __BYTE_ORDER == __LITTLE_ENDIAN
148 uint8_t channel_mode:4;
150 uint8_t allocation_method:2;
152 uint8_t block_length:4;
155} __attribute__ ((packed)) a2dp_sbc_t;
158 uint8_t channel_mode:4;
165} __attribute__ ((packed)) a2dp_mpeg_t;
172 uint8_t frequency2:4;
177} __attribute__ ((packed)) a2dp_aac_t;
180 a2dp_vendor_codec_t info;
181 uint8_t channel_mode:4;
183} __attribute__ ((packed)) a2dp_aptx_t;
186 a2dp_vendor_codec_t info;
188} __attribute__ ((packed)) a2dp_ldac_t;
190#elif __BYTE_ORDER == __BIG_ENDIAN
194 uint8_t channel_mode:4;
195 uint8_t block_length:4;
197 uint8_t allocation_method:2;
200} __attribute__ ((packed)) a2dp_sbc_t;
205 uint8_t channel_mode:4;
210} __attribute__ ((packed)) a2dp_mpeg_t;
215 uint8_t frequency2:4;
222} __attribute__ ((packed)) a2dp_aac_t;
225 a2dp_vendor_codec_t info;
227 uint8_t channel_mode:4;
228} __attribute__ ((packed)) a2dp_aptx_t;
231 a2dp_vendor_codec_t info;
233} __attribute__ ((packed)) a2dp_ldac_t;
236#error "Unknown byte order"
243#include "bluezqt_export.h"
245BLUEZQT_EXPORT
extern const a2dp_sbc_t sbcCapabilities;
246BLUEZQT_EXPORT
extern const a2dp_aac_t aacCapabilities;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:08 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.