gstreamer-rs/gstreamer-pbutils/src/auto/discoverer_info.rs

152 lines
4.8 KiB
Rust
Raw Normal View History

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)
// DO NOT EDIT
2020-11-22 10:08:08 +00:00
use crate::DiscovererResult;
use crate::DiscovererSerializeFlags;
use crate::DiscovererStreamInfo;
use glib::translate::*;
2020-11-22 10:08:08 +00:00
glib::glib_wrapper! {
pub struct DiscovererInfo(Object<ffi::GstDiscovererInfo>);
match fn {
2020-11-22 10:08:08 +00:00
get_type => || ffi::gst_discoverer_info_get_type(),
}
}
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)) }
}
2019-01-21 20:00:48 +00:00
pub fn get_audio_streams(&self) -> Vec<DiscovererStreamInfo> {
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,
))
}
}
2019-01-21 20:00:48 +00:00
pub fn get_container_streams(&self) -> Vec<DiscovererStreamInfo> {
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,
))
}
}
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)) }
}
2019-01-21 20:00:48 +00:00
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[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)) }
}
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> {
unsafe {
FromGlibPtrContainer::from_glib_none(
2020-11-22 10:08:08 +00:00
ffi::gst_discoverer_info_get_missing_elements_installer_details(
self.to_glib_none().0,
),
)
}
}
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)) }
}
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)) }
}
2019-01-21 20:00:48 +00:00
pub fn get_stream_info(&self) -> Option<DiscovererStreamInfo> {
unsafe {
2020-11-22 10:08:08 +00:00
from_glib_full(ffi::gst_discoverer_info_get_stream_info(
self.to_glib_none().0,
))
}
}
2019-01-21 20:00:48 +00:00
pub fn get_stream_list(&self) -> Vec<DiscovererStreamInfo> {
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,
))
}
}
2019-01-21 20:00:48 +00:00
pub fn get_streams(&self, streamtype: glib::types::Type) -> Vec<DiscovererStreamInfo> {
unsafe {
2020-11-22 10:08:08 +00:00
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_streams(
self.to_glib_none().0,
streamtype.to_glib(),
))
}
}
2019-01-21 20:00:48 +00:00
pub fn get_subtitle_streams(&self) -> Vec<DiscovererStreamInfo> {
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,
))
}
}
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)) }
}
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)) }
}
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)) }
}
2019-01-21 20:00:48 +00:00
pub fn get_video_streams(&self) -> Vec<DiscovererStreamInfo> {
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,
))
}
}
pub fn to_variant(
&self,
flags: DiscovererSerializeFlags,
) -> Result<glib::Variant, glib::BoolError> {
unsafe {
2020-11-22 10:08:08 +00:00
Option::<_>::from_glib_full(ffi::gst_discoverer_info_to_variant(
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"))
}
}
pub fn from_variant(variant: &glib::Variant) -> Result<DiscovererInfo, glib::BoolError> {
2019-01-21 20:00:48 +00:00
assert_initialized_main_thread!();
unsafe {
2020-11-22 10:08:08 +00:00
Option::<_>::from_glib_full(ffi::gst_discoverer_info_from_variant(
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")
})
}
}
}
2019-01-21 20:00:48 +00:00
unsafe impl Send for DiscovererInfo {}
unsafe impl Sync for DiscovererInfo {}