Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
This commit adds field_if_not_empty
variants for IntoIterator
builders fields.
The field will only be set if the provided collection is not empty.
For Element
properties and other Value
based setters, the function takes
a parameter to indicate the ValueType
to use for the resulting Value
.
This allows converting this code:
let webrtcsrc = gst::ElementFactory::make("webrtcsrc")
.build()
.unwrap();
if !args.audio_codecs.is_empty() {
webrtcsrc.set_property("audio-codecs", gst::Array::new(&args.audio_codecs));
}
to:
let webrtcsrc = gst::ElementFactory::make("webrtcsrc")
.field_if_not_empty::<gst::Array>("audio-codecs", &args.audio_codecs)
.build()
.unwrap();
Similarly, a new function field_from_iter()
allows settings the property or
field, regardless of whether it is empty or not:
let webrtcsrc = gst::ElementFactory::make("webrtcsrc")
.property_from_iter::<gst::Array>("audio-codecs", &args.audio_codecs)
.build()
.unwrap();
The above will override the default value if args.audio_codecs
is empty.