mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: Init BAP LC3 coder/decoder depending on direction
For LE Audio, sink and source have their own media transport endpoint. Media sink or source only needs the coder or decoder respectively.
This commit is contained in:
parent
28b4fbecfb
commit
d4b639419a
3 changed files with 28 additions and 12 deletions
|
|
@ -586,17 +586,21 @@ static void *codec_init(const struct media_codec *codec, uint32_t flags,
|
|||
}
|
||||
this->codesize = this->samples * this->channels * sizeof(int32_t);
|
||||
|
||||
for (ich = 0; ich < this->channels; ich++) {
|
||||
this->enc[ich] = lc3_setup_encoder(this->frame_dus, this->samplerate, 0, calloc(1, lc3_encoder_size(this->frame_dus, this->samplerate)));
|
||||
if (this->enc[ich] == NULL) {
|
||||
res = -EINVAL;
|
||||
goto error;
|
||||
if (flags & MEDIA_CODEC_FLAG_SINK) {
|
||||
for (ich = 0; ich < this->channels; ich++) {
|
||||
this->enc[ich] = lc3_setup_encoder(this->frame_dus, this->samplerate, 0, calloc(1, lc3_encoder_size(this->frame_dus, this->samplerate)));
|
||||
if (this->enc[ich] == NULL) {
|
||||
res = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
this->dec[ich] = lc3_setup_decoder(this->frame_dus, this->samplerate, 0, calloc(1, lc3_decoder_size(this->frame_dus, this->samplerate)));
|
||||
if (this->dec[ich] == NULL) {
|
||||
res = -EINVAL;
|
||||
goto error;
|
||||
} else {
|
||||
for (ich = 0; ich < this->channels; ich++) {
|
||||
this->dec[ich] = lc3_setup_decoder(this->frame_dus, this->samplerate, 0, calloc(1, lc3_decoder_size(this->frame_dus, this->samplerate)));
|
||||
if (this->dec[ich] == NULL) {
|
||||
res = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue