childproxy: Add set_child_property_from_str() convenience API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1685>
This commit is contained in:
Sebastian Dröge 2025-03-26 15:16:26 +02:00 committed by GStreamer Marge Bot
parent 72a59af809
commit e26fe558ac

View file

@ -4,7 +4,7 @@ use std::ptr;
use glib::{prelude::*, translate::*};
use crate::ChildProxy;
use crate::{gobject::GObjectExtManualGst, ChildProxy};
mod sealed {
pub trait Sealed {}
@ -54,6 +54,13 @@ pub trait ChildProxyExtManual: sealed::Sealed + IsA<ChildProxy> + 'static {
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")]
#[track_caller]
fn set_child_property_from_value(&self, name: &str, value: &glib::Value) {