mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 09:23:50 +00:00
bufferpool: Allow passing any subclass of Allocator
to the config
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1751>
This commit is contained in:
parent
081b5760ba
commit
9a5e45c56f
1 changed files with 6 additions and 2 deletions
|
@ -222,12 +222,16 @@ impl BufferPoolConfigRef {
|
|||
}
|
||||
|
||||
#[doc(alias = "gst_buffer_pool_config_set_allocator")]
|
||||
pub fn set_allocator(&self, allocator: Option<&Allocator>, params: Option<&AllocationParams>) {
|
||||
pub fn set_allocator(
|
||||
&self,
|
||||
allocator: Option<&impl IsA<Allocator>>,
|
||||
params: Option<&AllocationParams>,
|
||||
) {
|
||||
assert!(allocator.is_some() || params.is_some());
|
||||
unsafe {
|
||||
ffi::gst_buffer_pool_config_set_allocator(
|
||||
self.0.as_mut_ptr(),
|
||||
allocator.to_glib_none().0,
|
||||
allocator.to_glib_none().0 as *mut ffi::GstAllocator,
|
||||
match params {
|
||||
Some(val) => val.as_ptr(),
|
||||
None => ptr::null(),
|
||||
|
|
Loading…
Reference in a new issue