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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-11-27 21:52:42 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2024-06-01 13:14:58 +00:00
|
|
|
use crate::{ffi, GLBaseMemory, GLContext};
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[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 {
|
2021-04-19 19:55:01 +00:00
|
|
|
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")]
|
2021-05-23 19:22:45 +00:00
|
|
|
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(
|
2019-06-18 10:12:00 +00:00
|
|
|
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")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "new_with_default_depth")]
|
2021-05-23 19:22:45 +00:00
|
|
|
pub fn with_default_depth(
|
|
|
|
context: &impl IsA<GLContext>,
|
2019-06-18 10:12:00 +00:00
|
|
|
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(
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::GLFramebuffer>> Sealed for T {}
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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
|
|
|
|
2023-07-05 18:20:29 +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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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 {
|
2023-08-28 16:52:26 +00:00
|
|
|
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(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2019-07-10 08:21:28 +00:00
|
|
|
width.as_mut_ptr(),
|
|
|
|
height.as_mut_ptr(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2022-05-18 20:27:53 +00:00
|
|
|
(width.assume_init(), height.assume_init())
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +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
|
|
|
}
|
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {}
|