From cfe1bd452f8ce8550101b21c114df3b9e89ecbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 28 Sep 2018 17:36:50 +0300 Subject: [PATCH] Add bindings for VideoOverlayComposition and VideoOverlayRectangle --- Gir_GstVideo.toml | 1 + gstreamer-video/src/auto/enums.rs | 37 +++++++++++++++++++++++++++++++ gstreamer-video/src/auto/mod.rs | 1 + gstreamer-video/src/lib.rs | 3 +++ 4 files changed, 42 insertions(+) diff --git a/Gir_GstVideo.toml b/Gir_GstVideo.toml index 32e68f09e..e99f4767a 100644 --- a/Gir_GstVideo.toml +++ b/Gir_GstVideo.toml @@ -32,6 +32,7 @@ generate = [ "GstVideo.VideoFrameFlags", "GstVideo.VideoMultiviewFramePacking", "GstVideo.VideoFilter", + "GstVideo.VideoOverlayFormatFlags", ] manual = [ diff --git a/gstreamer-video/src/auto/enums.rs b/gstreamer-video/src/auto/enums.rs index 502ddb0b3..a87ba3500 100644 --- a/gstreamer-video/src/auto/enums.rs +++ b/gstreamer-video/src/auto/enums.rs @@ -764,6 +764,43 @@ impl SetValue for VideoMultiviewMode { } } +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum VideoOverlayFormatFlags { + None, + PremultipliedAlpha, + GlobalAlpha, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for VideoOverlayFormatFlags { + type GlibType = ffi::GstVideoOverlayFormatFlags; + + fn to_glib(&self) -> ffi::GstVideoOverlayFormatFlags { + match *self { + VideoOverlayFormatFlags::None => ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_NONE, + VideoOverlayFormatFlags::PremultipliedAlpha => ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA, + VideoOverlayFormatFlags::GlobalAlpha => ffi::GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA, + VideoOverlayFormatFlags::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for VideoOverlayFormatFlags { + fn from_glib(value: ffi::GstVideoOverlayFormatFlags) -> Self { + skip_assert_initialized!(); + match value { + 0 => VideoOverlayFormatFlags::None, + 1 => VideoOverlayFormatFlags::PremultipliedAlpha, + 2 => VideoOverlayFormatFlags::GlobalAlpha, + value => VideoOverlayFormatFlags::__Unknown(value), + } + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] pub enum VideoTileMode { diff --git a/gstreamer-video/src/auto/mod.rs b/gstreamer-video/src/auto/mod.rs index 923770383..4d58dc71a 100644 --- a/gstreamer-video/src/auto/mod.rs +++ b/gstreamer-video/src/auto/mod.rs @@ -18,6 +18,7 @@ pub use self::enums::VideoFormat; pub use self::enums::VideoInterlaceMode; pub use self::enums::VideoMultiviewFramePacking; pub use self::enums::VideoMultiviewMode; +pub use self::enums::VideoOverlayFormatFlags; pub use self::enums::VideoTileMode; pub use self::enums::VideoTransferFunction; diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 03c5d93a2..08a0ba7f1 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -14,6 +14,7 @@ extern crate libc; extern crate glib; extern crate glib_sys as glib_ffi; extern crate gobject_sys as gobject_ffi; +#[macro_use] extern crate gstreamer as gst; extern crate gstreamer_base as gst_base; extern crate gstreamer_base_sys as gst_base_ffi; @@ -57,6 +58,8 @@ mod functions; pub use functions::*; mod video_rectangle; pub use video_rectangle::*; +mod video_overlay_composition; +pub use video_overlay_composition::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts