From 73cfb357c6e3002d2215484f286319aa8f1e2cd0 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 514d7a37..7bb80af8 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 d9046209..44af6de9 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -18,7 +18,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 21593bc4..26d3de1b 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)?;