gstreamer-rs/gstreamer-gl/src/auto/gl_framebuffer.rs

97 lines
2.9 KiB
Rust
Raw Normal View History

2018-11-27 21:52:42 +00:00
// 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)
2018-11-27 21:52:42 +00:00
// DO NOT EDIT
use crate::{GLBaseMemory, GLContext};
use glib::{prelude::*, translate::*};
2018-11-27 21:52:42 +00:00
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstGLFramebuffer")]
2020-11-22 10:20:20 +00:00
pub struct GLFramebuffer(Object<ffi::GstGLFramebuffer, ffi::GstGLFramebufferClass>) @extends gst::Object;
2018-11-27 21:52:42 +00:00
match fn {
type_ => || ffi::gst_gl_framebuffer_get_type(),
2018-11-27 21:52:42 +00:00
}
}
impl GLFramebuffer {
2021-11-16 14:02:58 +00:00
pub const NONE: Option<&'static GLFramebuffer> = None;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_framebuffer_new")]
pub fn new(context: &impl IsA<GLContext>) -> GLFramebuffer {
2018-11-27 21:52:42 +00:00
skip_assert_initialized!();
unsafe {
2020-11-22 10:20:20 +00:00
from_glib_full(ffi::gst_gl_framebuffer_new(
context.as_ref().to_glib_none().0,
))
2018-11-27 21:52:42 +00:00
}
}
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_framebuffer_new_with_default_depth")]
#[doc(alias = "new_with_default_depth")]
pub fn with_default_depth(
context: &impl IsA<GLContext>,
width: u32,
height: u32,
) -> GLFramebuffer {
2018-11-27 21:52:42 +00:00
skip_assert_initialized!();
unsafe {
2020-11-22 10:20:20 +00:00
from_glib_none(ffi::gst_gl_framebuffer_new_with_default_depth(
context.as_ref().to_glib_none().0,
width,
height,
))
2018-11-27 21:52:42 +00:00
}
}
}
unsafe impl Send for GLFramebuffer {}
unsafe impl Sync for GLFramebuffer {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::GLFramebuffer>> Sealed for T {}
2018-11-27 21:52:42 +00:00
}
pub trait GLFramebufferExt: IsA<GLFramebuffer> + sealed::Sealed + 'static {
#[doc(alias = "gst_gl_framebuffer_attach")]
2021-01-29 21:12:00 +00:00
unsafe fn attach(&self, attachment_point: u32, mem: &mut GLBaseMemory) {
ffi::gst_gl_framebuffer_attach(
self.as_ref().to_glib_none().0,
attachment_point,
mem.to_glib_none_mut().0,
);
}
2018-11-27 21:52:42 +00:00
#[doc(alias = "gst_gl_framebuffer_bind")]
2018-11-27 21:52:42 +00:00
fn bind(&self) {
unsafe {
2020-11-22 10:20:20 +00:00
ffi::gst_gl_framebuffer_bind(self.as_ref().to_glib_none().0);
2018-11-27 21:52:42 +00:00
}
}
#[doc(alias = "gst_gl_framebuffer_get_effective_dimensions")]
#[doc(alias = "get_effective_dimensions")]
2021-04-11 19:38:18 +00:00
fn effective_dimensions(&self) -> (u32, u32) {
2018-11-27 21:52:42 +00:00
unsafe {
let mut width = std::mem::MaybeUninit::uninit();
let mut height = std::mem::MaybeUninit::uninit();
2020-11-22 10:20:20 +00:00
ffi::gst_gl_framebuffer_get_effective_dimensions(
self.as_ref().to_glib_none().0,
2019-07-10 08:21:28 +00:00
width.as_mut_ptr(),
height.as_mut_ptr(),
);
2022-05-18 20:27:53 +00:00
(width.assume_init(), height.assume_init())
2018-11-27 21:52:42 +00:00
}
}
#[doc(alias = "gst_gl_framebuffer_get_id")]
#[doc(alias = "get_id")]
2021-04-11 19:38:18 +00:00
fn id(&self) -> u32 {
2020-11-22 10:20:20 +00:00
unsafe { ffi::gst_gl_framebuffer_get_id(self.as_ref().to_glib_none().0) }
2018-11-27 21:52:42 +00:00
}
}
impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {}