mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-18 08:56:45 -05:00
alsa: set MEDIA_CLASS in nodes
This commit is contained in:
parent
1f5aa26452
commit
60cd74fdb0
2 changed files with 11 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ static const struct pw_client_endpoint_proxy_events client_endpoint_events = {
|
||||||
.stream_set_param = client_endpoint_stream_set_param,
|
.stream_set_param = client_endpoint_stream_set_param,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** fallback, one stream for each node */
|
||||||
static int setup_alsa_fallback_endpoint(struct alsa_object *obj)
|
static int setup_alsa_fallback_endpoint(struct alsa_object *obj)
|
||||||
{
|
{
|
||||||
struct alsa_node *n;
|
struct alsa_node *n;
|
||||||
|
|
@ -110,6 +111,10 @@ static int setup_alsa_fallback_endpoint(struct alsa_object *obj)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** UCM.
|
||||||
|
*
|
||||||
|
* We create 1 stream for each verb + modifier combination
|
||||||
|
*/
|
||||||
static int setup_alsa_ucm_endpoint(struct alsa_object *obj)
|
static int setup_alsa_ucm_endpoint(struct alsa_object *obj)
|
||||||
{
|
{
|
||||||
const char *str, *card_name = NULL;
|
const char *str, *card_name = NULL;
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,12 @@ static struct alsa_node *alsa_create_node(struct alsa_object *obj, uint32_t id,
|
||||||
pw_properties_setf(node->props, PW_KEY_PRIORITY_SESSION, "%d", priority);
|
pw_properties_setf(node->props, PW_KEY_PRIORITY_SESSION, "%d", priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pw_properties_get(node->props, SPA_KEY_MEDIA_CLASS) == NULL) {
|
||||||
|
if (!strcmp(stream, "capture"))
|
||||||
|
pw_properties_setf(node->props, SPA_KEY_MEDIA_CLASS, "Audio/Source");
|
||||||
|
else
|
||||||
|
pw_properties_setf(node->props, SPA_KEY_MEDIA_CLASS, "Audio/Sink");
|
||||||
|
}
|
||||||
if (pw_properties_get(node->props, SPA_KEY_NODE_NAME) == NULL) {
|
if (pw_properties_get(node->props, SPA_KEY_NODE_NAME) == NULL) {
|
||||||
const char *devname;
|
const char *devname;
|
||||||
if ((devname = pw_properties_get(obj->props, SPA_KEY_DEVICE_NAME)) == NULL)
|
if ((devname = pw_properties_get(obj->props, SPA_KEY_DEVICE_NAME)) == NULL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue