pipewire: module-roc-{sink,source}: add rudimentary ROC_INTERFACE_AUDIO_CONTROL support

This commit is contained in:
Barnabás Pőcze 2023-11-23 16:44:17 +01:00
parent b19d0ffbc3
commit d88def09bd
6 changed files with 88 additions and 19 deletions

View file

@ -32,7 +32,9 @@ static const char *const pulse_module_options =
"sess_latency_msec=<target network latency in milliseconds> "
"local_ip=<local receiver ip> "
"local_source_port=<local receiver port for source packets> "
"local_repair_port=<local receiver port for repair packets> ";
"local_repair_port=<local receiver port for repair packets> "
"local_control_port=<local receiver port for control packets> "
;
#define NAME "roc-sink-input"
@ -162,6 +164,11 @@ static int module_roc_sink_input_prepare(struct module * const module)
pw_properties_set(props, "local_repair_port", NULL);
}
if ((str = pw_properties_get(props, "local_control_port")) != NULL) {
pw_properties_set(roc_props, "local.control.port", str);
pw_properties_set(props, "local_control_port", NULL);
}
if ((str = pw_properties_get(props, "sess_latency_msec")) != NULL) {
pw_properties_set(roc_props, "sess.latency.msec", str);
pw_properties_set(props, "sess_latency_msec", NULL);

View file

@ -30,7 +30,9 @@ static const char *const pulse_module_options =
"fec_code=<empty>|disable|rs8m|ldpc "
"remote_ip=<remote receiver ip> "
"remote_source_port=<remote receiver port for source packets> "
"remote_repair_port=<remote receiver port for repair packets> ";
"remote_repair_port=<remote receiver port for repair packets> "
"remote_control_port=<remote receiver port for control packets> "
;
#define NAME "roc-sink"
@ -119,6 +121,7 @@ static const char* const valid_args[] = {
"remote_ip",
"remote_source_port",
"remote_repair_port",
"remote_control_port",
NULL
};
static const struct spa_dict_item module_roc_sink_info[] = {
@ -177,6 +180,12 @@ static int module_roc_sink_prepare(struct module * const module)
pw_properties_set(roc_props, "remote.repair.port", str);
pw_properties_set(props, "remote_repair_port", NULL);
}
if ((str = pw_properties_get(props, "remote_control_port")) != NULL) {
pw_properties_set(roc_props, "remote.control.port", str);
pw_properties_set(props, "remote_control_port", NULL);
}
if ((str = pw_properties_get(props, "fec_code")) != NULL) {
pw_properties_set(roc_props, "fec.code", str);
pw_properties_set(props, "fec_code", NULL);

View file

@ -32,7 +32,9 @@ static const char *const pulse_module_options =
"sess_latency_msec=<target network latency in milliseconds> "
"local_ip=<local receiver ip> "
"local_source_port=<local receiver port for source packets> "
"local_repair_port=<local receiver port for repair packets> ";
"local_repair_port=<local receiver port for repair packets> "
"local_control_port=<local receiver port for control packets> "
;
#define NAME "roc-source"
@ -123,6 +125,7 @@ static const char* const valid_args[] = {
"local_ip",
"local_source_port",
"local_repair_port",
"local_control_port",
NULL
};
@ -179,6 +182,11 @@ static int module_roc_source_prepare(struct module * const module)
pw_properties_set(props, "local_repair_port", NULL);
}
if ((str = pw_properties_get(props, "local_control_port")) != NULL) {
pw_properties_set(roc_props, "local.control.port", str);
pw_properties_set(props, "local_control_port", NULL);
}
if ((str = pw_properties_get(props, "sess_latency_msec")) != NULL) {
pw_properties_set(roc_props, "sess.latency.msec", str);
pw_properties_set(props, "sess_latency_msec", NULL);