bluez5: add a2dp-source plugin

This commit is contained in:
Julian Bouzas 2019-04-19 13:26:07 -04:00 committed by Wim Taymans
parent 29164a0f54
commit 674f3e197e
4 changed files with 1192 additions and 15 deletions

View file

@ -45,8 +45,6 @@
#include <spa/utils/type.h>
#include <spa/debug/mem.h>
#undef ENABLE_AAC
#include "a2dp-codecs.h"
#include "defs.h"
@ -1221,8 +1219,25 @@ static int register_a2dp_endpoint(struct spa_bt_monitor *monitor,
profile_path = "/A2DP/SBC/Source";
break;
case A2DP_CODEC_MPEG24:
profile_path = "/A2DP/MPEG24/Source";
/* We don't support MPEG24 for now */
return -ENOTSUP;
/* profile_path = "/A2DP/MPEG24/Source";
break; */
default:
return -ENOTSUP;
}
break;
case SPA_BT_PROFILE_A2DP_SINK:
switch (codec) {
case A2DP_CODEC_SBC:
profile_path = "/A2DP/SBC/Sink";
break;
case A2DP_CODEC_MPEG24:
/* We don't support MPEG24 for now */
return -ENOTSUP;
/* profile_path = "/A2DP/MPEG24/Sink";
break; */
default:
return -ENOTSUP;
}
@ -1291,18 +1306,30 @@ static int adapter_register_endpoints(struct spa_bt_adapter *a)
{
struct spa_bt_monitor *monitor = a->monitor;
#ifdef ENABLE_AAC
/* We don't support MPEG24 for now */
/*
register_a2dp_endpoint(monitor, a->path,
SPA_BT_UUID_A2DP_SOURCE,
SPA_BT_PROFILE_A2DP_SOURCE,
A2DP_CODEC_MPEG24,
&bluez_a2dp_aac, sizeof(bluez_a2dp_aac));
#endif
register_a2dp_endpoint(monitor, a->path,
SPA_BT_UUID_A2DP_SINK,
SPA_BT_PROFILE_A2DP_SINK,
A2DP_CODEC_MPEG24,
&bluez_a2dp_aac, sizeof(bluez_a2dp_aac));
*/
register_a2dp_endpoint(monitor, a->path,
SPA_BT_UUID_A2DP_SOURCE,
SPA_BT_PROFILE_A2DP_SOURCE,
A2DP_CODEC_SBC,
&bluez_a2dp_sbc, sizeof(bluez_a2dp_sbc));
register_a2dp_endpoint(monitor, a->path,
SPA_BT_UUID_A2DP_SINK,
SPA_BT_PROFILE_A2DP_SINK,
A2DP_CODEC_SBC,
&bluez_a2dp_sbc, sizeof(bluez_a2dp_sbc));
return 0;
}