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