From b8eaef3d026039689c4ccc42814fe08ec1e60db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 27 Jul 2020 10:38:31 +0300 Subject: [PATCH] gstreamer: Add parse_bin_from_description_with_name_full() The non-full variant existed already. --- gstreamer/src/functions.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gstreamer/src/functions.rs b/gstreamer/src/functions.rs index 5b49de71c..fd06fe7d7 100644 --- a/gstreamer/src/functions.rs +++ b/gstreamer/src/functions.rs @@ -59,6 +59,27 @@ pub fn parse_bin_from_description_full( } } +pub fn parse_bin_from_description_with_name_full( + bin_description: &str, + ghost_unlinked_pads: bool, + bin_name: &str, + context: Option<&mut ParseContext>, + flags: ParseFlags, +) -> Result { + assert_initialized_main_thread!(); + + assert_initialized_main_thread!(); + let bin = + parse_bin_from_description_full(bin_description, ghost_unlinked_pads, context, flags)?; + if !bin_name.is_empty() { + let obj = bin.clone().upcast::(); + unsafe { + gst_sys::gst_object_set_name(obj.to_glib_none().0, bin_name.to_glib_none().0); + } + } + Ok(bin) +} + pub fn parse_launch_full( pipeline_description: &str, mut context: Option<&mut ParseContext>,