srt: Setting "uri" property overrides other properties set earlier
The gst_srt_object_set_uri
implementation recreates the application/x-srt-params
structure, losing all previously set values, including those not set in the URI.
So for example this code:
g_object_set(srtsink, "latency", 300, NULL);
g_object_set(srtsink, "uri", "srt://127.0.0.1:7001", NULL);
or this:
g_object_set(srtsink,
"latency", 300,
"uri", "srt://127.0.0.1:7001",
NULL);
will end up using default latency of 125, not what it explicitly set up here, as the URI setting will lose this with the srtobject->parameters
recreation.
To fix this, we need to make sure uri is set first separately or in the same call:
g_object_set(srtsink, "uri", "srt://127.0.0.1:7001", NULL);
g_object_set(srtsink, "latency", 300, NULL);
or
g_object_set(srtsink,
"uri", "srt://127.0.0.1:7001",
"latency", 300,
NULL);
But if for some reason the URI needs to be set later in code flow (before going READY), all the previously set properties would need to be retrieved first and then set again after e.g. changing the IP address.
Any other property handled via srtobject->parameters is likely broken the same way if uri
is set afterwards.
It would be nice to at least know about this behaviour via "uri"
property description for a start, but of course ideally the URI setting shouldn't override properties that aren't overridden via GET parameters of the URI.
Edit: Earlier I claimed that this always happens when "uri" and "latency" are set up in the same g_object_set varargs, but this only happens if "uri" comes later in the vararg - it seemed to have been due to uri being handled via g_object_bind_property but latency via manual code making the behaviour be as latency set before the property bound uri when set in the same g_object_set call on the GstBin.