From ac1c6e513e5e316e244bf7d3e7cca1dcc7f7b7f3 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 1 Mar 2022 14:27:44 +0100 Subject: [PATCH] fallbackswitch: export GEnum used in properties Rust applications will be able to use those directly. --- utils/fallbackswitch/src/fallbacksrc/mod.rs | 4 ++-- utils/fallbackswitch/src/fallbackswitch/imp.rs | 2 +- utils/fallbackswitch/src/fallbackswitch/mod.rs | 2 ++ utils/fallbackswitch/src/lib.rs | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/fallbackswitch/src/fallbacksrc/mod.rs b/utils/fallbackswitch/src/fallbacksrc/mod.rs index b639e7ad..76d1bb9e 100644 --- a/utils/fallbackswitch/src/fallbacksrc/mod.rs +++ b/utils/fallbackswitch/src/fallbacksrc/mod.rs @@ -16,7 +16,7 @@ mod video_fallback; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)] #[repr(u32)] #[enum_type(name = "GstFallbackSourceRetryReason")] -enum RetryReason { +pub enum RetryReason { None, Error, Eos, @@ -27,7 +27,7 @@ enum RetryReason { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)] #[repr(u32)] #[enum_type(name = "GstFallbackSourceStatus")] -enum Status { +pub enum Status { Stopped, Buffering, Retrying, diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 0d0b4d3e..906e2321 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -20,7 +20,7 @@ use std::sync::{Mutex, RwLock}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)] #[repr(u32)] #[enum_type(name = "GstFallbackSwitchStreamHealth")] -pub(crate) enum StreamHealth { +pub enum StreamHealth { #[enum_value(name = "Data flow is inactive or late", nick = "inactive")] Inactive = 0, #[enum_value(name = "Data is currently flowing in the stream", nick = "present")] diff --git a/utils/fallbackswitch/src/fallbackswitch/mod.rs b/utils/fallbackswitch/src/fallbackswitch/mod.rs index c1a24728..23420a0b 100644 --- a/utils/fallbackswitch/src/fallbackswitch/mod.rs +++ b/utils/fallbackswitch/src/fallbackswitch/mod.rs @@ -11,6 +11,8 @@ use gst::prelude::*; mod imp; +pub use imp::StreamHealth; + glib::wrapper! { pub struct FallbackSwitch(ObjectSubclass) @extends gst_base::Aggregator, gst::Element, gst::Object; } diff --git a/utils/fallbackswitch/src/lib.rs b/utils/fallbackswitch/src/lib.rs index 0882f5eb..3aee2407 100644 --- a/utils/fallbackswitch/src/lib.rs +++ b/utils/fallbackswitch/src/lib.rs @@ -12,6 +12,9 @@ use gst::glib; mod fallbacksrc; mod fallbackswitch; +pub use fallbacksrc::{RetryReason, Status}; +pub use fallbackswitch::StreamHealth; + fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { fallbacksrc::register(plugin)?; fallbackswitch::register(plugin)?;