File tree 2 files changed +30
-6
lines changed
include/zephyr/bluetooth/audio
2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ enum bt_audio_metadata_type {
209
209
((struct bt_audio_codec_cfg){ \
210
210
/* Use HCI data path as default, can be overwritten by application */ \
211
211
.path_id = BT_ISO_DATA_PATH_HCI, \
212
+ .ctlr_transcode = false, \
212
213
.id = _id, \
213
214
.cid = _cid, \
214
215
.vid = _vid, \
@@ -231,6 +232,7 @@ enum bt_audio_metadata_type {
231
232
((struct bt_audio_codec_cap){ \
232
233
/* Use HCI data path as default, can be overwritten by application */ \
233
234
.path_id = BT_ISO_DATA_PATH_HCI, \
235
+ .ctlr_transcode = false, \
234
236
.id = (_id), \
235
237
.cid = (_cid), \
236
238
.vid = (_vid), \
@@ -316,6 +318,12 @@ struct bt_audio_codec_cap {
316
318
* vendor specific ID.
317
319
*/
318
320
uint8_t path_id ;
321
+ /** Whether or not the local controller should transcode
322
+ *
323
+ * This effectively sets the coding format for the ISO data path to @ref
324
+ * BT_HCI_CODING_FORMAT_TRANSPARENT if false, else uses the @ref bt_audio_codec_cfg.id.
325
+ */
326
+ bool ctlr_transcode ;
319
327
/** Codec ID */
320
328
uint8_t id ;
321
329
/** Codec Company ID */
@@ -344,6 +352,12 @@ struct bt_audio_codec_cfg {
344
352
* vendor specific ID.
345
353
*/
346
354
uint8_t path_id ;
355
+ /** Whether or not the local controller should transcode
356
+ *
357
+ * This effectively sets the coding format for the ISO data path to @ref
358
+ * BT_HCI_CODING_FORMAT_TRANSPARENT if false, else uses the @ref bt_audio_codec_cfg.id.
359
+ */
360
+ bool ctlr_transcode ;
347
361
/** Codec ID */
348
362
uint8_t id ;
349
363
/** Codec Company ID */
Original file line number Diff line number Diff line change @@ -35,12 +35,22 @@ void bt_audio_codec_cfg_to_iso_path(struct bt_iso_chan_path *path,
35
35
struct bt_audio_codec_cfg * codec_cfg )
36
36
{
37
37
path -> pid = codec_cfg -> path_id ;
38
- path -> format = codec_cfg -> id ;
39
- path -> cid = codec_cfg -> cid ;
40
- path -> vid = codec_cfg -> vid ;
41
- path -> delay = 0 ; /* TODO: Add to bt_audio_codec_cfg? Use presentation delay? */
42
- path -> cc_len = codec_cfg -> data_len ;
43
- path -> cc = codec_cfg -> data ;
38
+
39
+ if (codec_cfg -> ctlr_transcode ) {
40
+ path -> format = codec_cfg -> id ;
41
+ path -> cid = codec_cfg -> cid ;
42
+ path -> vid = codec_cfg -> vid ;
43
+ path -> delay = 0 ;
44
+ path -> cc_len = codec_cfg -> data_len ;
45
+ path -> cc = codec_cfg -> data ;
46
+ } else {
47
+ path -> format = BT_HCI_CODING_FORMAT_TRANSPARENT ;
48
+ path -> cid = 0 ;
49
+ path -> vid = 0 ;
50
+ path -> delay = 0 ;
51
+ path -> cc_len = 0 ;
52
+ path -> cc = NULL ;
53
+ }
44
54
}
45
55
46
56
#if defined(CONFIG_BT_BAP_UNICAST_CLIENT ) || defined(CONFIG_BT_BAP_BROADCAST_SOURCE ) || \
You can’t perform that action at this time.
0 commit comments