// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

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

glib::wrapper! {
    #[doc(alias = "GstRTSPOnvifMedia")]
    pub struct RTSPOnvifMedia(Object<ffi::GstRTSPOnvifMedia, ffi::GstRTSPOnvifMediaClass>) @extends RTSPMedia;

    match fn {
        type_ => || ffi::gst_rtsp_onvif_media_get_type(),
    }
}

impl RTSPOnvifMedia {
    pub const NONE: Option<&'static RTSPOnvifMedia> = None;
}

unsafe impl Send for RTSPOnvifMedia {}
unsafe impl Sync for RTSPOnvifMedia {}

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

pub trait RTSPOnvifMediaExt: IsA<RTSPOnvifMedia> + sealed::Sealed + 'static {
    #[doc(alias = "gst_rtsp_onvif_media_collect_backchannel")]
    fn collect_backchannel(&self) -> bool {
        unsafe {
            from_glib(ffi::gst_rtsp_onvif_media_collect_backchannel(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_rtsp_onvif_media_get_backchannel_bandwidth")]
    #[doc(alias = "get_backchannel_bandwidth")]
    fn backchannel_bandwidth(&self) -> u32 {
        unsafe {
            ffi::gst_rtsp_onvif_media_get_backchannel_bandwidth(self.as_ref().to_glib_none().0)
        }
    }

    #[doc(alias = "gst_rtsp_onvif_media_set_backchannel_bandwidth")]
    fn set_backchannel_bandwidth(&self, bandwidth: u32) {
        unsafe {
            ffi::gst_rtsp_onvif_media_set_backchannel_bandwidth(
                self.as_ref().to_glib_none().0,
                bandwidth,
            );
        }
    }
}

impl<O: IsA<RTSPOnvifMedia>> RTSPOnvifMediaExt for O {}
