mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-28 02:50:32 +00:00
gstreamer-pbutils: Regenerate
This commit is contained in:
parent
d31badf9ac
commit
34656810ad
16 changed files with 248 additions and 347 deletions
|
@ -2,7 +2,7 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::DiscovererInfo;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
|
@ -13,23 +13,15 @@ use glib::StaticType;
|
|||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
use gobject_sys;
|
||||
use gst;
|
||||
use gst_pbutils_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
use DiscovererInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Discoverer(Object<gst_pbutils_sys::GstDiscoverer, gst_pbutils_sys::GstDiscovererClass>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct Discoverer(Object<ffi::GstDiscoverer, ffi::GstDiscovererClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_get_type(),
|
||||
get_type => || ffi::gst_discoverer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +30,7 @@ impl Discoverer {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_pbutils_sys::gst_discoverer_new(timeout.to_glib(), &mut error);
|
||||
let ret = ffi::gst_discoverer_new(timeout.to_glib(), &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
|
@ -50,7 +42,7 @@ impl Discoverer {
|
|||
pub fn discover_uri(&self, uri: &str) -> Result<DiscovererInfo, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_pbutils_sys::gst_discoverer_discover_uri(
|
||||
let ret = ffi::gst_discoverer_discover_uri(
|
||||
self.to_glib_none().0,
|
||||
uri.to_glib_none().0,
|
||||
&mut error,
|
||||
|
@ -65,11 +57,8 @@ impl Discoverer {
|
|||
|
||||
pub fn discover_uri_async(&self, uri: &str) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_pbutils_sys::gst_discoverer_discover_uri_async(
|
||||
self.to_glib_none().0,
|
||||
uri.to_glib_none().0
|
||||
),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_discoverer_discover_uri_async(self.to_glib_none().0, uri.to_glib_none().0),
|
||||
"Failed to add URI to list of discovers"
|
||||
)
|
||||
}
|
||||
|
@ -77,13 +66,13 @@ impl Discoverer {
|
|||
|
||||
pub fn start(&self) {
|
||||
unsafe {
|
||||
gst_pbutils_sys::gst_discoverer_start(self.to_glib_none().0);
|
||||
ffi::gst_discoverer_start(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stop(&self) {
|
||||
unsafe {
|
||||
gst_pbutils_sys::gst_discoverer_stop(self.to_glib_none().0);
|
||||
ffi::gst_discoverer_stop(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,8 +81,8 @@ impl Discoverer {
|
|||
pub fn get_property_use_cache(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"use-cache\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -108,8 +97,8 @@ impl Discoverer {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
pub fn set_property_use_cache(&self, use_cache: bool) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"use-cache\0".as_ptr() as *const _,
|
||||
Value::from(&use_cache).to_glib_none().0,
|
||||
);
|
||||
|
@ -125,10 +114,10 @@ impl Discoverer {
|
|||
unsafe extern "C" fn discovered_trampoline<
|
||||
F: Fn(&Discoverer, &DiscovererInfo, Option<&glib::Error>) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
info: *mut gst_pbutils_sys::GstDiscovererInfo,
|
||||
error: *mut glib_sys::GError,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
info: *mut ffi::GstDiscovererInfo,
|
||||
error: *mut glib::ffi::GError,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
|
@ -157,8 +146,8 @@ impl Discoverer {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn finished_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
@ -183,9 +172,9 @@ impl Discoverer {
|
|||
unsafe extern "C" fn source_setup_trampoline<
|
||||
F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
source: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
source: *mut gst::ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(source))
|
||||
|
@ -208,8 +197,8 @@ impl Discoverer {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn starting_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
@ -236,9 +225,9 @@ impl Discoverer {
|
|||
unsafe extern "C" fn notify_use_cache_trampoline<
|
||||
F: Fn(&Discoverer) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_pbutils_sys::GstDiscoverer,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDiscoverer,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
|
|
@ -2,54 +2,50 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::DiscovererStreamInfo;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererStreamInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererAudioInfo(Object<gst_pbutils_sys::GstDiscovererAudioInfo>) @extends DiscovererStreamInfo;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererAudioInfo(Object<ffi::GstDiscovererAudioInfo>) @extends DiscovererStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_audio_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_audio_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DiscovererAudioInfo {
|
||||
pub fn get_bitrate(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_bitrate(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_bitrate(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn get_channel_mask(&self) -> u64 {
|
||||
unsafe {
|
||||
gst_pbutils_sys::gst_discoverer_audio_info_get_channel_mask(self.to_glib_none().0)
|
||||
}
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_channel_mask(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_channels(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_channels(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_channels(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_depth(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_depth(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_depth(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_language(&self) -> Option<GString> {
|
||||
pub fn get_language(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_audio_info_get_language(
|
||||
from_glib_none(ffi::gst_discoverer_audio_info_get_language(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_max_bitrate(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_max_bitrate(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_max_bitrate(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_sample_rate(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_sample_rate(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_audio_info_get_sample_rate(self.to_glib_none().0) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,24 +2,23 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::DiscovererStreamInfo;
|
||||
use glib::translate::*;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererStreamInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererContainerInfo(Object<gst_pbutils_sys::GstDiscovererContainerInfo>) @extends DiscovererStreamInfo;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererContainerInfo(Object<ffi::GstDiscovererContainerInfo>) @extends DiscovererStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_container_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_container_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DiscovererContainerInfo {
|
||||
pub fn get_streams(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_container_info_get_streams(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_container_info_get_streams(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,78 +2,58 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::DiscovererResult;
|
||||
use crate::DiscovererSerializeFlags;
|
||||
use crate::DiscovererStreamInfo;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererResult;
|
||||
use DiscovererSerializeFlags;
|
||||
use DiscovererStreamInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererInfo(Object<gst_pbutils_sys::GstDiscovererInfo>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererInfo(Object<ffi::GstDiscovererInfo>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DiscovererInfo {
|
||||
pub fn copy(&self) -> DiscovererInfo {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_discoverer_info_copy(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_discoverer_info_copy(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_audio_streams(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_audio_streams(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_audio_streams(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_container_streams(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_container_streams(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_container_streams(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_duration(&self) -> gst::ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_info_get_duration(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_discoverer_info_get_duration(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn get_live(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_info_get_live(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_discoverer_info_get_live(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_misc(&self) -> Option<gst::Structure> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_misc(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_none(ffi::gst_discoverer_info_get_misc(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_missing_elements_installer_details(&self) -> Vec<GString> {
|
||||
pub fn get_missing_elements_installer_details(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_missing_elements_installer_details(
|
||||
ffi::gst_discoverer_info_get_missing_elements_installer_details(
|
||||
self.to_glib_none().0,
|
||||
),
|
||||
)
|
||||
|
@ -81,24 +61,16 @@ impl DiscovererInfo {
|
|||
}
|
||||
|
||||
pub fn get_result(&self) -> DiscovererResult {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_info_get_result(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_discoverer_info_get_result(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_seekable(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_info_get_seekable(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_discoverer_info_get_seekable(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_stream_info(&self) -> Option<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_stream_info(
|
||||
from_glib_full(ffi::gst_discoverer_info_get_stream_info(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -106,15 +78,15 @@ impl DiscovererInfo {
|
|||
|
||||
pub fn get_stream_list(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_stream_list(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_stream_list(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_streams(&self, streamtype: glib::types::Type) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_streams(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_streams(
|
||||
self.to_glib_none().0,
|
||||
streamtype.to_glib(),
|
||||
))
|
||||
|
@ -123,41 +95,29 @@ impl DiscovererInfo {
|
|||
|
||||
pub fn get_subtitle_streams(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_subtitle_streams(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_subtitle_streams(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_tags(&self) -> Option<gst::TagList> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_tags(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_none(ffi::gst_discoverer_info_get_tags(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_toc(&self) -> Option<gst::Toc> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_toc(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_none(ffi::gst_discoverer_info_get_toc(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_uri(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_uri(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
pub fn get_uri(&self) -> Option<glib::GString> {
|
||||
unsafe { from_glib_none(ffi::gst_discoverer_info_get_uri(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_video_streams(&self) -> Vec<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_discoverer_info_get_video_streams(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_info_get_video_streams(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,21 +126,23 @@ impl DiscovererInfo {
|
|||
flags: DiscovererSerializeFlags,
|
||||
) -> Result<glib::Variant, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_discoverer_info_to_variant(
|
||||
Option::<_>::from_glib_full(ffi::gst_discoverer_info_to_variant(
|
||||
self.to_glib_none().0,
|
||||
flags.to_glib(),
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to serialize DiscovererInfo to Variant"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to serialize DiscovererInfo to Variant"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_variant(variant: &glib::Variant) -> Result<DiscovererInfo, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_discoverer_info_from_variant(
|
||||
Option::<_>::from_glib_full(ffi::gst_discoverer_info_from_variant(
|
||||
variant.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to deserialize DiscovererInfo from Variant"))
|
||||
.ok_or_else(|| {
|
||||
glib::glib_bool_error!("Failed to deserialize DiscovererInfo from Variant")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,12 @@
|
|||
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst;
|
||||
use gst_pbutils_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererStreamInfo(Object<gst_pbutils_sys::GstDiscovererStreamInfo>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererStreamInfo(Object<ffi::GstDiscovererStreamInfo>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_stream_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_stream_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,9 +27,9 @@ pub trait DiscovererStreamInfoExt: 'static {
|
|||
|
||||
fn get_previous(&self) -> Option<DiscovererStreamInfo>;
|
||||
|
||||
fn get_stream_id(&self) -> Option<GString>;
|
||||
fn get_stream_id(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_stream_type_nick(&self) -> GString;
|
||||
fn get_stream_type_nick(&self) -> glib::GString;
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList>;
|
||||
|
||||
|
@ -42,7 +39,7 @@ pub trait DiscovererStreamInfoExt: 'static {
|
|||
impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
|
||||
fn get_caps(&self) -> Option<gst::Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_caps(
|
||||
from_glib_full(ffi::gst_discoverer_stream_info_get_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -50,7 +47,7 @@ impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
|
|||
|
||||
fn get_misc(&self) -> Option<gst::Structure> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_misc(
|
||||
from_glib_none(ffi::gst_discoverer_stream_info_get_misc(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -58,7 +55,7 @@ impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
|
|||
|
||||
fn get_next(&self) -> Option<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_next(
|
||||
from_glib_full(ffi::gst_discoverer_stream_info_get_next(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -66,33 +63,31 @@ impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
|
|||
|
||||
fn get_previous(&self) -> Option<DiscovererStreamInfo> {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_previous(
|
||||
from_glib_full(ffi::gst_discoverer_stream_info_get_previous(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_id(&self) -> Option<GString> {
|
||||
fn get_stream_id(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_stream_id(
|
||||
from_glib_none(ffi::gst_discoverer_stream_info_get_stream_id(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stream_type_nick(&self) -> GString {
|
||||
fn get_stream_type_nick(&self) -> glib::GString {
|
||||
unsafe {
|
||||
from_glib_none(
|
||||
gst_pbutils_sys::gst_discoverer_stream_info_get_stream_type_nick(
|
||||
self.as_ref().to_glib_none().0,
|
||||
),
|
||||
)
|
||||
from_glib_none(ffi::gst_discoverer_stream_info_get_stream_type_nick(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tags(&self) -> Option<gst::TagList> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_tags(
|
||||
from_glib_none(ffi::gst_discoverer_stream_info_get_tags(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -100,7 +95,7 @@ impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
|
|||
|
||||
fn get_toc(&self) -> Option<gst::Toc> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_toc(
|
||||
from_glib_none(ffi::gst_discoverer_stream_info_get_toc(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -2,23 +2,21 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::DiscovererStreamInfo;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererStreamInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererSubtitleInfo(Object<gst_pbutils_sys::GstDiscovererSubtitleInfo>) @extends DiscovererStreamInfo;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererSubtitleInfo(Object<ffi::GstDiscovererSubtitleInfo>) @extends DiscovererStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_subtitle_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_subtitle_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DiscovererSubtitleInfo {
|
||||
pub fn get_language(&self) -> Option<GString> {
|
||||
pub fn get_language(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_discoverer_subtitle_info_get_language(
|
||||
from_glib_none(ffi::gst_discoverer_subtitle_info_get_language(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -2,42 +2,41 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::DiscovererStreamInfo;
|
||||
use glib::translate::*;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererStreamInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DiscovererVideoInfo(Object<gst_pbutils_sys::GstDiscovererVideoInfo>) @extends DiscovererStreamInfo;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DiscovererVideoInfo(Object<ffi::GstDiscovererVideoInfo>) @extends DiscovererStreamInfo;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_discoverer_video_info_get_type(),
|
||||
get_type => || ffi::gst_discoverer_video_info_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DiscovererVideoInfo {
|
||||
pub fn get_bitrate(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_bitrate(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_video_info_get_bitrate(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_depth(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_depth(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_video_info_get_depth(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_height(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_height(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_video_info_get_height(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_max_bitrate(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_max_bitrate(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_video_info_get_max_bitrate(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_width(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_width(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_discoverer_video_info_get_width(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn is_image(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_image(
|
||||
from_glib(ffi::gst_discoverer_video_info_is_image(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -45,7 +44,7 @@ impl DiscovererVideoInfo {
|
|||
|
||||
pub fn is_interlaced(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_interlaced(
|
||||
from_glib(ffi::gst_discoverer_video_info_is_interlaced(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::EncodingProfile;
|
||||
use glib::translate::*;
|
||||
use gst_pbutils_sys;
|
||||
use EncodingProfile;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingAudioProfile(Object<gst_pbutils_sys::GstEncodingAudioProfile, gst_pbutils_sys::GstEncodingAudioProfileClass>) @extends EncodingProfile;
|
||||
glib::glib_wrapper! {
|
||||
pub struct EncodingAudioProfile(Object<ffi::GstEncodingAudioProfile, ffi::GstEncodingAudioProfileClass>) @extends EncodingProfile;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_encoding_audio_profile_get_type(),
|
||||
get_type => || ffi::gst_encoding_audio_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,36 +2,33 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::EncodingProfile;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_pbutils_sys;
|
||||
use EncodingProfile;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingContainerProfile(Object<gst_pbutils_sys::GstEncodingContainerProfile, gst_pbutils_sys::GstEncodingContainerProfileClass>) @extends EncodingProfile;
|
||||
glib::glib_wrapper! {
|
||||
pub struct EncodingContainerProfile(Object<ffi::GstEncodingContainerProfile, ffi::GstEncodingContainerProfileClass>) @extends EncodingProfile;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_encoding_container_profile_get_type(),
|
||||
get_type => || ffi::gst_encoding_container_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodingContainerProfile {
|
||||
pub fn contains_profile<P: IsA<EncodingProfile>>(&self, profile: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(
|
||||
gst_pbutils_sys::gst_encoding_container_profile_contains_profile(
|
||||
self.to_glib_none().0,
|
||||
profile.as_ref().to_glib_none().0,
|
||||
),
|
||||
)
|
||||
from_glib(ffi::gst_encoding_container_profile_contains_profile(
|
||||
self.to_glib_none().0,
|
||||
profile.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_profiles(&self) -> Vec<EncodingProfile> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(
|
||||
gst_pbutils_sys::gst_encoding_container_profile_get_profiles(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_encoding_container_profile_get_profiles(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,19 +2,15 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::DiscovererInfo;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst;
|
||||
use gst_pbutils_sys;
|
||||
use DiscovererInfo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingProfile(Object<gst_pbutils_sys::GstEncodingProfile, gst_pbutils_sys::GstEncodingProfileClass>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct EncodingProfile(Object<ffi::GstEncodingProfile, ffi::GstEncodingProfileClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_encoding_profile_get_type(),
|
||||
get_type => || ffi::gst_encoding_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +22,7 @@ impl EncodingProfile {
|
|||
) -> Option<EncodingProfile> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_profile_find(
|
||||
from_glib_full(ffi::gst_encoding_profile_find(
|
||||
targetname.to_glib_none().0,
|
||||
profilename.to_glib_none().0,
|
||||
category.to_glib_none().0,
|
||||
|
@ -37,10 +33,12 @@ impl EncodingProfile {
|
|||
pub fn from_discoverer(info: &DiscovererInfo) -> Result<EncodingProfile, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_encoding_profile_from_discoverer(
|
||||
Option::<_>::from_glib_full(ffi::gst_encoding_profile_from_discoverer(
|
||||
info.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create EncodingProfile from DiscovererInfo"))
|
||||
.ok_or_else(|| {
|
||||
glib::glib_bool_error!("Failed to create EncodingProfile from DiscovererInfo")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,27 +55,27 @@ pub trait EncodingProfileExt: 'static {
|
|||
|
||||
fn get_allow_dynamic_output(&self) -> bool;
|
||||
|
||||
fn get_description(&self) -> Option<GString>;
|
||||
fn get_description(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_file_extension(&self) -> Option<GString>;
|
||||
fn get_file_extension(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_format(&self) -> gst::Caps;
|
||||
|
||||
fn get_input_caps(&self) -> gst::Caps;
|
||||
|
||||
fn get_name(&self) -> Option<GString>;
|
||||
fn get_name(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_presence(&self) -> u32;
|
||||
|
||||
fn get_preset(&self) -> Option<GString>;
|
||||
fn get_preset(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_preset_name(&self) -> Option<GString>;
|
||||
fn get_preset_name(&self) -> Option<glib::GString>;
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
fn get_single_segment(&self) -> bool;
|
||||
|
||||
fn get_type_nick(&self) -> Option<GString>;
|
||||
fn get_type_nick(&self) -> Option<glib::GString>;
|
||||
|
||||
fn is_enabled(&self) -> bool;
|
||||
|
||||
|
@ -89,7 +87,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
fn copy(&self) -> EncodingProfile {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_profile_copy(
|
||||
from_glib_full(ffi::gst_encoding_profile_copy(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -97,25 +95,23 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
|
||||
fn get_allow_dynamic_output(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(
|
||||
gst_pbutils_sys::gst_encoding_profile_get_allow_dynamic_output(
|
||||
self.as_ref().to_glib_none().0,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_description(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_description(
|
||||
from_glib(ffi::gst_encoding_profile_get_allow_dynamic_output(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_file_extension(&self) -> Option<GString> {
|
||||
fn get_description(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_file_extension(
|
||||
from_glib_none(ffi::gst_encoding_profile_get_description(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_file_extension(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_encoding_profile_get_file_extension(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -123,7 +119,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
|
||||
fn get_format(&self) -> gst::Caps {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_format(
|
||||
from_glib_full(ffi::gst_encoding_profile_get_format(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -131,37 +127,35 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
|
||||
fn get_input_caps(&self) -> gst::Caps {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_input_caps(
|
||||
from_glib_full(ffi::gst_encoding_profile_get_input_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_name(&self) -> Option<GString> {
|
||||
fn get_name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_name(
|
||||
from_glib_none(ffi::gst_encoding_profile_get_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_presence(&self) -> u32 {
|
||||
unsafe {
|
||||
gst_pbutils_sys::gst_encoding_profile_get_presence(self.as_ref().to_glib_none().0)
|
||||
}
|
||||
unsafe { ffi::gst_encoding_profile_get_presence(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_preset(&self) -> Option<GString> {
|
||||
fn get_preset(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset(
|
||||
from_glib_none(ffi::gst_encoding_profile_get_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_preset_name(&self) -> Option<GString> {
|
||||
fn get_preset_name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset_name(
|
||||
from_glib_none(ffi::gst_encoding_profile_get_preset_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -171,15 +165,15 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
fn get_single_segment(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_encoding_profile_get_single_segment(
|
||||
from_glib(ffi::gst_encoding_profile_get_single_segment(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_type_nick(&self) -> Option<GString> {
|
||||
fn get_type_nick(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_type_nick(
|
||||
from_glib_none(ffi::gst_encoding_profile_get_type_nick(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -187,7 +181,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
|
||||
fn is_enabled(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_encoding_profile_is_enabled(
|
||||
from_glib(ffi::gst_encoding_profile_is_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -195,7 +189,7 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
|
|||
|
||||
fn is_equal<P: IsA<EncodingProfile>>(&self, b: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_pbutils_sys::gst_encoding_profile_is_equal(
|
||||
from_glib(ffi::gst_encoding_profile_is_equal(
|
||||
self.as_ref().to_glib_none().0,
|
||||
b.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
|
|
@ -2,19 +2,15 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::EncodingProfile;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_pbutils_sys;
|
||||
use std;
|
||||
use std::ptr;
|
||||
use EncodingProfile;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingTarget(Object<gst_pbutils_sys::GstEncodingTarget>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct EncodingTarget(Object<ffi::GstEncodingTarget>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_encoding_target_get_type(),
|
||||
get_type => || ffi::gst_encoding_target_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +23,7 @@ impl EncodingTarget {
|
|||
) -> EncodingTarget {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_target_new(
|
||||
from_glib_full(ffi::gst_encoding_target_new(
|
||||
name.to_glib_none().0,
|
||||
category.to_glib_none().0,
|
||||
description.to_glib_none().0,
|
||||
|
@ -36,43 +32,31 @@ impl EncodingTarget {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_category(&self) -> GString {
|
||||
pub fn get_category(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_encoding_target_get_category(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_description(&self) -> glib::GString {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_category(
|
||||
from_glib_none(ffi::gst_encoding_target_get_description(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_description(&self) -> GString {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_description(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_name(&self) -> GString {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_name(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
pub fn get_name(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_encoding_target_get_name(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
pub fn get_path(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_path(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
pub fn get_path(&self) -> Option<glib::GString> {
|
||||
unsafe { from_glib_none(ffi::gst_encoding_target_get_path(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_profile(&self, name: &str) -> Option<EncodingProfile> {
|
||||
unsafe {
|
||||
from_glib_full(gst_pbutils_sys::gst_encoding_target_get_profile(
|
||||
from_glib_full(ffi::gst_encoding_target_get_profile(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -81,7 +65,7 @@ impl EncodingTarget {
|
|||
|
||||
pub fn get_profiles(&self) -> Vec<EncodingProfile> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(gst_pbutils_sys::gst_encoding_target_get_profiles(
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_encoding_target_get_profiles(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -90,7 +74,7 @@ impl EncodingTarget {
|
|||
pub fn save(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = gst_pbutils_sys::gst_encoding_target_save(self.to_glib_none().0, &mut error);
|
||||
let _ = ffi::gst_encoding_target_save(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -102,7 +86,7 @@ impl EncodingTarget {
|
|||
pub fn save_to_file<P: AsRef<std::path::Path>>(&self, filepath: P) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = gst_pbutils_sys::gst_encoding_target_save_to_file(
|
||||
let _ = ffi::gst_encoding_target_save_to_file(
|
||||
self.to_glib_none().0,
|
||||
filepath.as_ref().to_glib_none().0,
|
||||
&mut error,
|
||||
|
@ -119,7 +103,7 @@ impl EncodingTarget {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_pbutils_sys::gst_encoding_target_load(
|
||||
let ret = ffi::gst_encoding_target_load(
|
||||
name.to_glib_none().0,
|
||||
category.to_glib_none().0,
|
||||
&mut error,
|
||||
|
@ -138,7 +122,7 @@ impl EncodingTarget {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_pbutils_sys::gst_encoding_target_load_from_file(
|
||||
let ret = ffi::gst_encoding_target_load_from_file(
|
||||
filepath.as_ref().to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
|
|
|
@ -2,30 +2,27 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::EncodingProfile;
|
||||
use glib::translate::*;
|
||||
use gst_pbutils_sys;
|
||||
use EncodingProfile;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct EncodingVideoProfile(Object<gst_pbutils_sys::GstEncodingVideoProfile, gst_pbutils_sys::GstEncodingVideoProfileClass>) @extends EncodingProfile;
|
||||
glib::glib_wrapper! {
|
||||
pub struct EncodingVideoProfile(Object<ffi::GstEncodingVideoProfile, ffi::GstEncodingVideoProfileClass>) @extends EncodingProfile;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_pbutils_sys::gst_encoding_video_profile_get_type(),
|
||||
get_type => || ffi::gst_encoding_video_profile_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl EncodingVideoProfile {
|
||||
pub fn get_pass(&self) -> u32 {
|
||||
unsafe { gst_pbutils_sys::gst_encoding_video_profile_get_pass(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_encoding_video_profile_get_pass(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_variableframerate(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(
|
||||
gst_pbutils_sys::gst_encoding_video_profile_get_variableframerate(
|
||||
self.to_glib_none().0,
|
||||
),
|
||||
)
|
||||
from_glib(ffi::gst_encoding_video_profile_get_variableframerate(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,6 @@ use glib::value::SetValue;
|
|||
use glib::value::Value;
|
||||
use glib::StaticType;
|
||||
use glib::Type;
|
||||
use gobject_sys;
|
||||
use gst_pbutils_sys;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
|
@ -27,24 +25,24 @@ pub enum DiscovererResult {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for DiscovererResult {
|
||||
type GlibType = gst_pbutils_sys::GstDiscovererResult;
|
||||
type GlibType = ffi::GstDiscovererResult;
|
||||
|
||||
fn to_glib(&self) -> gst_pbutils_sys::GstDiscovererResult {
|
||||
fn to_glib(&self) -> ffi::GstDiscovererResult {
|
||||
match *self {
|
||||
DiscovererResult::Ok => gst_pbutils_sys::GST_DISCOVERER_OK,
|
||||
DiscovererResult::UriInvalid => gst_pbutils_sys::GST_DISCOVERER_URI_INVALID,
|
||||
DiscovererResult::Error => gst_pbutils_sys::GST_DISCOVERER_ERROR,
|
||||
DiscovererResult::Timeout => gst_pbutils_sys::GST_DISCOVERER_TIMEOUT,
|
||||
DiscovererResult::Busy => gst_pbutils_sys::GST_DISCOVERER_BUSY,
|
||||
DiscovererResult::MissingPlugins => gst_pbutils_sys::GST_DISCOVERER_MISSING_PLUGINS,
|
||||
DiscovererResult::Ok => ffi::GST_DISCOVERER_OK,
|
||||
DiscovererResult::UriInvalid => ffi::GST_DISCOVERER_URI_INVALID,
|
||||
DiscovererResult::Error => ffi::GST_DISCOVERER_ERROR,
|
||||
DiscovererResult::Timeout => ffi::GST_DISCOVERER_TIMEOUT,
|
||||
DiscovererResult::Busy => ffi::GST_DISCOVERER_BUSY,
|
||||
DiscovererResult::MissingPlugins => ffi::GST_DISCOVERER_MISSING_PLUGINS,
|
||||
DiscovererResult::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_pbutils_sys::GstDiscovererResult> for DiscovererResult {
|
||||
fn from_glib(value: gst_pbutils_sys::GstDiscovererResult) -> Self {
|
||||
impl FromGlib<ffi::GstDiscovererResult> for DiscovererResult {
|
||||
fn from_glib(value: ffi::GstDiscovererResult) -> Self {
|
||||
skip_assert_initialized!();
|
||||
match value {
|
||||
0 => DiscovererResult::Ok,
|
||||
|
@ -60,7 +58,7 @@ impl FromGlib<gst_pbutils_sys::GstDiscovererResult> for DiscovererResult {
|
|||
|
||||
impl StaticType for DiscovererResult {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_pbutils_sys::gst_discoverer_result_get_type()) }
|
||||
unsafe { from_glib(ffi::gst_discoverer_result_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,12 +70,12 @@ impl<'a> FromValueOptional<'a> for DiscovererResult {
|
|||
|
||||
impl<'a> FromValue<'a> for DiscovererResult {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for DiscovererResult {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use bitflags::bitflags;
|
||||
use glib::translate::*;
|
||||
use glib::value::FromValue;
|
||||
use glib::value::FromValueOptional;
|
||||
|
@ -9,8 +10,6 @@ use glib::value::SetValue;
|
|||
use glib::value::Value;
|
||||
use glib::StaticType;
|
||||
use glib::Type;
|
||||
use gobject_sys;
|
||||
use gst_pbutils_sys;
|
||||
|
||||
bitflags! {
|
||||
pub struct DiscovererSerializeFlags: u32 {
|
||||
|
@ -22,16 +21,16 @@ bitflags! {
|
|||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for DiscovererSerializeFlags {
|
||||
type GlibType = gst_pbutils_sys::GstDiscovererSerializeFlags;
|
||||
type GlibType = ffi::GstDiscovererSerializeFlags;
|
||||
|
||||
fn to_glib(&self) -> gst_pbutils_sys::GstDiscovererSerializeFlags {
|
||||
fn to_glib(&self) -> ffi::GstDiscovererSerializeFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<gst_pbutils_sys::GstDiscovererSerializeFlags> for DiscovererSerializeFlags {
|
||||
fn from_glib(value: gst_pbutils_sys::GstDiscovererSerializeFlags) -> DiscovererSerializeFlags {
|
||||
impl FromGlib<ffi::GstDiscovererSerializeFlags> for DiscovererSerializeFlags {
|
||||
fn from_glib(value: ffi::GstDiscovererSerializeFlags) -> DiscovererSerializeFlags {
|
||||
skip_assert_initialized!();
|
||||
DiscovererSerializeFlags::from_bits_truncate(value)
|
||||
}
|
||||
|
@ -39,7 +38,7 @@ impl FromGlib<gst_pbutils_sys::GstDiscovererSerializeFlags> for DiscovererSerial
|
|||
|
||||
impl StaticType for DiscovererSerializeFlags {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(gst_pbutils_sys::gst_discoverer_serialize_flags_get_type()) }
|
||||
unsafe { from_glib(ffi::gst_discoverer_serialize_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,12 +50,12 @@ impl<'a> FromValueOptional<'a> for DiscovererSerializeFlags {
|
|||
|
||||
impl<'a> FromValue<'a> for DiscovererSerializeFlags {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
|
||||
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for DiscovererSerializeFlags {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,58 +2,53 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::EncodingTarget;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_pbutils_sys;
|
||||
use std::mem;
|
||||
use EncodingTarget;
|
||||
|
||||
pub fn encoding_list_all_targets(categoryname: Option<&str>) -> Vec<EncodingTarget> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_encoding_list_all_targets(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_encoding_list_all_targets(
|
||||
categoryname.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn encoding_list_available_categories() -> Vec<GString> {
|
||||
pub fn encoding_list_available_categories() -> Vec<glib::GString> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_pbutils_sys::gst_encoding_list_available_categories(),
|
||||
)
|
||||
}
|
||||
unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_encoding_list_available_categories()) }
|
||||
}
|
||||
|
||||
pub fn pb_utils_get_element_description(factory_name: &str) -> Result<GString, glib::BoolError> {
|
||||
pub fn pb_utils_get_element_description(
|
||||
factory_name: &str,
|
||||
) -> Result<glib::GString, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_pb_utils_get_element_description(
|
||||
Option::<_>::from_glib_full(ffi::gst_pb_utils_get_element_description(
|
||||
factory_name.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to get element description"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to get element description"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pb_utils_get_sink_description(protocol: &str) -> Result<GString, glib::BoolError> {
|
||||
pub fn pb_utils_get_sink_description(protocol: &str) -> Result<glib::GString, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_pb_utils_get_sink_description(
|
||||
Option::<_>::from_glib_full(ffi::gst_pb_utils_get_sink_description(
|
||||
protocol.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to get sink description"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to get sink description"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pb_utils_get_source_description(protocol: &str) -> Result<GString, glib::BoolError> {
|
||||
pub fn pb_utils_get_source_description(protocol: &str) -> Result<glib::GString, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_pbutils_sys::gst_pb_utils_get_source_description(
|
||||
Option::<_>::from_glib_full(ffi::gst_pb_utils_get_source_description(
|
||||
protocol.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to get source description"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to get source description"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +59,7 @@ pub fn plugins_base_version() -> (u32, u32, u32, u32) {
|
|||
let mut minor = mem::MaybeUninit::uninit();
|
||||
let mut micro = mem::MaybeUninit::uninit();
|
||||
let mut nano = mem::MaybeUninit::uninit();
|
||||
gst_pbutils_sys::gst_plugins_base_version(
|
||||
ffi::gst_plugins_base_version(
|
||||
major.as_mut_ptr(),
|
||||
minor.as_mut_ptr(),
|
||||
micro.as_mut_ptr(),
|
||||
|
@ -78,7 +73,7 @@ pub fn plugins_base_version() -> (u32, u32, u32, u32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn plugins_base_version_string() -> GString {
|
||||
pub fn plugins_base_version_string() -> glib::GString {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib_full(gst_pbutils_sys::gst_plugins_base_version_string()) }
|
||||
unsafe { from_glib_full(ffi::gst_plugins_base_version_string()) }
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 9739801c)
|
||||
|
|
Loading…
Reference in a new issue