mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-16 05:00:35 +00:00
webrtcsink: Added MID and RID pad properties
This commit is contained in:
parent
542030fd82
commit
15061eb584
|
@ -8742,6 +8742,18 @@
|
||||||
],
|
],
|
||||||
"kind": "object",
|
"kind": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"mid": {
|
||||||
|
"blurb": "The Media Identification (MID) value to produce from this pad",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "NULL",
|
||||||
|
"mutable": "ready",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gchararray",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"msid": {
|
"msid": {
|
||||||
"blurb": "Remote MediaStream ID in use for this pad",
|
"blurb": "Remote MediaStream ID in use for this pad",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
@ -8753,6 +8765,18 @@
|
||||||
"readable": true,
|
"readable": true,
|
||||||
"type": "gchararray",
|
"type": "gchararray",
|
||||||
"writable": true
|
"writable": true
|
||||||
|
},
|
||||||
|
"rid": {
|
||||||
|
"blurb": "The RtpStreamId (RID) value to produce from this pad",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "NULL",
|
||||||
|
"mutable": "ready",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gchararray",
|
||||||
|
"writable": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,6 +12,8 @@ pub struct WebRTCSinkPad {
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
struct Settings {
|
struct Settings {
|
||||||
msid: Option<String>,
|
msid: Option<String>,
|
||||||
|
mid: Option<String>,
|
||||||
|
rid: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
@ -24,10 +26,20 @@ impl ObjectSubclass for WebRTCSinkPad {
|
||||||
impl ObjectImpl for WebRTCSinkPad {
|
impl ObjectImpl for WebRTCSinkPad {
|
||||||
fn properties() -> &'static [glib::ParamSpec] {
|
fn properties() -> &'static [glib::ParamSpec] {
|
||||||
static PROPS: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
static PROPS: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||||
vec![glib::ParamSpecString::builder("msid")
|
vec![
|
||||||
.flags(glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY)
|
glib::ParamSpecString::builder("msid")
|
||||||
.blurb("Remote MediaStream ID in use for this pad")
|
.flags(glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY)
|
||||||
.build()]
|
.blurb("Remote MediaStream ID in use for this pad")
|
||||||
|
.build(),
|
||||||
|
glib::ParamSpecString::builder("mid")
|
||||||
|
.flags(glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY)
|
||||||
|
.blurb("The Media Identification (MID) value to produce from this pad")
|
||||||
|
.build(),
|
||||||
|
glib::ParamSpecString::builder("rid")
|
||||||
|
.flags(glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY)
|
||||||
|
.blurb("The RtpStreamId (RID) value to produce from this pad")
|
||||||
|
.build(),
|
||||||
|
]
|
||||||
});
|
});
|
||||||
PROPS.as_ref()
|
PROPS.as_ref()
|
||||||
}
|
}
|
||||||
|
@ -39,6 +51,16 @@ impl ObjectImpl for WebRTCSinkPad {
|
||||||
.get::<Option<String>>()
|
.get::<Option<String>>()
|
||||||
.expect("type checked upstream")
|
.expect("type checked upstream")
|
||||||
}
|
}
|
||||||
|
"mid" => {
|
||||||
|
settings.mid = value
|
||||||
|
.get::<Option<String>>()
|
||||||
|
.expect("type checked upstream")
|
||||||
|
}
|
||||||
|
"rid" => {
|
||||||
|
settings.rid = value
|
||||||
|
.get::<Option<String>>()
|
||||||
|
.expect("type checked upstream")
|
||||||
|
}
|
||||||
name => panic!("no writable property {name:?}"),
|
name => panic!("no writable property {name:?}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +68,8 @@ impl ObjectImpl for WebRTCSinkPad {
|
||||||
let settings = self.settings.lock().unwrap();
|
let settings = self.settings.lock().unwrap();
|
||||||
match pspec.name() {
|
match pspec.name() {
|
||||||
"msid" => settings.msid.to_value(),
|
"msid" => settings.msid.to_value(),
|
||||||
|
"mid" => settings.mid.to_value(),
|
||||||
|
"rid" => settings.rid.to_value(),
|
||||||
name => panic!("no readable property {name:?}"),
|
name => panic!("no readable property {name:?}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue