From fca4441a725ea4781b833eae07ecbd6ee14471f8 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 6 May 2019 17:27:24 +0530 Subject: [PATCH] buffer_pool: implement ToGlibPtr and ToGlibPtrMut for BufferPoolAcquireParams I'll use them to bind gst_video_decoder_allocate_output_frame_with_params() --- gstreamer/src/buffer_pool.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gstreamer/src/buffer_pool.rs b/gstreamer/src/buffer_pool.rs index 5d7642534..cad01b6c9 100644 --- a/gstreamer/src/buffer_pool.rs +++ b/gstreamer/src/buffer_pool.rs @@ -209,6 +209,28 @@ impl PartialEq for BufferPoolAcquireParams { impl Eq for BufferPoolAcquireParams {} +#[doc(hidden)] +impl<'a> ToGlibPtr<'a, *const gst_sys::GstBufferPoolAcquireParams> for BufferPoolAcquireParams { + type Storage = &'a Self; + + fn to_glib_none( + &'a self, + ) -> glib::translate::Stash<'a, *const gst_sys::GstBufferPoolAcquireParams, Self> { + glib::translate::Stash(&self.0, self) + } +} + +#[doc(hidden)] +impl<'a> ToGlibPtrMut<'a, *mut gst_sys::GstBufferPoolAcquireParams> for BufferPoolAcquireParams { + type Storage = &'a mut Self; + + fn to_glib_none_mut( + &'a mut self, + ) -> glib::translate::StashMut<'a, *mut gst_sys::GstBufferPoolAcquireParams, Self> { + glib::translate::StashMut(&mut self.0, self) + } +} + impl BufferPool { pub fn new() -> BufferPool { assert_initialized_main_thread!();