2022-10-18 15:16:11 +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)
|
2022-02-26 15:16:35 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
|
|
|
#![allow(
|
|
|
|
clippy::approx_constant,
|
|
|
|
clippy::type_complexity,
|
|
|
|
clippy::unreadable_literal,
|
|
|
|
clippy::upper_case_acronyms
|
|
|
|
)]
|
2023-05-04 05:51:18 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
2022-02-26 15:16:35 +00:00
|
|
|
|
2024-02-03 07:48:44 +00:00
|
|
|
use glib_sys as glib;
|
|
|
|
use gobject_sys as gobject;
|
|
|
|
use gstreamer_sys as gst;
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
#[allow(unused_imports)]
|
|
|
|
use libc::{
|
|
|
|
c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
|
|
|
|
intptr_t, size_t, ssize_t, uintptr_t, FILE,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
use glib::{gboolean, gconstpointer, gpointer, GType};
|
|
|
|
|
|
|
|
// Constants
|
2023-01-06 09:13:12 +00:00
|
|
|
pub const GST_ALLOCATOR_DMABUF: &[u8] = b"dmabuf\0";
|
|
|
|
pub const GST_ALLOCATOR_FD: &[u8] = b"fd\0";
|
2023-11-10 14:34:37 +00:00
|
|
|
pub const GST_ALLOCATOR_SHM: &[u8] = b"shm\0";
|
2023-01-06 09:13:12 +00:00
|
|
|
pub const GST_CAPS_FEATURE_MEMORY_DMABUF: &[u8] = b"memory:DMABuf\0";
|
2022-02-26 15:16:35 +00:00
|
|
|
|
|
|
|
// Flags
|
|
|
|
pub type GstFdMemoryFlags = c_uint;
|
|
|
|
pub const GST_FD_MEMORY_FLAG_NONE: GstFdMemoryFlags = 0;
|
|
|
|
pub const GST_FD_MEMORY_FLAG_KEEP_MAPPED: GstFdMemoryFlags = 1;
|
|
|
|
pub const GST_FD_MEMORY_FLAG_MAP_PRIVATE: GstFdMemoryFlags = 2;
|
|
|
|
pub const GST_FD_MEMORY_FLAG_DONT_CLOSE: GstFdMemoryFlags = 4;
|
|
|
|
|
|
|
|
// Records
|
2023-04-06 18:11:32 +00:00
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstDRMDumbAllocatorClass {
|
|
|
|
pub parent_class: gst::GstAllocatorClass,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstDRMDumbAllocatorClass {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
|
|
|
f.debug_struct(&format!("GstDRMDumbAllocatorClass @ {self:p}"))
|
|
|
|
.field("parent_class", &self.parent_class)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstDmaBufAllocatorClass {
|
|
|
|
pub parent_class: GstFdAllocatorClass,
|
|
|
|
pub _gst_reserved: [gpointer; 4],
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstDmaBufAllocatorClass {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
f.debug_struct(&format!("GstDmaBufAllocatorClass @ {self:p}"))
|
2022-02-26 15:16:35 +00:00
|
|
|
.field("parent_class", &self.parent_class)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstFdAllocatorClass {
|
|
|
|
pub parent_class: gst::GstAllocatorClass,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstFdAllocatorClass {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
f.debug_struct(&format!("GstFdAllocatorClass @ {self:p}"))
|
2022-02-26 15:16:35 +00:00
|
|
|
.field("parent_class", &self.parent_class)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstPhysMemoryAllocatorInterface {
|
|
|
|
pub parent_iface: gobject::GTypeInterface,
|
|
|
|
pub get_phys_addr:
|
|
|
|
Option<unsafe extern "C" fn(*mut GstPhysMemoryAllocator, *mut gst::GstMemory) -> uintptr_t>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstPhysMemoryAllocatorInterface {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
f.debug_struct(&format!("GstPhysMemoryAllocatorInterface @ {self:p}"))
|
2022-02-26 15:16:35 +00:00
|
|
|
.field("get_phys_addr", &self.get_phys_addr)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-10 14:34:37 +00:00
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstShmAllocatorClass {
|
|
|
|
pub parent_class: GstFdAllocatorClass,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstShmAllocatorClass {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
|
|
|
f.debug_struct(&format!("GstShmAllocatorClass @ {self:p}"))
|
|
|
|
.field("parent_class", &self.parent_class)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
// Classes
|
2023-04-06 18:11:32 +00:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstDRMDumbAllocator {
|
|
|
|
_data: [u8; 0],
|
|
|
|
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstDRMDumbAllocator {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
|
|
|
f.debug_struct(&format!("GstDRMDumbAllocator @ {self:p}"))
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstDmaBufAllocator {
|
|
|
|
pub parent: GstFdAllocator,
|
|
|
|
pub _gst_reserved: [gpointer; 4],
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstDmaBufAllocator {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
f.debug_struct(&format!("GstDmaBufAllocator @ {self:p}"))
|
2022-02-26 15:16:35 +00:00
|
|
|
.field("parent", &self.parent)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstFdAllocator {
|
|
|
|
pub parent: gst::GstAllocator,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstFdAllocator {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
f.debug_struct(&format!("GstFdAllocator @ {self:p}"))
|
2022-02-26 15:16:35 +00:00
|
|
|
.field("parent", &self.parent)
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-10 14:34:37 +00:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstShmAllocator {
|
|
|
|
_data: [u8; 0],
|
|
|
|
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstShmAllocator {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
|
|
|
f.debug_struct(&format!("GstShmAllocator @ {self:p}"))
|
|
|
|
.finish()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
// Interfaces
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct GstPhysMemoryAllocator {
|
|
|
|
_data: [u8; 0],
|
|
|
|
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ::std::fmt::Debug for GstPhysMemoryAllocator {
|
|
|
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
2022-11-12 15:40:16 +00:00
|
|
|
write!(f, "GstPhysMemoryAllocator @ {self:p}")
|
2022-02-26 15:16:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[link(name = "gstallocators-1.0")]
|
|
|
|
extern "C" {
|
|
|
|
|
2023-04-06 18:11:32 +00:00
|
|
|
//=========================================================================
|
|
|
|
// GstDRMDumbAllocator
|
|
|
|
//=========================================================================
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_allocator_get_type() -> GType;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_allocator_new_with_device_path(
|
|
|
|
drm_device_path: *const c_char,
|
|
|
|
) -> *mut gst::GstAllocator;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_allocator_new_with_fd(drm_fd: c_int) -> *mut gst::GstAllocator;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_allocator_alloc(
|
|
|
|
allocator: *mut GstDRMDumbAllocator,
|
|
|
|
drm_fourcc: u32,
|
|
|
|
width: u32,
|
|
|
|
height: u32,
|
|
|
|
out_pitch: *mut u32,
|
|
|
|
) -> *mut gst::GstMemory;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_allocator_has_prime_export(allocator: *mut GstDRMDumbAllocator)
|
|
|
|
-> gboolean;
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
//=========================================================================
|
|
|
|
// GstDmaBufAllocator
|
|
|
|
//=========================================================================
|
|
|
|
pub fn gst_dmabuf_allocator_get_type() -> GType;
|
|
|
|
pub fn gst_dmabuf_allocator_new() -> *mut gst::GstAllocator;
|
|
|
|
pub fn gst_dmabuf_allocator_alloc(
|
|
|
|
allocator: *mut gst::GstAllocator,
|
|
|
|
fd: c_int,
|
|
|
|
size: size_t,
|
|
|
|
) -> *mut gst::GstMemory;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_16")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2022-02-26 15:16:35 +00:00
|
|
|
pub fn gst_dmabuf_allocator_alloc_with_flags(
|
|
|
|
allocator: *mut gst::GstAllocator,
|
|
|
|
fd: c_int,
|
|
|
|
size: size_t,
|
|
|
|
flags: GstFdMemoryFlags,
|
|
|
|
) -> *mut gst::GstMemory;
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// GstFdAllocator
|
|
|
|
//=========================================================================
|
|
|
|
pub fn gst_fd_allocator_get_type() -> GType;
|
|
|
|
pub fn gst_fd_allocator_new() -> *mut gst::GstAllocator;
|
|
|
|
pub fn gst_fd_allocator_alloc(
|
|
|
|
allocator: *mut gst::GstAllocator,
|
|
|
|
fd: c_int,
|
|
|
|
size: size_t,
|
|
|
|
flags: GstFdMemoryFlags,
|
|
|
|
) -> *mut gst::GstMemory;
|
|
|
|
|
2023-11-10 14:34:37 +00:00
|
|
|
//=========================================================================
|
|
|
|
// GstShmAllocator
|
|
|
|
//=========================================================================
|
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
|
|
|
pub fn gst_shm_allocator_get_type() -> GType;
|
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
|
|
|
pub fn gst_shm_allocator_get() -> *mut gst::GstAllocator;
|
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
|
|
|
pub fn gst_shm_allocator_init_once();
|
|
|
|
|
2022-02-26 15:16:35 +00:00
|
|
|
//=========================================================================
|
|
|
|
// GstPhysMemoryAllocator
|
|
|
|
//=========================================================================
|
|
|
|
pub fn gst_phys_memory_allocator_get_type() -> GType;
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// Other functions
|
|
|
|
//=========================================================================
|
|
|
|
pub fn gst_dmabuf_memory_get_fd(mem: *mut gst::GstMemory) -> c_int;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_memory_export_dmabuf(mem: *mut gst::GstMemory) -> *mut gst::GstMemory;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_drm_dumb_memory_get_handle(mem: *mut gst::GstMemory) -> u32;
|
2022-02-26 15:16:35 +00:00
|
|
|
pub fn gst_fd_memory_get_fd(mem: *mut gst::GstMemory) -> c_int;
|
|
|
|
pub fn gst_is_dmabuf_memory(mem: *mut gst::GstMemory) -> gboolean;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_24")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
2023-04-06 18:11:32 +00:00
|
|
|
pub fn gst_is_drm_dumb_memory(mem: *mut gst::GstMemory) -> gboolean;
|
2022-02-26 15:16:35 +00:00
|
|
|
pub fn gst_is_fd_memory(mem: *mut gst::GstMemory) -> gboolean;
|
|
|
|
pub fn gst_is_phys_memory(mem: *mut gst::GstMemory) -> gboolean;
|
|
|
|
pub fn gst_phys_memory_get_phys_addr(mem: *mut gst::GstMemory) -> uintptr_t;
|
|
|
|
|
|
|
|
}
|