Skip to content

Commit

Permalink
Correctly mark Stream and StreamType as requiring version 1.10 at least
Browse files Browse the repository at this point in the history
Should fix #68
  • Loading branch information
sdroege committed Dec 26, 2017
1 parent f4da93a commit 755982b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gir-files/Gst-1.0.gir
Original file line number Diff line number Diff line change
Expand Up @@ -35441,6 +35441,7 @@ on the returned caps to modify it.</doc>
<class name="Stream"
c:symbol-prefix="stream"
c:type="GstStream"
version="1.10"
parent="Object"
glib:type-name="GstStream"
glib:get-type="gst_stream_get_type"
Expand Down Expand Up @@ -36103,6 +36104,7 @@ application of new streaming threads and their status.</doc>
</member>
</enumeration>
<bitfield name="StreamType"
version="1.10"
glib:type-name="GstStreamType"
glib:get-type="gst_stream_type_get_type"
c:type="GstStreamType">
Expand Down
7 changes: 7 additions & 0 deletions gstreamer/src/auto/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ impl SetValue for StreamFlags {
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
bitflags! {
pub struct StreamType: u32 {
const UNKNOWN = 1;
Expand All @@ -785,6 +786,7 @@ bitflags! {
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for StreamType {
type GlibType = ffi::GstStreamType;
Expand All @@ -794,6 +796,7 @@ impl ToGlib for StreamType {
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<ffi::GstStreamType> for StreamType {
fn from_glib(value: ffi::GstStreamType) -> StreamType {
Expand All @@ -802,24 +805,28 @@ impl FromGlib<ffi::GstStreamType> for StreamType {
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl StaticType for StreamType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_stream_type_get_type()) }
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValueOptional<'a> for StreamType {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl<'a> FromValue<'a> for StreamType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(ffi::GstStreamType::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
}
}

#[cfg(any(feature = "v1_10", feature = "dox"))]
impl SetValue for StreamType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
Expand Down
1 change: 1 addition & 0 deletions gstreamer/src/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ pub use self::flags::SegmentFlags;
#[cfg(any(feature = "v1_12", feature = "dox"))]
pub use self::flags::StackTraceFlags;
pub use self::flags::StreamFlags;
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub use self::flags::StreamType;

mod alias;
Expand Down

0 comments on commit 755982b

Please sign in to comment.