// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_player_sys;

glib_wrapper! {
    pub struct PlayerStreamInfo(Object<gst_player_sys::GstPlayerStreamInfo, gst_player_sys::GstPlayerStreamInfoClass, PlayerStreamInfoClass>);

    match fn {
        get_type => || gst_player_sys::gst_player_stream_info_get_type(),
    }
}

unsafe impl Send for PlayerStreamInfo {}
unsafe impl Sync for PlayerStreamInfo {}

pub const NONE_PLAYER_STREAM_INFO: Option<&PlayerStreamInfo> = None;

pub trait PlayerStreamInfoExt: 'static {
    fn get_caps(&self) -> Option<gst::Caps>;

    fn get_codec(&self) -> Option<GString>;

    fn get_index(&self) -> i32;

    fn get_stream_type(&self) -> GString;

    fn get_tags(&self) -> Option<gst::TagList>;
}

impl<O: IsA<PlayerStreamInfo>> PlayerStreamInfoExt for O {
    fn get_caps(&self) -> Option<gst::Caps> {
        unsafe {
            from_glib_none(gst_player_sys::gst_player_stream_info_get_caps(
                const_override(self.as_ref().to_glib_none().0),
            ))
        }
    }

    fn get_codec(&self) -> Option<GString> {
        unsafe {
            from_glib_none(gst_player_sys::gst_player_stream_info_get_codec(
                const_override(self.as_ref().to_glib_none().0),
            ))
        }
    }

    fn get_index(&self) -> i32 {
        unsafe {
            gst_player_sys::gst_player_stream_info_get_index(const_override(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    fn get_stream_type(&self) -> GString {
        unsafe {
            from_glib_none(gst_player_sys::gst_player_stream_info_get_stream_type(
                const_override(self.as_ref().to_glib_none().0),
            ))
        }
    }

    fn get_tags(&self) -> Option<gst::TagList> {
        unsafe {
            from_glib_none(gst_player_sys::gst_player_stream_info_get_tags(
                const_override(self.as_ref().to_glib_none().0),
            ))
        }
    }
}
