mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-02-27 16:26:22 +00:00
allocator: Add a method to retrieve the name of the allocated memory type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1655>
This commit is contained in:
parent
3f220ce5d9
commit
d2a59304b4
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,11 @@ use glib::{prelude::*, translate::*};
|
|||
use crate::{ffi, Allocator};
|
||||
|
||||
impl Allocator {
|
||||
pub fn memory_type(&self) -> &'static glib::GStr {
|
||||
let obj: *const ffi::GstAllocator = self.to_glib_none().0;
|
||||
unsafe { glib::GStr::from_ptr((*obj).mem_type) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_allocator_register")]
|
||||
pub fn register(name: &str, allocator: impl IsA<Allocator>) {
|
||||
skip_assert_initialized!();
|
||||
|
|
Loading…
Reference in a new issue