Developer World
Spresense SDK Library v3.3.0-375c679
bt_a2dp_codecs.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/bluetooth/bt_a2dp_codecs.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
45#ifndef __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H
46#define __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H
47
48/****************************************************************************
49 * Included Files
50 ****************************************************************************/
51
52#include <stdint.h>
53
54/****************************************************************************
55 * Pre-processor Definitions
56 ****************************************************************************/
57
62#define CODEC_INFO_MAX_LENGTH 20
65/****************************************************************************
66 * Public Types
67 ****************************************************************************/
68
71typedef enum
72{
74 BT_A2DP_SINK_CODEC_AAC = 1 << 2,
77
80typedef enum
81{
85
88typedef enum
89{
90 BT_A2DP_SAMPLE_FREQ_8000HZ,
91 BT_A2DP_SAMPLE_FREQ_11000HZ,
92 BT_A2DP_SAMPLE_FREQ_12000HZ,
93 BT_A2DP_SAMPLE_FREQ_16000HZ,
94 BT_A2DP_SAMPLE_FREQ_22050HZ,
95 BT_A2DP_SAMPLE_FREQ_24000HZ,
96 BT_A2DP_SAMPLE_FREQ_32000HZ,
97 BT_A2DP_SAMPLE_FREQ_44100HZ,
98 BT_A2DP_SAMPLE_FREQ_48000HZ,
99 BT_A2DP_SAMPLE_FREQ_64000HZ,
100 BT_A2DP_SAMPLE_FREQ_88000HZ,
101 BT_A2DP_SAMPLE_FREQ_96000HZ
103
106typedef enum
107{
108 BT_A2DP_CHANNEL_MONO,
109 BT_A2DP_CHANNEL_DUAL,
110 BT_A2DP_CHANNEL_STEREO,
111 BT_A2DP_CHANNEL_JOINTSTEREO
113
116typedef enum
117{
118 BT_A2DP_CHANNEL_SNR,
119 BT_A2DP_CHANNEL_LOUDNESS
121
139typedef struct
140{
141 BT_A2DP_SAMPLE_FREQ sampFreq;
143 uint8_t blockLen;
144 uint8_t numSubbands;
145 BT_A2DP_SBC_ALLOC_MODE allocMthd;
146 uint8_t maxBitpool;
147 uint8_t minBitpool;
149
150
153typedef enum
154{
155 BT_A2DP_MPEG2_AAC_LC,
156 BT_A2DP_MPEG4_AAC_LC,
157 BT_A2DP_MPEG4_AAC_LTP,
158 BT_A2DP_MPEG4_AAC_SSR
160
175typedef struct
176{
177 BT_A2DP_AAC_PROFILE profile;
178 BT_A2DP_SAMPLE_FREQ sampFreq;
180 uint8_t isVbrSupported;
181 uint32_t bitrate;
183
186typedef struct
187{
188 uint8_t codecInfoLength;
189 uint8_t codecInfo[CODEC_INFO_MAX_LENGTH];
191
194typedef struct
195{
196 BT_A2DP_CODEC_TYPE codecId;
197 union
198 {
202 } codec_info;
203 BT_A2DP_TRANSFER_TYPE transfer_type;
205
206#endif /* __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H */
BT_A2DP_SBC_ALLOC_MODE
Masks for supported allocation method.
Definition: bt_a2dp_codecs.h:117
BT_A2DP_TRANSFER_TYPE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:81
@ BT_A2DP_SINK_PACKET_TRANSFER
Definition: bt_a2dp_codecs.h:83
@ BT_A2DP_SINK_DIRECT_TRANSFER
Definition: bt_a2dp_codecs.h:82
BT_A2DP_CODEC_TYPE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:72
@ BT_A2DP_SINK_CODEC_SBC
Definition: bt_a2dp_codecs.h:73
@ BT_A2DP_SINK_CODEC_AAC
Definition: bt_a2dp_codecs.h:74
BT_A2DP_CHANNEL_MODE
Masks for supported channel TODO: Need to create mask.
Definition: bt_a2dp_codecs.h:107
BT_A2DP_AAC_PROFILE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:154
BT_A2DP_SAMPLE_FREQ
Masks for supported sample frequency TODO: Need to create mask.
Definition: bt_a2dp_codecs.h:89
data type for the MPEG-2, 4 AAC Codec Information Element
Definition: bt_a2dp_codecs.h:176
data type for the SBC Codec Information Element
Definition: bt_a2dp_codecs.h:140
Vendor Specific Codec information element type.
Definition: bt_a2dp_codecs.h:187
Codec information element structure, used to provide info of a single type of codec.
Definition: bt_a2dp_codecs.h:195