// 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::{ffi, PlayAudioInfo, PlayStreamInfo, PlaySubtitleInfo, PlayVideoInfo};
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "GstPlayMediaInfo")]
    pub struct PlayMediaInfo(Object<ffi::GstPlayMediaInfo, ffi::GstPlayMediaInfoClass>);

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

impl PlayMediaInfo {
    #[doc(alias = "gst_play_media_info_get_audio_streams")]
    #[doc(alias = "get_audio_streams")]
    pub fn audio_streams(&self) -> Vec<PlayAudioInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_audio_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_get_container_format")]
    #[doc(alias = "get_container_format")]
    pub fn container_format(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gst_play_media_info_get_container_format(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_get_duration")]
    #[doc(alias = "get_duration")]
    pub fn duration(&self) -> Option<gst::ClockTime> {
        unsafe { from_glib(ffi::gst_play_media_info_get_duration(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_play_media_info_get_image_sample")]
    #[doc(alias = "get_image_sample")]
    pub fn image_sample(&self) -> Option<gst::Sample> {
        unsafe {
            from_glib_none(ffi::gst_play_media_info_get_image_sample(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_get_number_of_audio_streams")]
    #[doc(alias = "get_number_of_audio_streams")]
    pub fn number_of_audio_streams(&self) -> u32 {
        unsafe { ffi::gst_play_media_info_get_number_of_audio_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_play_media_info_get_number_of_streams")]
    #[doc(alias = "get_number_of_streams")]
    pub fn number_of_streams(&self) -> u32 {
        unsafe { ffi::gst_play_media_info_get_number_of_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_play_media_info_get_number_of_subtitle_streams")]
    #[doc(alias = "get_number_of_subtitle_streams")]
    pub fn number_of_subtitle_streams(&self) -> u32 {
        unsafe { ffi::gst_play_media_info_get_number_of_subtitle_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_play_media_info_get_number_of_video_streams")]
    #[doc(alias = "get_number_of_video_streams")]
    pub fn number_of_video_streams(&self) -> u32 {
        unsafe { ffi::gst_play_media_info_get_number_of_video_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_play_media_info_get_stream_list")]
    #[doc(alias = "get_stream_list")]
    pub fn stream_list(&self) -> Vec<PlayStreamInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_stream_list(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_get_subtitle_streams")]
    #[doc(alias = "get_subtitle_streams")]
    pub fn subtitle_streams(&self) -> Vec<PlaySubtitleInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_subtitle_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_get_tags")]
    #[doc(alias = "get_tags")]
    pub fn tags(&self) -> Option<gst::TagList> {
        unsafe { from_glib_none(ffi::gst_play_media_info_get_tags(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_play_media_info_get_title")]
    #[doc(alias = "get_title")]
    pub fn title(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::gst_play_media_info_get_title(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_play_media_info_get_uri")]
    #[doc(alias = "get_uri")]
    pub fn uri(&self) -> glib::GString {
        unsafe { from_glib_none(ffi::gst_play_media_info_get_uri(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_play_media_info_get_video_streams")]
    #[doc(alias = "get_video_streams")]
    pub fn video_streams(&self) -> Vec<PlayVideoInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_play_media_info_get_video_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_play_media_info_is_live")]
    pub fn is_live(&self) -> bool {
        unsafe { from_glib(ffi::gst_play_media_info_is_live(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_play_media_info_is_seekable")]
    pub fn is_seekable(&self) -> bool {
        unsafe { from_glib(ffi::gst_play_media_info_is_seekable(self.to_glib_none().0)) }
    }
}

unsafe impl Send for PlayMediaInfo {}
unsafe impl Sync for PlayMediaInfo {}
