mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-04-15 04:14:07 +00:00
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:
parent
72a59af809
commit
e26fe558ac
1 changed files with 8 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue