gstreamer/
dynamic_type_factory.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{DynamicTypeFactory, Plugin, ffi};
6
7impl DynamicTypeFactory {
8    #[doc(alias = "gst_dynamic_type_register")]
9    pub fn register(
10        plugin: Option<&Plugin>,
11        type_: glib::types::Type,
12    ) -> Result<(), glib::error::BoolError> {
13        skip_assert_initialized!();
14        unsafe {
15            glib::result_from_gboolean!(
16                ffi::gst_dynamic_type_register(plugin.to_glib_none().0, type_.into_glib()),
17                "Failed to register dynamic type factory"
18            )
19        }
20    }
21}