module-rtp: improve properties

This commit is contained in:
Wim Taymans 2022-10-07 16:12:22 +02:00
parent 37f57dc09f
commit c06f936a88
2 changed files with 4 additions and 8 deletions

View file

@ -799,7 +799,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
pw_properties_set(props, PW_KEY_NODE_DESCRIPTION, pw_properties_set(props, PW_KEY_NODE_DESCRIPTION,
pw_properties_get(props, PW_KEY_NODE_NAME)); pw_properties_get(props, PW_KEY_NODE_NAME));
if (pw_properties_get(props, PW_KEY_MEDIA_NAME) == NULL) if (pw_properties_get(props, PW_KEY_MEDIA_NAME) == NULL)
pw_properties_set(props, PW_KEY_MEDIA_NAME, "RTP Stream"); pw_properties_set(props, PW_KEY_MEDIA_NAME, "RTP Sender Stream");
if ((str = pw_properties_get(props, "stream.props")) != NULL) if ((str = pw_properties_get(props, "stream.props")) != NULL)
pw_properties_update_string(stream_props, str, strlen(str)); pw_properties_update_string(stream_props, str, strlen(str));

View file

@ -1029,18 +1029,14 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
impl->loop = pw_context_get_main_loop(context); impl->loop = pw_context_get_main_loop(context);
impl->data_loop = pw_data_loop_get_loop(pw_context_get_data_loop(context)); impl->data_loop = pw_data_loop_get_loop(pw_context_get_data_loop(context));
if ((str = pw_properties_get(props, "stream.props")) != NULL)
pw_properties_update_string(stream_props, str, strlen(str));
if (pw_properties_get(stream_props, PW_KEY_NODE_NAME) == NULL)
pw_properties_set(stream_props, PW_KEY_NODE_NAME, "rtp-source");
if (pw_properties_get(stream_props, PW_KEY_NODE_DESCRIPTION) == NULL)
pw_properties_set(stream_props, PW_KEY_NODE_DESCRIPTION, "RTP Source");
if (pw_properties_get(stream_props, PW_KEY_NODE_VIRTUAL) == NULL) if (pw_properties_get(stream_props, PW_KEY_NODE_VIRTUAL) == NULL)
pw_properties_set(stream_props, PW_KEY_NODE_VIRTUAL, "true"); pw_properties_set(stream_props, PW_KEY_NODE_VIRTUAL, "true");
if (pw_properties_get(stream_props, PW_KEY_NODE_NETWORK) == NULL) if (pw_properties_get(stream_props, PW_KEY_NODE_NETWORK) == NULL)
pw_properties_set(stream_props, PW_KEY_NODE_NETWORK, "true"); pw_properties_set(stream_props, PW_KEY_NODE_NETWORK, "true");
if ((str = pw_properties_get(props, "stream.props")) != NULL)
pw_properties_update_string(stream_props, str, strlen(str));
str = pw_properties_get(props, "local.ifname"); str = pw_properties_get(props, "local.ifname");
impl->ifname = str ? strdup(str) : NULL; impl->ifname = str ? strdup(str) : NULL;