mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 21:41:03 +00:00
Add a new 'get-consumers' action signal
So user can get the list of currently avalaible consumers (by ID).
This commit is contained in:
parent
4e0e8d1cc3
commit
794df19122
1 changed files with 29 additions and 0 deletions
|
@ -2502,6 +2502,35 @@ impl ObjectImpl for WebRTCSink {
|
|||
glib::types::Type::UNIT.into(),
|
||||
)
|
||||
.build(),
|
||||
|
||||
/*
|
||||
* RsWebRTCSink::get_consumers:
|
||||
*
|
||||
* List all consumers (by ID).
|
||||
*/
|
||||
glib::subclass::Signal::builder(
|
||||
"get-consumers",
|
||||
&[],
|
||||
<Vec<String>>::static_type().into(),
|
||||
)
|
||||
.action()
|
||||
.class_handler(|_, args| {
|
||||
let element = args[0].get::<super::WebRTCSink>().expect("signal arg");
|
||||
let this = element.imp();
|
||||
|
||||
let res = Some(
|
||||
this.state
|
||||
.lock()
|
||||
.unwrap()
|
||||
.consumers
|
||||
.keys()
|
||||
.cloned()
|
||||
.collect::<Vec<String>>()
|
||||
.to_value(),
|
||||
);
|
||||
res
|
||||
})
|
||||
.build(),
|
||||
]
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue