Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
fd8414aa
Commit
fd8414aa
authored
5 years ago
by
Julian Bouzas
Browse files
Options
Downloads
Patches
Plain Diff
bluez: handle all bluetooth profiles
parent
770fe8c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/module-pw-alsa-udev.c
+3
-3
3 additions, 3 deletions
modules/module-pw-alsa-udev.c
modules/module-pw-bluez.c
+18
-10
18 additions, 10 deletions
modules/module-pw-bluez.c
with
21 additions
and
13 deletions
modules/module-pw-alsa-udev.c
+
3
−
3
View file @
fd8414aa
...
...
@@ -142,7 +142,7 @@ parse_alsa_properties (const struct spa_dict *props, const gchar **name,
/* TODO: we need to find a better way to do this */
static
gboolean
is_alsa_
devic
e
(
const
struct
spa_dict
*
props
)
is_alsa_
nod
e
(
const
struct
spa_dict
*
props
)
{
const
gchar
*
name
=
NULL
;
const
gchar
*
media_class
=
NULL
;
...
...
@@ -166,7 +166,7 @@ is_alsa_device (const struct spa_dict *props)
return
FALSE
;
/* Check if it is not a bluez device */
if
(
g_str_has_prefix
(
name
,
"
api.
bluez5"
))
if
(
g_str_has_prefix
(
name
,
"bluez5
.
"
))
return
FALSE
;
return
TRUE
;
...
...
@@ -185,7 +185,7 @@ on_node_added(WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
/* Only handle alsa nodes */
g_return_if_fail
(
props
);
if
(
!
is_alsa_
devic
e
(
props
))
if
(
!
is_alsa_
nod
e
(
props
))
return
;
/* Parse the alsa properties */
...
...
This diff is collapsed.
Click to expand it.
modules/module-pw-bluez.c
+
18
−
10
View file @
fd8414aa
...
...
@@ -123,13 +123,16 @@ parse_bluez_properties (const struct spa_dict *props, const gchar **name,
return
FALSE
;
/* Get the bluez profile */
/* TODO: We need to read the specific profile from a property. For now we
* get the bluez profile from the name, and we asume SCO is never a gateway.
* This will change once pipewire sets the profile property */
if
(
g_str_has_prefix
(
local_name
,
"api.bluez5.a2dp"
))
if
(
g_str_has_prefix
(
local_name
,
"bluez5.a2dp"
))
profile
=
WP_BLUEZ_A2DP
;
else
if
(
g_str_has_prefix
(
local_name
,
"
api.
bluez5.
sco
"
))
else
if
(
g_str_has_prefix
(
local_name
,
"bluez5.
hsp-hs
"
))
profile
=
WP_BLUEZ_HEADUNIT
;
else
if
(
g_str_has_prefix
(
local_name
,
"bluez5.hfp-hf"
))
profile
=
WP_BLUEZ_HEADUNIT
;
else
if
(
g_str_has_prefix
(
local_name
,
"bluez5.hsp-ag"
))
profile
=
WP_BLUEZ_GATEWAY
;
else
if
(
g_str_has_prefix
(
local_name
,
"bluez5.hfp-ag"
))
profile
=
WP_BLUEZ_GATEWAY
;
else
return
FALSE
;
...
...
@@ -184,7 +187,7 @@ parse_bluez_properties (const struct spa_dict *props, const gchar **name,
/* TODO: we need to find a better way to do this */
static
gboolean
is_bluez_
devic
e
(
const
struct
spa_dict
*
props
)
is_bluez_
nod
e
(
const
struct
spa_dict
*
props
)
{
const
gchar
*
name
=
NULL
;
...
...
@@ -194,7 +197,7 @@ is_bluez_device (const struct spa_dict *props)
return
FALSE
;
/* Check if it is a bluez device */
if
(
!
g_str_has_prefix
(
name
,
"
api.
bluez5"
))
if
(
!
g_str_has_prefix
(
name
,
"bluez5
.
"
))
return
FALSE
;
return
TRUE
;
...
...
@@ -213,7 +216,7 @@ on_node_added (WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
/* Only handle bluez nodes */
g_return_if_fail
(
props
);
if
(
!
is_bluez_
devic
e
(
props
))
if
(
!
is_bluez_
nod
e
(
props
))
return
;
/* Parse the bluez properties */
...
...
@@ -262,7 +265,7 @@ create_node(struct impl *impl, struct device *dev, uint32_t id,
const
struct
spa_device_object_info
*
info
)
{
struct
node
*
node
;
const
char
*
name
;
const
char
*
name
,
*
profile
;
struct
pw_properties
*
props
=
NULL
;
struct
pw_factory
*
factory
=
NULL
;
struct
pw_node
*
adapter
=
NULL
;
...
...
@@ -282,13 +285,18 @@ create_node(struct impl *impl, struct device *dev, uint32_t id,
if
(
name
==
NULL
)
name
=
"bluetooth-device"
;
/* Get the bluez profile */
profile
=
spa_dict_lookup
(
info
->
props
,
SPA_KEY_API_BLUEZ5_PROFILE
);
if
(
!
profile
)
profile
=
"null"
;
/* Find the factory */
factory
=
wp_remote_pipewire_find_factory
(
impl
->
remote_pipewire
,
"adapter"
);
g_return_val_if_fail
(
factory
,
NULL
);
/* Create the properties */
props
=
pw_properties_new_dict
(
info
->
props
);
pw_properties_setf
(
props
,
PW_KEY_NODE_NAME
,
"%s.%s"
,
info
->
factory_nam
e
,
name
);
pw_properties_setf
(
props
,
PW_KEY_NODE_NAME
,
"
bluez5.
%s.%s"
,
profil
e
,
name
);
pw_properties_set
(
props
,
PW_KEY_NODE_DESCRIPTION
,
name
);
pw_properties_set
(
props
,
PW_KEY_FACTORY_NAME
,
info
->
factory_name
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment