From f5044931347b89c8984bbcb4d8cd8eb4b1f4c953 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 10 Aug 2021 08:02:21 +0200 Subject: [PATCH] gstreamer: Add serde support for more enums and flags PadDirection, PadPresence, URITYpe, Rank --- gstreamer/Gir.toml | 44 +++++++++++++++++++++++++++++++++---- gstreamer/src/auto/enums.rs | 13 +++++++---- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/gstreamer/Gir.toml b/gstreamer/Gir.toml index 1faea8ec8..3cc019670 100644 --- a/gstreamer/Gir.toml +++ b/gstreamer/Gir.toml @@ -28,9 +28,7 @@ generate = [ "Gst.EventTypeFlags", "Gst.GapFlags", "Gst.LibraryError", - "Gst.PadDirection", "Gst.PadMode", - "Gst.PadPresence", "Gst.PadProbeReturn", "Gst.ParseError", "Gst.PluginAPIFlags", @@ -43,7 +41,6 @@ generate = [ "Gst.SchedulingFlags", "Gst.SeekType", "Gst.SerializeFlags", - "Gst.State", "Gst.StreamError", "Gst.StreamStatusType", "Gst.StreamType", @@ -55,7 +52,6 @@ generate = [ "Gst.TocSetter", "Gst.URIError", "Gst.URIHandler", - "Gst.URIType", ] manual = [ @@ -295,6 +291,24 @@ status = "manual" name = "unmap" ignore = true +[[object]] +name = "Gst.PadDirection" +status = "generate" + [[object.derive]] + name = "serde::Serialize, serde::Deserialize" + cfg_condition = "feature = \"ser_de\"" + [[object.derive]] + name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash" + +[[object]] +name = "Gst.PadPresence" +status = "generate" + [[object.derive]] + name = "serde::Serialize, serde::Deserialize" + cfg_condition = "feature = \"ser_de\"" + [[object.derive]] + name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash" + [[object]] name = "Gst.SeekFlags" status = "generate" @@ -378,6 +392,9 @@ status = "generate" [[object]] name = "Gst.Rank" status = "generate" + [[object.derive]] + name = "serde::Serialize, serde::Deserialize" + cfg_condition = "feature = \"ser_de\"" [[object.derive]] name = "Debug" @@ -1980,6 +1997,15 @@ status = "generate" # implemented as part of Tracer subclassing manual = true +[[object]] +name = "Gst.State" +status = "generate" + [[object.derive]] + name = "serde::Serialize, serde::Deserialize" + cfg_condition = "feature = \"ser_de\"" + [[object.derive]] + name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash" + [[object]] name = "Gst.StateChange" status = "generate" @@ -2191,3 +2217,13 @@ status = "generate" [[object]] name = "Gst.TracerFactory" status = "generate" + +[[object]] +name = "Gst.URIType" +status = "generate" + [[object.derive]] + name = "serde::Serialize, serde::Deserialize" + cfg_condition = "feature = \"ser_de\"" + [[object.derive]] + name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash" + diff --git a/gstreamer/src/auto/enums.rs b/gstreamer/src/auto/enums.rs index 4941a065a..af5f68e90 100644 --- a/gstreamer/src/auto/enums.rs +++ b/gstreamer/src/auto/enums.rs @@ -1353,7 +1353,8 @@ impl ToValue for LibraryError { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPadDirection")] pub enum PadDirection { @@ -1613,7 +1614,8 @@ impl ToValue for PadMode { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstPadPresence")] pub enum PadPresence { @@ -2234,6 +2236,7 @@ impl ToValue for QOSType { } } +#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))] #[derive(Debug, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstRank")] @@ -2547,7 +2550,8 @@ impl ToValue for SeekType { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstState")] pub enum State { @@ -3891,7 +3895,8 @@ impl ToValue for URIError { } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GstURIType")] pub enum URIType {