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
3807d95e
Commit
3807d95e
authored
4 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
m-monitor: update node properties to match the ones that media-session sets
parent
5a002888
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/module-monitor.c
+33
-57
33 additions, 57 deletions
modules/module-monitor.c
with
33 additions
and
57 deletions
modules/module-monitor.c
+
33
−
57
View file @
3807d95e
...
...
@@ -146,73 +146,50 @@ setup_device_props (WpProperties *p)
static
void
setup_node_props
(
WpProperties
*
dev_props
,
WpProperties
*
node_props
)
{
const
gchar
*
api
,
*
name
,
*
description
,
*
factory
;
/* Make the device properties directly available on the node */
wp_properties_update_keys
(
node_props
,
dev_props
,
SPA_KEY_DEVICE_API
,
SPA_KEY_DEVICE_NAME
,
SPA_KEY_DEVICE_ALIAS
,
SPA_KEY_DEVICE_NICK
,
SPA_KEY_DEVICE_DESCRIPTION
,
SPA_KEY_DEVICE_ICON
,
SPA_KEY_DEVICE_ICON_NAME
,
SPA_KEY_DEVICE_PLUGGED_USEC
,
SPA_KEY_DEVICE_BUS_ID
,
SPA_KEY_DEVICE_BUS_PATH
,
SPA_KEY_DEVICE_BUS
,
SPA_KEY_DEVICE_SUBSYSTEM
,
SPA_KEY_DEVICE_SYSFS_PATH
,
SPA_KEY_DEVICE_VENDOR_ID
,
SPA_KEY_DEVICE_VENDOR_NAME
,
SPA_KEY_DEVICE_PRODUCT_ID
,
SPA_KEY_DEVICE_PRODUCT_NAME
,
SPA_KEY_DEVICE_SERIAL
,
SPA_KEY_DEVICE_CLASS
,
SPA_KEY_DEVICE_CAPABILITIES
,
SPA_KEY_DEVICE_FORM_FACTOR
,
PW_KEY_DEVICE_INTENDED_ROLES
,
NULL
);
const
gchar
*
api
,
*
devname
,
*
description
,
*
factory
;
/* get some strings that we are going to need below */
api
=
wp_properties_get
(
no
de_props
,
SPA_KEY_DEVICE_API
);
api
=
wp_properties_get
(
de
v
_props
,
SPA_KEY_DEVICE_API
);
factory
=
wp_properties_get
(
node_props
,
SPA_KEY_FACTORY_NAME
);
name
=
wp_properties_get
(
no
de_props
,
SPA_KEY_DEVICE_NAME
);
if
(
G_UNLIKELY
(
!
name
))
name
=
wp_properties_get
(
no
de_props
,
SPA_KEY_DEVICE_NICK
);
if
(
G_UNLIKELY
(
!
name
))
name
=
wp_properties_get
(
no
de_props
,
SPA_KEY_DEVICE_ALIAS
);
if
(
G_UNLIKELY
(
!
name
))
name
=
"unknown-device"
;
dev
name
=
wp_properties_get
(
de
v
_props
,
SPA_KEY_DEVICE_NAME
);
if
(
G_UNLIKELY
(
!
dev
name
))
dev
name
=
wp_properties_get
(
de
v
_props
,
SPA_KEY_DEVICE_NICK
);
if
(
G_UNLIKELY
(
!
dev
name
))
dev
name
=
wp_properties_get
(
de
v
_props
,
SPA_KEY_DEVICE_ALIAS
);
if
(
G_UNLIKELY
(
!
dev
name
))
dev
name
=
"unknown-device"
;
description
=
wp_properties_get
(
no
de_props
,
SPA_KEY_DEVICE_DESCRIPTION
);
description
=
wp_properties_get
(
de
v
_props
,
SPA_KEY_DEVICE_DESCRIPTION
);
if
(
!
description
)
description
=
name
;
description
=
dev
name
;
/* set ALSA specific properties */
if
(
!
g_strcmp0
(
api
,
"alsa:pcm"
))
{
const
gchar
*
str
;
const
gchar
*
pcm_name
,
*
dev
,
*
subdev
,
*
stream
;
/* compose the node name */
str
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_ID
);
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s/%s/%s"
,
factory
,
name
,
str
);
if
(
!
(
dev
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_DEVICE
)))
dev
=
"0"
;
if
(
!
(
subdev
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_SUBDEVICE
)))
subdev
=
"0"
;
if
(
!
(
stream
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_STREAM
)))
stream
=
"unknown"
;
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s.%s.%s.%s"
,
devname
,
stream
,
dev
,
subdev
);
/* compose the node description */
str
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_NAME
);
wp_properties_setf
(
node_props
,
PW_KEY_NODE_DESCRIPTION
,
"%s: %s"
,
description
,
str
);
pcm_name
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_NAME
);
if
(
!
pcm_name
)
pcm_name
=
wp_properties_get
(
node_props
,
SPA_KEY_API_ALSA_PCM_ID
);
wp_properties_update_keys
(
node_props
,
dev_props
,
SPA_KEY_API_ALSA_CARD
,
SPA_KEY_API_ALSA_CARD_ID
,
SPA_KEY_API_ALSA_CARD_COMPONENTS
,
SPA_KEY_API_ALSA_CARD_DRIVER
,
SPA_KEY_API_ALSA_CARD_NAME
,
SPA_KEY_API_ALSA_CARD_LONGNAME
,
SPA_KEY_API_ALSA_CARD_MIXERNAME
,
NULL
);
if
(
g_strcmp0
(
subdev
,
"0"
)
!=
0
)
wp_properties_setf
(
node_props
,
PW_KEY_NODE_DESCRIPTION
,
"%s: %s (%s)"
,
description
,
pcm_name
,
subdev
);
else
wp_properties_setf
(
node_props
,
PW_KEY_NODE_DESCRIPTION
,
"%s: %s"
,
description
,
pcm_name
);
/* set BLUEZ 5 specific properties */
}
else
if
(
!
g_strcmp0
(
api
,
"bluez5"
))
{
...
...
@@ -220,8 +197,8 @@ setup_node_props (WpProperties *dev_props, WpProperties *node_props)
wp_properties_get
(
node_props
,
SPA_KEY_API_BLUEZ5_PROFILE
);
/* compose the node name */
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s
/
%s
/
%s"
,
factory
,
name
,
profile
);
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s
.
%s
.
%s"
,
factory
,
dev
name
,
profile
);
/* compose the node description */
wp_properties_setf
(
node_props
,
PW_KEY_NODE_DESCRIPTION
,
"%s (%s)"
,
...
...
@@ -234,8 +211,7 @@ setup_node_props (WpProperties *dev_props, WpProperties *node_props)
/* set node properties for other APIs */
}
else
{
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s/%s"
,
factory
,
name
);
wp_properties_setf
(
node_props
,
PW_KEY_NODE_NAME
,
"%s.%s"
,
factory
,
devname
);
wp_properties_set
(
node_props
,
PW_KEY_NODE_DESCRIPTION
,
description
);
}
}
...
...
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