mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
a2dp-codecs: also define functions for big endian
This commit is contained in:
parent
afae27b4cc
commit
1804e47a91
1 changed files with 30 additions and 30 deletions
|
|
@ -172,36 +172,6 @@ typedef struct {
|
|||
uint8_t max_bitpool;
|
||||
} __attribute__ ((packed)) a2dp_sbc_t;
|
||||
|
||||
static inline int a2dp_sbc_get_channels(a2dp_sbc_t *config)
|
||||
{
|
||||
switch (config->channel_mode) {
|
||||
case SBC_CHANNEL_MODE_MONO:
|
||||
return 1;
|
||||
case SBC_CHANNEL_MODE_DUAL_CHANNEL:
|
||||
case SBC_CHANNEL_MODE_STEREO:
|
||||
case SBC_CHANNEL_MODE_JOINT_STEREO:
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int a2dp_sbc_get_frequency(a2dp_sbc_t *config)
|
||||
{
|
||||
switch (config->frequency) {
|
||||
case SBC_SAMPLING_FREQ_16000:
|
||||
return 16000;
|
||||
case SBC_SAMPLING_FREQ_32000:
|
||||
return 32000;
|
||||
case SBC_SAMPLING_FREQ_44100:
|
||||
return 44100;
|
||||
case SBC_SAMPLING_FREQ_48000:
|
||||
return 48000;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint8_t channel_mode:4;
|
||||
uint8_t crc:1;
|
||||
|
|
@ -284,6 +254,36 @@ typedef struct {
|
|||
#error "Unknown byte order"
|
||||
#endif
|
||||
|
||||
static inline int a2dp_sbc_get_channels(a2dp_sbc_t *config)
|
||||
{
|
||||
switch (config->channel_mode) {
|
||||
case SBC_CHANNEL_MODE_MONO:
|
||||
return 1;
|
||||
case SBC_CHANNEL_MODE_DUAL_CHANNEL:
|
||||
case SBC_CHANNEL_MODE_STEREO:
|
||||
case SBC_CHANNEL_MODE_JOINT_STEREO:
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int a2dp_sbc_get_frequency(a2dp_sbc_t *config)
|
||||
{
|
||||
switch (config->frequency) {
|
||||
case SBC_SAMPLING_FREQ_16000:
|
||||
return 16000;
|
||||
case SBC_SAMPLING_FREQ_32000:
|
||||
return 32000;
|
||||
case SBC_SAMPLING_FREQ_44100:
|
||||
return 44100;
|
||||
case SBC_SAMPLING_FREQ_48000:
|
||||
return 48000;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
const a2dp_sbc_t bluez_a2dp_sbc;
|
||||
#if ENABLE_MP3
|
||||
const a2dp_mpeg_t bluez_a2dp_mpeg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue