2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2018-02-19 20:15:52 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:08:08 +00:00
|
|
|
use crate::DiscovererResult;
|
|
|
|
use crate::DiscovererSerializeFlags;
|
|
|
|
use crate::DiscovererStreamInfo;
|
2018-02-19 20:15:52 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
2020-11-22 10:08:08 +00:00
|
|
|
glib::glib_wrapper! {
|
|
|
|
pub struct DiscovererInfo(Object<ffi::GstDiscovererInfo>);
|
2018-02-19 20:15:52 +00:00
|
|
|
|
|
|
|
match fn {
|
2020-11-22 10:08:08 +00:00
|
|
|
get_type => || ffi::gst_discoverer_info_get_type(),
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl DiscovererInfo {
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn copy(&self) -> DiscovererInfo {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_discoverer_info_copy(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_audio_streams(&self) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_audio_streams(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_container_streams(&self) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_container_streams(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_duration(&self) -> gst::ClockTime {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib(ffi::gst_discoverer_info_get_duration(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
2020-11-19 09:16:33 +00:00
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_live(&self) -> bool {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib(ffi::gst_discoverer_info_get_live(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_misc(&self) -> Option<gst::Structure> {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib_none(ffi::gst_discoverer_info_get_misc(self.to_glib_none().0)) }
|
2018-03-15 08:12:46 +00:00
|
|
|
}
|
|
|
|
|
2020-11-22 10:08:08 +00:00
|
|
|
pub fn get_missing_elements_installer_details(&self) -> Vec<glib::GString> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(
|
2020-11-22 10:08:08 +00:00
|
|
|
ffi::gst_discoverer_info_get_missing_elements_installer_details(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
),
|
|
|
|
)
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_result(&self) -> DiscovererResult {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib(ffi::gst_discoverer_info_get_result(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_seekable(&self) -> bool {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib(ffi::gst_discoverer_info_get_seekable(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_stream_info(&self) -> Option<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
from_glib_full(ffi::gst_discoverer_info_get_stream_info(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_stream_list(&self) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_stream_list(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_streams(&self, streamtype: glib::types::Type) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_streams(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
streamtype.to_glib(),
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_subtitle_streams(&self) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_subtitle_streams(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_tags(&self) -> Option<gst::TagList> {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib_none(ffi::gst_discoverer_info_get_tags(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_toc(&self) -> Option<gst::Toc> {
|
2020-11-22 10:08:08 +00:00
|
|
|
unsafe { from_glib_none(ffi::gst_discoverer_info_get_toc(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2020-11-22 10:08:08 +00:00
|
|
|
pub fn get_uri(&self) -> Option<glib::GString> {
|
|
|
|
unsafe { from_glib_none(ffi::gst_discoverer_info_get_uri(self.to_glib_none().0)) }
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 20:00:48 +00:00
|
|
|
pub fn get_video_streams(&self) -> Vec<DiscovererStreamInfo> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_video_streams(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-17 19:00:42 +00:00
|
|
|
pub fn to_variant(
|
|
|
|
&self,
|
|
|
|
flags: DiscovererSerializeFlags,
|
|
|
|
) -> Result<glib::Variant, glib::BoolError> {
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
Option::<_>::from_glib_full(ffi::gst_discoverer_info_to_variant(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
flags.to_glib(),
|
|
|
|
))
|
2020-11-22 10:08:08 +00:00
|
|
|
.ok_or_else(|| glib::glib_bool_error!("Failed to serialize DiscovererInfo to Variant"))
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-17 19:00:42 +00:00
|
|
|
pub fn from_variant(variant: &glib::Variant) -> Result<DiscovererInfo, glib::BoolError> {
|
2019-01-21 20:00:48 +00:00
|
|
|
assert_initialized_main_thread!();
|
2018-02-19 20:15:52 +00:00
|
|
|
unsafe {
|
2020-11-22 10:08:08 +00:00
|
|
|
Option::<_>::from_glib_full(ffi::gst_discoverer_info_from_variant(
|
2019-06-18 10:12:00 +00:00
|
|
|
variant.to_glib_none().0,
|
|
|
|
))
|
2020-11-22 10:08:08 +00:00
|
|
|
.ok_or_else(|| {
|
|
|
|
glib::glib_bool_error!("Failed to deserialize DiscovererInfo from Variant")
|
|
|
|
})
|
2018-02-19 20:15:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-01-21 20:00:48 +00:00
|
|
|
|
|
|
|
unsafe impl Send for DiscovererInfo {}
|
|
|
|
unsafe impl Sync for DiscovererInfo {}
|