forked from mirrors/gstreamer-rs
Add bindings for VideoOverlayComposition and VideoOverlayRectangle
This commit is contained in:
parent
74024447fe
commit
cfe1bd452f
4 changed files with 42 additions and 0 deletions
|
@ -32,6 +32,7 @@ generate = [
|
|||
"GstVideo.VideoFrameFlags",
|
||||
"GstVideo.VideoMultiviewFramePacking",
|
||||
"GstVideo.VideoFilter",
|
||||
"GstVideo.VideoOverlayFormatFlags",
|
||||
]
|
||||
|
||||
manual = [
|
||||
|
|
|
@ -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<ffi::GstVideoOverlayFormatFlags> 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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue