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:
Sebastian Dröge 2025-03-26 15:16:26 +02:00 committed by GStreamer Marge Bot
parent 93062673c7
commit a39fe140ef

View file

@ -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) {