fallbackswitch: export GEnum used in properties

Rust applications will be able to use those directly.
This commit is contained in:
Guillaume Desmottes 2022-03-01 14:27:44 +01:00
parent 8c738b7a2e
commit ac1c6e513e
4 changed files with 8 additions and 3 deletions

View file

@ -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,

View file

@ -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")]

View file

@ -11,6 +11,8 @@ use gst::prelude::*;
mod imp;
pub use imp::StreamHealth;
glib::wrapper! {
pub struct FallbackSwitch(ObjectSubclass<imp::FallbackSwitch>) @extends gst_base::Aggregator, gst::Element, gst::Object;
}

View file

@ -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)?;