mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +00:00
gstreamer-allocators: allow to subclass fd memory allocators
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1215>
This commit is contained in:
parent
b708208408
commit
0714c2ceb0
4 changed files with 29 additions and 0 deletions
|
@ -57,3 +57,5 @@ pub mod prelude {
|
|||
#[doc(hidden)]
|
||||
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