mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 09:23:50 +00:00
video_meta: Just make VideoMetaTransformScale a ffi wrapper
This will simplify the code for the other ones instead of trying to reproduce the output. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1776>
This commit is contained in:
parent
af52800887
commit
fda2e3b7e3
1 changed files with 14 additions and 13 deletions
|
@ -1201,20 +1201,24 @@ pub mod tags {
|
||||||
gst::impl_meta_tag!(Colorspace, crate::ffi::GST_META_TAG_VIDEO_COLORSPACE_STR);
|
gst::impl_meta_tag!(Colorspace, crate::ffi::GST_META_TAG_VIDEO_COLORSPACE_STR);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[repr(transparent)]
|
||||||
pub struct VideoMetaTransformScale<'a> {
|
#[doc(alias = "GstVideoMetaTransform")]
|
||||||
in_info: &'a crate::VideoInfo,
|
pub struct VideoMetaTransformScale(ffi::GstVideoMetaTransform);
|
||||||
out_info: &'a crate::VideoInfo,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> VideoMetaTransformScale<'a> {
|
unsafe impl Sync for VideoMetaTransformScale {}
|
||||||
pub fn new(in_info: &'a crate::VideoInfo, out_info: &'a crate::VideoInfo) -> Self {
|
unsafe impl Send for VideoMetaTransformScale {}
|
||||||
|
|
||||||
|
impl VideoMetaTransformScale {
|
||||||
|
pub fn new(in_info: &crate::VideoInfo, out_info: &crate::VideoInfo) -> Self {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
VideoMetaTransformScale { in_info, out_info }
|
Self(ffi::GstVideoMetaTransform {
|
||||||
|
in_info: mut_override(in_info.to_glib_none().0),
|
||||||
|
out_info: mut_override(out_info.to_glib_none().0),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<'a> gst::meta::MetaTransform<'a> for VideoMetaTransformScale<'a> {
|
unsafe impl<'a> gst::meta::MetaTransform<'a> for VideoMetaTransformScale {
|
||||||
type GLibType = ffi::GstVideoMetaTransform;
|
type GLibType = ffi::GstVideoMetaTransform;
|
||||||
|
|
||||||
#[doc(alias = "gst_video_meta_transform_scale_get_quark")]
|
#[doc(alias = "gst_video_meta_transform_scale_get_quark")]
|
||||||
|
@ -1226,10 +1230,7 @@ unsafe impl<'a> gst::meta::MetaTransform<'a> for VideoMetaTransformScale<'a> {
|
||||||
&self,
|
&self,
|
||||||
_meta: &gst::MetaRef<T>,
|
_meta: &gst::MetaRef<T>,
|
||||||
) -> Result<ffi::GstVideoMetaTransform, glib::BoolError> {
|
) -> Result<ffi::GstVideoMetaTransform, glib::BoolError> {
|
||||||
Ok(ffi::GstVideoMetaTransform {
|
Ok(self.0)
|
||||||
in_info: mut_override(self.in_info.to_glib_none().0),
|
|
||||||
out_info: mut_override(self.out_info.to_glib_none().0),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue