diff --git a/gstreamer/src/log.rs b/gstreamer/src/log.rs index 3d36e12ad..b5bee8984 100644 --- a/gstreamer/src/log.rs +++ b/gstreamer/src/log.rs @@ -68,7 +68,7 @@ impl DebugMessage { } } -#[derive(PartialEq, Eq, Clone, Copy)] +#[derive(PartialEq, Eq, Clone, Copy, Hash)] #[doc(alias = "GstDebugCategory")] #[repr(transparent)] pub struct DebugCategory(Option>); @@ -530,6 +530,11 @@ impl DebugCategory { )) } } + + #[inline] + pub fn as_ptr(&self) -> *mut ffi::GstDebugCategory { + self.0.map(|p| p.as_ptr()).unwrap_or(ptr::null_mut()) + } } unsafe impl Sync for DebugCategory {}