buffer_pool: implement ToGlibPtr and ToGlibPtrMut for BufferPoolAcquireParams

I'll use them to bind
gst_video_decoder_allocate_output_frame_with_params()
This commit is contained in:
Guillaume Desmottes 2019-05-06 17:27:24 +05:30
parent 3bf853e42f
commit fca4441a72

View file

@ -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!();