From c37316fac186ac1d279941bb5a34190a1a3bd922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 2 Feb 2022 00:54:06 +0200 Subject: [PATCH] video: Allow getting an owned reference to the input buffer from a video codec frame --- gstreamer-video/src/video_codec_frame.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gstreamer-video/src/video_codec_frame.rs b/gstreamer-video/src/video_codec_frame.rs index 69ae53d7a..69cc9d32c 100644 --- a/gstreamer-video/src/video_codec_frame.rs +++ b/gstreamer-video/src/video_codec_frame.rs @@ -140,6 +140,18 @@ impl<'a> VideoCodecFrame<'a> { } } + #[doc(alias = "get_input_buffer")] + pub fn input_buffer_owned(&self) -> Option { + unsafe { + let ptr = (*self.to_glib_none().0).input_buffer; + if ptr.is_null() { + None + } else { + Some(from_glib_none(ptr)) + } + } + } + #[doc(alias = "get_output_buffer")] pub fn output_buffer(&self) -> Option<&gst::BufferRef> { unsafe {