mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
gstreamer-allocators: allow to subclass fd memory allocators
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1186>
This commit is contained in:
parent
00281e98f0
commit
77866a52df
4 changed files with 29 additions and 0 deletions
|
@ -52,3 +52,5 @@ pub mod prelude {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use gst::prelude::*;
|
pub use gst::prelude::*;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub mod subclass;
|
||||||
|
|
6
gstreamer-allocators/src/subclass/dma_buf_allocator.rs
Normal file
6
gstreamer-allocators/src/subclass/dma_buf_allocator.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
use glib::subclass::prelude::*;
|
||||||
|
|
||||||
|
use crate::{subclass::fd_allocator::FdAllocatorImpl, DmaBufAllocator};
|
||||||
|
|
||||||
|
pub trait DmaBufAllocatorImpl: FdAllocatorImpl {}
|
||||||
|
unsafe impl<T: DmaBufAllocatorImpl> IsSubclassable<T> for DmaBufAllocator {}
|
7
gstreamer-allocators/src/subclass/fd_allocator.rs
Normal file
7
gstreamer-allocators/src/subclass/fd_allocator.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
use glib::subclass::prelude::*;
|
||||||
|
|
||||||
|
use crate::FdAllocator;
|
||||||
|
use gst::subclass::prelude::AllocatorImpl;
|
||||||
|
|
||||||
|
pub trait FdAllocatorImpl: AllocatorImpl {}
|
||||||
|
unsafe impl<T: FdAllocatorImpl> IsSubclassable<T> for FdAllocator {}
|
14
gstreamer-allocators/src/subclass/mod.rs
Normal file
14
gstreamer-allocators/src/subclass/mod.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#[cfg(any(target_os = "linux", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(target_os = "linux")))]
|
||||||
|
mod dma_buf_allocator;
|
||||||
|
mod fd_allocator;
|
||||||
|
|
||||||
|
pub mod prelude {
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use gst::subclass::prelude::*;
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(target_os = "linux")))]
|
||||||
|
pub use super::dma_buf_allocator::DmaBufAllocatorImpl;
|
||||||
|
pub use super::fd_allocator::FdAllocatorImpl;
|
||||||
|
}
|
Loading…
Reference in a new issue