net/ndi: fix build with --no-default-features

doc_show_default() is only available with gst/v1_18

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/588>
This commit is contained in:
Jordan Petridis 2022-11-29 16:14:57 +02:00
parent b75483e597
commit 821c23e202

View file

@ -109,6 +109,12 @@ impl ObjectSubclass for NdiSrc {
impl ObjectImpl for NdiSrc { impl ObjectImpl for NdiSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
let receiver = glib::ParamSpecString::builder("receiver-ndi-name")
.nick("Receiver NDI Name")
.blurb("NDI stream name of this receiver");
#[cfg(feature = "doc")]
let receiver = receiver.doc_show_default();
vec![ vec![
glib::ParamSpecString::builder("ndi-name") glib::ParamSpecString::builder("ndi-name")
.nick("NDI Name") .nick("NDI Name")
@ -118,11 +124,7 @@ impl ObjectImpl for NdiSrc {
.nick("URL/Address") .nick("URL/Address")
.blurb("URL/address and port of the sender, e.g. 127.0.0.1:5961") .blurb("URL/address and port of the sender, e.g. 127.0.0.1:5961")
.build(), .build(),
glib::ParamSpecString::builder("receiver-ndi-name") receiver.build(),
.nick("Receiver NDI Name")
.blurb("NDI stream name of this receiver")
.doc_show_default()
.build(),
glib::ParamSpecUInt::builder("connect-timeout") glib::ParamSpecUInt::builder("connect-timeout")
.nick("Connect Timeout") .nick("Connect Timeout")
.blurb("Connection timeout in ms") .blurb("Connection timeout in ms")