1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::{prelude::*, translate::*};

use crate::RTSPMediaFactory;

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::RTSPMediaFactory>> Sealed for T {}
}

pub trait RTSPMediaFactoryExtManual: sealed::Sealed + IsA<RTSPMediaFactory> + 'static {
    /// A convenience wrapper around `gst_rtsp_permissions_add_role_from_structure()`.
    /// If `self` had no permissions, new permissions will be created and the
    /// role will be added to it.
    #[doc(alias = "gst_rtsp_media_factory_add_role_from_structure")]
    fn add_role_from_structure(&self, structure: &gst::StructureRef) {
        unsafe {
            ffi::gst_rtsp_media_factory_add_role_from_structure(
                self.as_ref().to_glib_none().0,
                structure.as_mut_ptr(),
            );
        }
    }
}

impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExtManual for O {}