Correctly generate VideoOverlayFormatFlags as flags

This commit is contained in:
Sebastian Dröge 2018-10-04 11:39:15 +03:00
parent 30b9527112
commit 9265cc8232
4 changed files with 34 additions and 42 deletions

View file

@ -9411,7 +9411,7 @@ contained in the rectangles are not copied.</doc>
</return-value> </return-value>
</function> </function>
</record> </record>
<enumeration name="VideoOverlayFormatFlags" <bitfield name="VideoOverlayFormatFlags"
c:type="GstVideoOverlayFormatFlags"> c:type="GstVideoOverlayFormatFlags">
<doc xml:space="preserve">Overlay format flags.</doc> <doc xml:space="preserve">Overlay format flags.</doc>
<member name="none" <member name="none"
@ -9429,7 +9429,7 @@ contained in the rectangles are not copied.</doc>
c:identifier="GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA"> c:identifier="GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA">
<doc xml:space="preserve">a global-alpha value != 1 is set.</doc> <doc xml:space="preserve">a global-alpha value != 1 is set.</doc>
</member> </member>
</enumeration> </bitfield>
<record name="VideoOverlayInterface" <record name="VideoOverlayInterface"
c:type="GstVideoOverlayInterface" c:type="GstVideoOverlayInterface"
glib:is-gtype-struct-for="VideoOverlay"> glib:is-gtype-struct-for="VideoOverlay">
@ -11582,11 +11582,15 @@ gst_buffer_add_video_meta_full() with them.</doc>
</parameter> </parameter>
<parameter name="offset" transfer-ownership="none"> <parameter name="offset" transfer-ownership="none">
<doc xml:space="preserve">offset of each plane</doc> <doc xml:space="preserve">offset of each plane</doc>
<type name="gsize" c:type="gsize"/> <array zero-terminated="0" c:type="gsize*" fixed-size="4">
<type name="gsize" c:type="gsize"/>
</array>
</parameter> </parameter>
<parameter name="stride" transfer-ownership="none"> <parameter name="stride" transfer-ownership="none">
<doc xml:space="preserve">stride of each plane</doc> <doc xml:space="preserve">stride of each plane</doc>
<type name="gint" c:type="gint"/> <array zero-terminated="0" c:type="gint*" fixed-size="4">
<type name="gint" c:type="gint"/>
</array>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>

View file

@ -764,43 +764,6 @@ 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(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub enum VideoTileMode { pub enum VideoTileMode {

View file

@ -278,3 +278,28 @@ impl SetValue for VideoMultiviewFlags {
} }
} }
bitflags! {
pub struct VideoOverlayFormatFlags: u32 {
const NONE = 0;
const PREMULTIPLIED_ALPHA = 1;
const GLOBAL_ALPHA = 2;
}
}
#[doc(hidden)]
impl ToGlib for VideoOverlayFormatFlags {
type GlibType = ffi::GstVideoOverlayFormatFlags;
fn to_glib(&self) -> ffi::GstVideoOverlayFormatFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstVideoOverlayFormatFlags> for VideoOverlayFormatFlags {
fn from_glib(value: ffi::GstVideoOverlayFormatFlags) -> VideoOverlayFormatFlags {
skip_assert_initialized!();
VideoOverlayFormatFlags::from_bits_truncate(value)
}
}

View file

@ -18,7 +18,6 @@ pub use self::enums::VideoFormat;
pub use self::enums::VideoInterlaceMode; pub use self::enums::VideoInterlaceMode;
pub use self::enums::VideoMultiviewFramePacking; pub use self::enums::VideoMultiviewFramePacking;
pub use self::enums::VideoMultiviewMode; pub use self::enums::VideoMultiviewMode;
pub use self::enums::VideoOverlayFormatFlags;
pub use self::enums::VideoTileMode; pub use self::enums::VideoTileMode;
pub use self::enums::VideoTransferFunction; pub use self::enums::VideoTransferFunction;
@ -28,6 +27,7 @@ pub use self::flags::VideoFlags;
pub use self::flags::VideoFormatFlags; pub use self::flags::VideoFormatFlags;
pub use self::flags::VideoFrameFlags; pub use self::flags::VideoFrameFlags;
pub use self::flags::VideoMultiviewFlags; pub use self::flags::VideoMultiviewFlags;
pub use self::flags::VideoOverlayFormatFlags;
#[doc(hidden)] #[doc(hidden)]
pub mod traits { pub mod traits {