Add specific version configurations for various enum/flags values

gobject-introspection does not support this yet so we have to do that
manually.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/271
This commit is contained in:
Sebastian Dröge 2020-06-29 22:07:30 +03:00
parent af01f1bc67
commit 45402b5e95
26 changed files with 172 additions and 26 deletions

View file

@ -19,7 +19,6 @@ generate = [
"Gst.ClockTimeDiff",
"Gst.State",
"Gst.StateChange",
"Gst.SeekFlags",
"Gst.SeekType",
"Gst.PadDirection",
"Gst.PadPresence",
@ -50,11 +49,8 @@ generate = [
"Gst.SchedulingFlags",
"Gst.QOSType",
"Gst.TocSetter",
"Gst.ClockType",
"Gst.ElementFlags",
"Gst.ObjectFlags",
"Gst.PadFlags",
"Gst.BinFlags",
"Gst.PipelineFlags",
"Gst.PluginFlags",
"Gst.MemoryFlags",
@ -63,7 +59,6 @@ generate = [
"Gst.DebugColorFlags",
"Gst.StackTraceFlags",
"Gst.DebugGraphDetails",
"Gst.ParseFlags",
"Gst.TaskState",
"Gst.PluginDependencyFlags",
"Gst.BufferPoolAcquireFlags",
@ -116,6 +111,14 @@ trait_name = "GstBinExt"
[object.function.return]
bool_return_is_error = "Failed to sync children states"
[[object]]
name = "Gst.BinFlags"
status = "generate"
[[object.member]]
name = "streams_aware"
version = "1.10"
[[object]]
name = "Gst.Bus"
status = "generate"
@ -179,6 +182,10 @@ status = "generate"
name = "Serialize, Deserialize"
cfg_condition = "feature = \"ser_de\""
[[object.member]]
name = "non_droppable"
version = "1.14"
[[object]]
name = "Gst.ChildProxy"
status = "generate"
@ -198,12 +205,25 @@ status = "generate"
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
[[object]]
name = "Gst.SeekFlags"
status = "generate"
[[object.member]]
name = "trickmode_forward_predicted"
version = "1.18"
[[object.member]]
name = "instant_rate_change"
version = "1.18"
[[object]]
name = "Gst.SegmentFlags"
status = "generate"
[[object.derive]]
name = "Serialize, Deserialize"
cfg_condition = "feature = \"ser_de\""
[[object.member]]
name = "trickmode_forward_predicted"
version = "1.18"
[[object]]
name = "Gst.TagSetter"
@ -254,6 +274,21 @@ name = "Gst.EventType"
status = "generate"
[[object.derive]]
name = "Debug, PartialEq, Eq, Hash"
[[object.member]]
name = "select_streams"
version = "1.10"
[[object.member]]
name = "stream_selection"
version = "1.10"
[[object.member]]
name = "stream_group_done"
version = "1.10"
[[object.member]]
name = "instant_rate_change"
version = "1.18"
[[object.member]]
name = "instant_rate_sync_time"
version = "1.18"
[[object]]
name = "Gst.Structure"
@ -265,6 +300,13 @@ name = "Gst.ParseContext"
status = "manual"
ref_mode = "ref-mut"
[[object]]
name = "Gst.ParseFlags"
status = "generate"
[[object.member]]
name = "place_in_bin"
version = "1.10"
[[object]]
name = "Gst.Caps"
status = "manual"
@ -362,6 +404,13 @@ manual_traits = ["ClockExtManual"]
# Useless clock parameter
ignore = true
[[object]]
name = "Gst.ClockType"
status = "generate"
[[object.member]]
name = "tai"
version = "1.18"
[[object]]
name = "Gst.SystemClock"
status = "generate"
@ -693,6 +742,13 @@ trait_name = "GstObjectExt"
[object.function.return]
bool_return_is_error = "Failed to sync values"
[[object]]
name = "Gst.ObjectFlags"
status = "generate"
[[object.member]]
name = "may_be_leaked"
version = "1.10"
[[object]]
name = "Gst.Pad"
status = "generate"

View file

@ -29,7 +29,6 @@ generate = [
"GstAudio.AudioSrc",
"GstAudio.AudioBaseSink",
"GstAudio.AudioBaseSrc",
"GstAudio.AudioRingBufferFormatType",
]
manual = [
@ -226,3 +225,19 @@ manual_traits = ["AudioEncoderExtManual"]
name = "allocate_output_buffer"
[object.function.return]
nullable_return_is_error = "Failed to allocate output buffer"
[[object]]
name = "GstAudio.AudioRingBufferFormatType"
status = "generate"
[[object.member]]
name = "mpeg2_aac_raw"
version = "1.12"
[[object.member]]
name = "mpeg4_aac_raw"
version = "1.12"
[[object.member]]
name = "flac"
version = "1.12"

View file

@ -21,7 +21,6 @@ external_libraries = [
generate = [
# BitFlags
"GstGL.GLAPI",
"GstGL.GLDisplayType",
"GstGL.GLPlatform",
"GstGL.GLSLProfile",
# Enums
@ -426,3 +425,12 @@ final_type = true
name = "submit_input_buffer"
# Buffer ownership transfer
ignore = true
[[object]]
name = "GstGL.GLDisplayType"
status = "generate"
[[object.member]]
name = "egl_device"
version = "1.18"

View file

@ -21,7 +21,6 @@ generate = [
"GstVideo.VideoCodecFrameFlags",
"GstVideo.VideoFormatFlags",
"GstVideo.VideoTileMode",
"GstVideo.VideoInterlaceMode",
"GstVideo.VideoFlags",
"GstVideo.VideoChromaSite",
"GstVideo.VideoColorMatrix",
@ -30,13 +29,11 @@ generate = [
"GstVideo.VideoMultiviewMode",
"GstVideo.VideoMultiviewFlags",
"GstVideo.VideoFieldOrder",
"GstVideo.VideoFrameFlags",
"GstVideo.VideoMultiviewFramePacking",
"GstVideo.VideoFilter",
"GstVideo.VideoCaptionType",
"GstVideo.VideoBufferPool",
"GstVideo.VideoPackFlags",
"GstVideo.VideoBufferFlags",
"GstVideo.VideoAlphaMode",
"GstVideo.VideoChromaMode",
"GstVideo.VideoMatrixMode",
@ -414,3 +411,33 @@ status = "generate"
[[object.function]]
name = "get_type"
version = "1.18"
[[object]]
name = "GstVideo.VideoFrameFlags"
status = "generate"
[[object.member]]
name = "top_field"
version = "1.16"
[[object.member]]
name = "bottom_field"
version = "1.16"
[[object]]
name = "GstVideo.VideoBufferFlags"
status = "generate"
[[object.member]]
name = "top_field"
version = "1.16"
[[object.member]]
name = "bottom_field"
version = "1.16"
[[object.member]]
name = "marker"
version = "1.18"
[[object]]
name = "GstVideo.VideoInterlaceMode"
status = "generate"
[[object.member]]
name = "alternate"
version = "1.16"

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -414,8 +414,11 @@ pub enum AudioRingBufferFormatType {
Dts,
Mpeg2Aac,
Mpeg4Aac,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Mpeg2AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Mpeg4AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
Flac,
#[doc(hidden)]
__Unknown(i32),
@ -455,12 +458,15 @@ impl ToGlib for AudioRingBufferFormatType {
AudioRingBufferFormatType::Mpeg4Aac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg2AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG2_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Mpeg4AacRaw => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG4_AAC_RAW
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
AudioRingBufferFormatType::Flac => {
gst_audio_sys::GST_AUDIO_RING_BUFFER_FORMAT_TYPE_FLAC
}
@ -486,8 +492,11 @@ impl FromGlib<gst_audio_sys::GstAudioRingBufferFormatType> for AudioRingBufferFo
9 => AudioRingBufferFormatType::Dts,
10 => AudioRingBufferFormatType::Mpeg2Aac,
11 => AudioRingBufferFormatType::Mpeg4Aac,
#[cfg(any(feature = "v1_12", feature = "dox"))]
12 => AudioRingBufferFormatType::Mpeg2AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
13 => AudioRingBufferFormatType::Mpeg4AacRaw,
#[cfg(any(feature = "v1_12", feature = "dox"))]
14 => AudioRingBufferFormatType::Flac,
value => AudioRingBufferFormatType::__Unknown(value),
}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -75,6 +75,7 @@ bitflags! {
const EGL = 32;
const VIV_FB = 64;
const GBM = 128;
#[cfg(any(feature = "v1_18", feature = "dox"))]
const EGL_DEVICE = 256;
const ANY = 4294967295;
}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1194,6 +1194,7 @@ pub enum VideoInterlaceMode {
Interleaved,
Mixed,
Fields,
#[cfg(any(feature = "v1_16", feature = "dox"))]
Alternate,
#[doc(hidden)]
__Unknown(i32),
@ -1209,6 +1210,7 @@ impl ToGlib for VideoInterlaceMode {
VideoInterlaceMode::Interleaved => gst_video_sys::GST_VIDEO_INTERLACE_MODE_INTERLEAVED,
VideoInterlaceMode::Mixed => gst_video_sys::GST_VIDEO_INTERLACE_MODE_MIXED,
VideoInterlaceMode::Fields => gst_video_sys::GST_VIDEO_INTERLACE_MODE_FIELDS,
#[cfg(any(feature = "v1_16", feature = "dox"))]
VideoInterlaceMode::Alternate => gst_video_sys::GST_VIDEO_INTERLACE_MODE_ALTERNATE,
VideoInterlaceMode::__Unknown(value) => value,
}
@ -1224,6 +1226,7 @@ impl FromGlib<gst_video_sys::GstVideoInterlaceMode> for VideoInterlaceMode {
1 => VideoInterlaceMode::Interleaved,
2 => VideoInterlaceMode::Mixed,
3 => VideoInterlaceMode::Fields,
#[cfg(any(feature = "v1_16", feature = "dox"))]
4 => VideoInterlaceMode::Alternate,
value => VideoInterlaceMode::__Unknown(value),
}

View file

@ -20,8 +20,11 @@ bitflags! {
const ONEFIELD = 8388608;
const MULTIPLE_VIEW = 16777216;
const FIRST_IN_BUNDLE = 33554432;
#[cfg(any(feature = "v1_16", feature = "dox"))]
const TOP_FIELD = 10485760;
#[cfg(any(feature = "v1_16", feature = "dox"))]
const BOTTOM_FIELD = 8388608;
#[cfg(any(feature = "v1_18", feature = "dox"))]
const MARKER = 512;
const LAST = 268435456;
}
@ -262,7 +265,9 @@ bitflags! {
const ONEFIELD = 8;
const MULTIPLE_VIEW = 16;
const FIRST_IN_BUNDLE = 32;
#[cfg(any(feature = "v1_16", feature = "dox"))]
const TOP_FIELD = 10;
#[cfg(any(feature = "v1_16", feature = "dox"))]
const BOTTOM_FIELD = 8;
}
}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 2bd82b67)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)

View file

@ -338,6 +338,7 @@ pub enum ClockType {
Realtime,
Monotonic,
Other,
#[cfg(any(feature = "v1_18", feature = "dox"))]
Tai,
#[doc(hidden)]
__Unknown(i32),
@ -352,6 +353,7 @@ impl ToGlib for ClockType {
ClockType::Realtime => gst_sys::GST_CLOCK_TYPE_REALTIME,
ClockType::Monotonic => gst_sys::GST_CLOCK_TYPE_MONOTONIC,
ClockType::Other => gst_sys::GST_CLOCK_TYPE_OTHER,
#[cfg(any(feature = "v1_18", feature = "dox"))]
ClockType::Tai => gst_sys::GST_CLOCK_TYPE_TAI,
ClockType::__Unknown(value) => value,
}
@ -366,6 +368,7 @@ impl FromGlib<gst_sys::GstClockType> for ClockType {
0 => ClockType::Realtime,
1 => ClockType::Monotonic,
2 => ClockType::Other,
#[cfg(any(feature = "v1_18", feature = "dox"))]
3 => ClockType::Tai,
value => ClockType::__Unknown(value),
}
@ -621,12 +624,14 @@ pub enum EventType {
Tag,
Buffersize,
SinkMessage,
#[cfg(any(feature = "v1_10", feature = "dox"))]
StreamGroupDone,
Eos,
Toc,
Protection,
SegmentDone,
Gap,
#[cfg(any(feature = "v1_18", feature = "dox"))]
InstantRateChange,
Qos,
Seek,
@ -635,7 +640,9 @@ pub enum EventType {
Step,
Reconfigure,
TocSelect,
#[cfg(any(feature = "v1_10", feature = "dox"))]
SelectStreams,
#[cfg(any(feature = "v1_18", feature = "dox"))]
InstantRateSyncTime,
CustomUpstream,
CustomDownstream,
@ -663,12 +670,14 @@ impl ToGlib for EventType {
EventType::Tag => gst_sys::GST_EVENT_TAG,
EventType::Buffersize => gst_sys::GST_EVENT_BUFFERSIZE,
EventType::SinkMessage => gst_sys::GST_EVENT_SINK_MESSAGE,
#[cfg(any(feature = "v1_10", feature = "dox"))]
EventType::StreamGroupDone => gst_sys::GST_EVENT_STREAM_GROUP_DONE,
EventType::Eos => gst_sys::GST_EVENT_EOS,
EventType::Toc => gst_sys::GST_EVENT_TOC,
EventType::Protection => gst_sys::GST_EVENT_PROTECTION,
EventType::SegmentDone => gst_sys::GST_EVENT_SEGMENT_DONE,
EventType::Gap => gst_sys::GST_EVENT_GAP,
#[cfg(any(feature = "v1_18", feature = "dox"))]
EventType::InstantRateChange => gst_sys::GST_EVENT_INSTANT_RATE_CHANGE,
EventType::Qos => gst_sys::GST_EVENT_QOS,
EventType::Seek => gst_sys::GST_EVENT_SEEK,
@ -677,7 +686,9 @@ impl ToGlib for EventType {
EventType::Step => gst_sys::GST_EVENT_STEP,
EventType::Reconfigure => gst_sys::GST_EVENT_RECONFIGURE,
EventType::TocSelect => gst_sys::GST_EVENT_TOC_SELECT,
#[cfg(any(feature = "v1_10", feature = "dox"))]
EventType::SelectStreams => gst_sys::GST_EVENT_SELECT_STREAMS,
#[cfg(any(feature = "v1_18", feature = "dox"))]
EventType::InstantRateSyncTime => gst_sys::GST_EVENT_INSTANT_RATE_SYNC_TIME,
EventType::CustomUpstream => gst_sys::GST_EVENT_CUSTOM_UPSTREAM,
EventType::CustomDownstream => gst_sys::GST_EVENT_CUSTOM_DOWNSTREAM,
@ -705,12 +716,14 @@ impl FromGlib<gst_sys::GstEventType> for EventType {
20510 => EventType::Tag,
23054 => EventType::Buffersize,
25630 => EventType::SinkMessage,
#[cfg(any(feature = "v1_10", feature = "dox"))]
26894 => EventType::StreamGroupDone,
28174 => EventType::Eos,
30750 => EventType::Toc,
33310 => EventType::Protection,
38406 => EventType::SegmentDone,
40966 => EventType::Gap,
#[cfg(any(feature = "v1_18", feature = "dox"))]
46090 => EventType::InstantRateChange,
48641 => EventType::Qos,
51201 => EventType::Seek,
@ -719,7 +732,9 @@ impl FromGlib<gst_sys::GstEventType> for EventType {
58881 => EventType::Step,
61441 => EventType::Reconfigure,
64001 => EventType::TocSelect,
#[cfg(any(feature = "v1_10", feature = "dox"))]
66561 => EventType::SelectStreams,
#[cfg(any(feature = "v1_18", feature = "dox"))]
66817 => EventType::InstantRateSyncTime,
69121 => EventType::CustomUpstream,
71686 => EventType::CustomDownstream,

View file

@ -15,6 +15,7 @@ use gst_sys;
bitflags! {
pub struct BinFlags: u32 {
const NO_RESYNC = 16384;
#[cfg(any(feature = "v1_10", feature = "dox"))]
const STREAMS_AWARE = 32768;
const LAST = 524288;
}
@ -129,6 +130,7 @@ bitflags! {
const DELTA_UNIT = 8192;
const TAG_MEMORY = 16384;
const SYNC_AFTER = 32768;
#[cfg(any(feature = "v1_14", feature = "dox"))]
const NON_DROPPABLE = 65536;
const LAST = 1048576;
}
@ -505,6 +507,7 @@ impl SetValue for MemoryFlags {
bitflags! {
pub struct ObjectFlags: u32 {
#[cfg(any(feature = "v1_10", feature = "dox"))]
const MAY_BE_LEAKED = 1;
const LAST = 16;
}
@ -736,6 +739,7 @@ bitflags! {
const NONE = 0;
const FATAL_ERRORS = 1;
const NO_SINGLE_ELEMENT_BINS = 2;
#[cfg(any(feature = "v1_10", feature = "dox"))]
const PLACE_IN_BIN = 4;
}
}
@ -992,7 +996,9 @@ bitflags! {
const SNAP_NEAREST = 96;
const TRICKMODE_KEY_UNITS = 128;
const TRICKMODE_NO_AUDIO = 256;
#[cfg(any(feature = "v1_18", feature = "dox"))]
const TRICKMODE_FORWARD_PREDICTED = 512;
#[cfg(any(feature = "v1_18", feature = "dox"))]
const INSTANT_RATE_CHANGE = 1024;
}
}
@ -1047,6 +1053,7 @@ bitflags! {
const SKIP = 16;
const SEGMENT = 8;
const TRICKMODE_KEY_UNITS = 128;
#[cfg(any(feature = "v1_18", feature = "dox"))]
const TRICKMODE_FORWARD_PREDICTED = 512;
const TRICKMODE_NO_AUDIO = 256;
}

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 5a5b8f5)
from gir-files (https://github.com/gtk-rs/gir-files @ 7e318657)
from gir-files (https://github.com/gtk-rs/gir-files @ 947ac8db)