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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-03-07 09:07:30 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::Object;
|
2018-03-07 09:07:30 +00:00
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstBufferPool")]
|
2020-11-21 13:46:33 +00:00
|
|
|
pub struct BufferPool(Object<ffi::GstBufferPool, ffi::GstBufferPoolClass>) @extends Object;
|
2018-03-07 09:07:30 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_buffer_pool_get_type(),
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for BufferPool {}
|
|
|
|
unsafe impl Sync for BufferPool {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_BUFFER_POOL: Option<&BufferPool> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait BufferPoolExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_buffer_pool_get_options")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_options")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn options(&self) -> Vec<glib::GString>;
|
2018-03-07 09:07:30 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_buffer_pool_has_option")]
|
2018-03-07 09:07:30 +00:00
|
|
|
fn has_option(&self, option: &str) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_buffer_pool_is_active")]
|
2018-03-07 09:07:30 +00:00
|
|
|
fn is_active(&self) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_buffer_pool_set_active")]
|
2018-03-07 09:07:30 +00:00
|
|
|
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_buffer_pool_set_flushing")]
|
2018-03-07 09:07:30 +00:00
|
|
|
fn set_flushing(&self, flushing: bool);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
2021-04-11 19:38:18 +00:00
|
|
|
fn options(&self) -> Vec<glib::GString> {
|
2018-03-07 09:07:30 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(ffi::gst_buffer_pool_get_options(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn has_option(&self, option: &str) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_buffer_pool_has_option(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
option.to_glib_none().0,
|
|
|
|
))
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_active(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_buffer_pool_is_active(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2021-04-27 15:10:39 +00:00
|
|
|
ffi::gst_buffer_pool_set_active(self.as_ref().to_glib_none().0, active.into_glib()),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to activate buffer pool"
|
|
|
|
)
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_flushing(&self, flushing: bool) {
|
|
|
|
unsafe {
|
2021-04-27 15:10:39 +00:00
|
|
|
ffi::gst_buffer_pool_set_flushing(self.as_ref().to_glib_none().0, flushing.into_glib());
|
2018-03-07 09:07:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|