mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
a2dp: set channel map
This commit is contained in:
parent
29fe356fdf
commit
34a9b1dc1a
2 changed files with 18 additions and 1 deletions
|
|
@ -104,6 +104,7 @@ static int codec_enum_config(const struct a2dp_codec *codec,
|
|||
a2dp_aptx_t conf;
|
||||
struct spa_pod_frame f[2];
|
||||
struct spa_pod_choice *choice;
|
||||
uint32_t position[SPA_AUDIO_MAX_CHANNELS];
|
||||
uint32_t i = 0;
|
||||
|
||||
if (caps_size < sizeof(conf))
|
||||
|
|
@ -156,12 +157,19 @@ static int codec_enum_config(const struct a2dp_codec *codec,
|
|||
SPA_FORMAT_AUDIO_channels, SPA_POD_CHOICE_RANGE_Int(2, 1, 2),
|
||||
0);
|
||||
} else if (conf.channel_mode & APTX_CHANNEL_MODE_MONO) {
|
||||
position[0] = SPA_AUDIO_CHANNEL_MONO;
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(1),
|
||||
SPA_FORMAT_AUDIO_position, SPA_POD_Array(sizeof(uint32_t),
|
||||
SPA_TYPE_Id, 1, position),
|
||||
0);
|
||||
} else if (conf.channel_mode & APTX_CHANNEL_MODE_STEREO) {
|
||||
position[0] = SPA_AUDIO_CHANNEL_FL;
|
||||
position[1] = SPA_AUDIO_CHANNEL_FR;
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(2),
|
||||
SPA_FORMAT_AUDIO_position, SPA_POD_Array(sizeof(uint32_t),
|
||||
SPA_TYPE_Id, 2, position),
|
||||
0);
|
||||
} else
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ static int codec_enum_config(const struct a2dp_codec *codec,
|
|||
struct spa_pod_frame f[2];
|
||||
struct spa_pod_choice *choice;
|
||||
uint32_t i = 0;
|
||||
uint32_t position[SPA_AUDIO_MAX_CHANNELS];
|
||||
|
||||
if (caps_size < sizeof(conf))
|
||||
return -EINVAL;
|
||||
|
|
@ -252,12 +253,20 @@ static int codec_enum_config(const struct a2dp_codec *codec,
|
|||
SPA_FORMAT_AUDIO_channels, SPA_POD_CHOICE_RANGE_Int(2, 1, 2),
|
||||
0);
|
||||
} else if (conf.channel_mode & SBC_CHANNEL_MODE_MONO) {
|
||||
position[0] = SPA_AUDIO_CHANNEL_MONO;
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(1),
|
||||
SPA_FORMAT_AUDIO_position, SPA_POD_Array(sizeof(uint32_t),
|
||||
SPA_TYPE_Id, 1, position),
|
||||
0);
|
||||
} else {
|
||||
position[0] = SPA_AUDIO_CHANNEL_FL;
|
||||
position[1] = SPA_AUDIO_CHANNEL_FR;
|
||||
spa_pod_builder_add(b,
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(2), 0);
|
||||
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(2),
|
||||
SPA_FORMAT_AUDIO_position, SPA_POD_Array(sizeof(uint32_t),
|
||||
SPA_TYPE_Id, 2, position),
|
||||
0);
|
||||
}
|
||||
*param = spa_pod_builder_pop(b, &f[0]);
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue