a2dp-codecs.c 1.72 KB
Newer Older
Wim Taymans's avatar
Wim Taymans committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * BlueALSA - bluez-a2dp.c
 * Copyright (c) 2016-2017 Arkadiusz Bokowy
 *
 * This file is a part of bluez-alsa.
 *
 * This project is licensed under the terms of the MIT license.
 *
 */

#include "a2dp-codecs.h"

#if ENABLE_MP3
const a2dp_mpeg_t bluez_a2dp_mpeg = {
	.layer =
		MPEG_LAYER_MP1 |
		MPEG_LAYER_MP2 |
		MPEG_LAYER_MP3,
	.crc = 1,
	.channel_mode =
		MPEG_CHANNEL_MODE_MONO |
		MPEG_CHANNEL_MODE_DUAL_CHANNEL |
		MPEG_CHANNEL_MODE_STEREO |
		MPEG_CHANNEL_MODE_JOINT_STEREO,
	.mpf = 1,
	.frequency =
		MPEG_SAMPLING_FREQ_16000 |
		MPEG_SAMPLING_FREQ_22050 |
		MPEG_SAMPLING_FREQ_24000 |
		MPEG_SAMPLING_FREQ_32000 |
		MPEG_SAMPLING_FREQ_44100 |
		MPEG_SAMPLING_FREQ_48000,
	.bitrate =
		MPEG_BIT_RATE_VBR |
		MPEG_BIT_RATE_320000 |
		MPEG_BIT_RATE_256000 |
		MPEG_BIT_RATE_224000 |
		MPEG_BIT_RATE_192000 |
		MPEG_BIT_RATE_160000 |
		MPEG_BIT_RATE_128000 |
		MPEG_BIT_RATE_112000 |
		MPEG_BIT_RATE_96000 |
		MPEG_BIT_RATE_80000 |
		MPEG_BIT_RATE_64000 |
		MPEG_BIT_RATE_56000 |
		MPEG_BIT_RATE_48000 |
		MPEG_BIT_RATE_40000 |
		MPEG_BIT_RATE_32000 |
		MPEG_BIT_RATE_FREE,
};
#endif

Wim Taymans's avatar
Wim Taymans committed
53
extern struct a2dp_codec a2dp_codec_sbc;
Wim Taymans's avatar
Wim Taymans committed
54
55
56
#if ENABLE_LDAC
extern struct a2dp_codec a2dp_codec_ldac;
#endif
Wim Taymans's avatar
Wim Taymans committed
57
58
59
60
61
62
63
64
#if ENABLE_AAC
extern struct a2dp_codec a2dp_codec_aac;
#endif
#if ENABLE_MP3
extern struct a2dp_codec a2dp_codec_mpeg;
#endif
#if ENABLE_APTX
extern struct a2dp_codec a2dp_codec_aptx;
65
extern struct a2dp_codec a2dp_codec_aptx_hd;
Wim Taymans's avatar
Wim Taymans committed
66
67
68
#endif

const struct a2dp_codec *a2dp_codec_list[] = {
Wim Taymans's avatar
Wim Taymans committed
69
70
71
#if ENABLE_LDAC
	&a2dp_codec_ldac,
#endif
Wim Taymans's avatar
Wim Taymans committed
72
73
#if ENABLE_APTX
	&a2dp_codec_aptx_hd,
Wim Taymans's avatar
Wim Taymans committed
74
	&a2dp_codec_aptx,
Wim Taymans's avatar
Wim Taymans committed
75
#endif
Wim Taymans's avatar
Wim Taymans committed
76
77
78
79
80
81
#if ENABLE_AAC
	&a2dp_codec_aac,
#endif
#if ENABLE_MP3
	&a2dp_codec_mpeg,
#endif
Wim Taymans's avatar
Wim Taymans committed
82
	&a2dp_codec_sbc,
Wim Taymans's avatar
Wim Taymans committed
83
84
85
	NULL,
};
const struct a2dp_codec **a2dp_codecs = a2dp_codec_list;