diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 893c07474..41983a5e7 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -65,7 +65,7 @@ pub enum ElementMessageType { Info, } -#[derive(Debug, Default, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] pub struct NotifyWatchId(libc::c_ulong); impl ToGlib for NotifyWatchId { @@ -79,6 +79,7 @@ impl ToGlib for NotifyWatchId { impl FromGlib for NotifyWatchId { fn from_glib(val: libc::c_ulong) -> NotifyWatchId { skip_assert_initialized!(); + assert_ne!(val, 0); NotifyWatchId(val) } } diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index a75d9a0b8..ed922371d 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -115,7 +115,7 @@ pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId}; pub use element::{ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI, ELEMENT_METADATA_ICON_NAME, ELEMENT_METADATA_KLASS, ELEMENT_METADATA_LONGNAME}; pub use bin::BinExtManual; -pub use pad::{PadExtManual, PadProbeData, PadProbeId, PadProbeInfo, PAD_PROBE_ID_INVALID}; +pub use pad::{PadExtManual, PadProbeData, PadProbeId, PadProbeInfo}; pub use gobject::GObjectExtManualGst; pub use child_proxy::ChildProxyExtManual; pub use tag_setter::TagSetterExtManual; diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index c5918ae8e..74b7428a5 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -56,9 +56,8 @@ impl Pad { } } -#[derive(Debug, Default, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] pub struct PadProbeId(libc::c_ulong); -pub const PAD_PROBE_ID_INVALID: PadProbeId = PadProbeId(0); impl ToGlib for PadProbeId { type GlibType = libc::c_ulong; @@ -71,6 +70,7 @@ impl ToGlib for PadProbeId { impl FromGlib for PadProbeId { fn from_glib(val: libc::c_ulong) -> PadProbeId { skip_assert_initialized!(); + assert_ne!(val, 0); PadProbeId(val) } }