pipewire-pulse: port module-rtp-recv

Use the new module-rtp-sap to listen and create RTP streams from
SAP.
This commit is contained in:
Wim Taymans 2023-02-22 15:52:11 +01:00
parent 9a6fa2e6a1
commit 77b7c3d180

View file

@ -51,13 +51,16 @@ static int module_rtp_recv_load(struct module *module)
fprintf(f, "{"); fprintf(f, "{");
pw_properties_serialize_dict(f, &data->global_props->dict, 0); pw_properties_serialize_dict(f, &data->global_props->dict, 0);
fprintf(f, " stream.props = {"); fprintf(f, " stream.rules = ");
fprintf(f, "[ { matches = [ { rtp.session = \"~.*\" } ] "),
fprintf(f, " actions = { create-stream = { ");
pw_properties_serialize_dict(f, &data->stream_props->dict, 0); pw_properties_serialize_dict(f, &data->stream_props->dict, 0);
fprintf(f, " } }"); fprintf(f, " } } } ] ");
fprintf(f, " }");
fclose(f); fclose(f);
data->mod = pw_context_load_module(module->impl->context, data->mod = pw_context_load_module(module->impl->context,
"libpipewire-module-rtp-source", "libpipewire-module-rtp-sap",
args, NULL); args, NULL);
free(args); free(args);
@ -113,14 +116,13 @@ static int module_rtp_recv_prepare(struct module * const module)
res = -errno; res = -errno;
goto out; goto out;
} }
if ((str = pw_properties_get(props, "sink")) != NULL)
pw_properties_set(stream_props, PW_KEY_TARGET_OBJECT, str);
if ((str = pw_properties_get(props, "sap_address")) != NULL) if ((str = pw_properties_get(props, "sap_address")) != NULL)
pw_properties_set(global_props, "sap.ip", str); pw_properties_set(global_props, "sap.ip", str);
if ((str = pw_properties_get(props, "sink")) != NULL)
pw_properties_set(stream_props, PW_KEY_TARGET_OBJECT, str);
if ((str = pw_properties_get(props, "latency_msec")) != NULL) if ((str = pw_properties_get(props, "latency_msec")) != NULL)
pw_properties_set(global_props, "sess.latency.msec", str); pw_properties_set(stream_props, "sess.latency.msec", str);
d->module = module; d->module = module;
d->stream_props = stream_props; d->stream_props = stream_props;