gstreamer-video: Add bindings for VideoInfo::in_info() / out_info()

This commit is contained in:
Sebastian Dröge 2022-08-18 13:50:33 +03:00
parent ffa6d67868
commit f65d410fc5
2 changed files with 25 additions and 1 deletions

View file

@ -1,6 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::{IntoGlibPtr, ToGlibPtr};
use glib::translate::*;
use std::ops;
use std::ptr;
@ -72,6 +72,22 @@ impl VideoConverter {
}
}
#[cfg(any(feature = "v1_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
#[doc(alias = "get_in_info")]
#[doc(alias = "gst_video_converter_get_in_info")]
pub fn in_info(&self) -> crate::VideoInfo {
unsafe { from_glib_none(ffi::gst_video_converter_get_in_info(self.0.as_ptr())) }
}
#[cfg(any(feature = "v1_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
#[doc(alias = "get_out_info")]
#[doc(alias = "gst_video_converter_get_out_info")]
pub fn out_info(&self) -> crate::VideoInfo {
unsafe { from_glib_none(ffi::gst_video_converter_get_out_info(self.0.as_ptr())) }
}
#[doc(alias = "gst_video_converter_frame")]
pub fn frame<T>(
&self,

View file

@ -917,6 +917,14 @@ impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstVideoInfo> for VideoInfo
}
}
#[doc(hidden)]
impl glib::translate::FromGlibPtrNone<*const ffi::GstVideoInfo> for VideoInfo {
#[inline]
unsafe fn from_glib_none(ptr: *const ffi::GstVideoInfo) -> Self {
Self(ptr::read(ptr))
}
}
#[doc(hidden)]
impl glib::translate::FromGlibPtrNone<*mut ffi::GstVideoInfo> for VideoInfo {
#[inline]