mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 09:53:49 +00:00
childproxy: Add set_child_property_from_str() convenience API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1681>
This commit is contained in:
parent
93062673c7
commit
a39fe140ef
1 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,7 @@ use std::ptr;
|
||||||
|
|
||||||
use glib::{prelude::*, translate::*};
|
use glib::{prelude::*, translate::*};
|
||||||
|
|
||||||
use crate::ChildProxy;
|
use crate::{gobject::GObjectExtManualGst, ChildProxy};
|
||||||
|
|
||||||
pub trait ChildProxyExtManual: IsA<ChildProxy> + 'static {
|
pub trait ChildProxyExtManual: IsA<ChildProxy> + 'static {
|
||||||
#[doc(alias = "gst_child_proxy_lookup")]
|
#[doc(alias = "gst_child_proxy_lookup")]
|
||||||
|
@ -49,6 +49,13 @@ pub trait ChildProxyExtManual: IsA<ChildProxy> + 'static {
|
||||||
child.set_property(pspec.name(), value)
|
child.set_property(pspec.name(), value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[doc(alias = "gst_child_proxy_set")]
|
||||||
|
#[track_caller]
|
||||||
|
fn set_child_property_from_str(&self, name: &str, value: &str) {
|
||||||
|
let (child, pspec) = self.lookup(name).unwrap();
|
||||||
|
child.set_property_from_str(pspec.name(), value)
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(alias = "gst_child_proxy_set_property")]
|
#[doc(alias = "gst_child_proxy_set_property")]
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
fn set_child_property_from_value(&self, name: &str, value: &glib::Value) {
|
fn set_child_property_from_value(&self, name: &str, value: &glib::Value) {
|
||||||
|
|
Loading…
Reference in a new issue