mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: add spa_bt_get_hfp_codec() / spa_bt_get_media_codecs()
These are for HFP backends to get media codecs.
This commit is contained in:
parent
e6f5fb12a3
commit
62bec49c27
2 changed files with 26 additions and 0 deletions
|
|
@ -451,6 +451,11 @@ static void register_battery_provider(struct spa_bt_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
const struct media_codec * const * spa_bt_get_media_codecs(struct spa_bt_monitor *monitor)
|
||||
{
|
||||
return monitor->media_codecs;
|
||||
}
|
||||
|
||||
static int media_codec_to_endpoint(const struct media_codec *codec,
|
||||
enum spa_bt_media_direction direction,
|
||||
char** object_path)
|
||||
|
|
@ -2642,6 +2647,25 @@ const struct media_codec **spa_bt_device_get_supported_media_codecs(struct spa_b
|
|||
return spa_steal_ptr(supported_codecs);
|
||||
}
|
||||
|
||||
const struct media_codec *spa_bt_get_hfp_codec(struct spa_bt_monitor *monitor, unsigned int hfp_codec_id)
|
||||
{
|
||||
const struct media_codec * const * const media_codecs = monitor->media_codecs;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; media_codecs[i] != NULL; ++i) {
|
||||
const struct media_codec *codec = media_codecs[i];
|
||||
|
||||
if (codec->kind != MEDIA_CODEC_HFP)
|
||||
continue;
|
||||
if (!is_media_codec_enabled(monitor, codec))
|
||||
continue;
|
||||
if (codec->codec_id == hfp_codec_id)
|
||||
return codec;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct spa_bt_remote_endpoint *device_remote_endpoint_find(struct spa_bt_device *device, const char *path)
|
||||
{
|
||||
struct spa_bt_remote_endpoint *ep;
|
||||
|
|
|
|||
|
|
@ -593,6 +593,8 @@ int spa_bt_device_supports_hfp_codec(struct spa_bt_device *device, unsigned int
|
|||
int spa_bt_device_release_transports(struct spa_bt_device *device);
|
||||
int spa_bt_device_report_battery_level(struct spa_bt_device *device, uint8_t percentage);
|
||||
void spa_bt_device_update_last_bluez_action_time(struct spa_bt_device *device);
|
||||
const struct media_codec * const * spa_bt_get_media_codecs(struct spa_bt_monitor *monitor);
|
||||
const struct media_codec *spa_bt_get_hfp_codec(struct spa_bt_monitor *monitor, unsigned int hfp_codec_id);
|
||||
|
||||
#define spa_bt_device_emit(d,m,v,...) spa_hook_list_call(&(d)->listener_list, \
|
||||
struct spa_bt_device_events, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue