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)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
#[repr(u32)] #[repr(u32)]
#[enum_type(name = "GstFallbackSourceRetryReason")] #[enum_type(name = "GstFallbackSourceRetryReason")]
enum RetryReason { pub enum RetryReason {
None, None,
Error, Error,
Eos, Eos,
@ -27,7 +27,7 @@ enum RetryReason {
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
#[repr(u32)] #[repr(u32)]
#[enum_type(name = "GstFallbackSourceStatus")] #[enum_type(name = "GstFallbackSourceStatus")]
enum Status { pub enum Status {
Stopped, Stopped,
Buffering, Buffering,
Retrying, Retrying,

View file

@ -20,7 +20,7 @@ use std::sync::{Mutex, RwLock};
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
#[repr(u32)] #[repr(u32)]
#[enum_type(name = "GstFallbackSwitchStreamHealth")] #[enum_type(name = "GstFallbackSwitchStreamHealth")]
pub(crate) enum StreamHealth { pub enum StreamHealth {
#[enum_value(name = "Data flow is inactive or late", nick = "inactive")] #[enum_value(name = "Data flow is inactive or late", nick = "inactive")]
Inactive = 0, Inactive = 0,
#[enum_value(name = "Data is currently flowing in the stream", nick = "present")] #[enum_value(name = "Data is currently flowing in the stream", nick = "present")]

View file

@ -11,6 +11,8 @@ use gst::prelude::*;
mod imp; mod imp;
pub use imp::StreamHealth;
glib::wrapper! { glib::wrapper! {
pub struct FallbackSwitch(ObjectSubclass<imp::FallbackSwitch>) @extends gst_base::Aggregator, gst::Element, gst::Object; 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 fallbacksrc;
mod fallbackswitch; mod fallbackswitch;
pub use fallbacksrc::{RetryReason, Status};
pub use fallbackswitch::StreamHealth;
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
fallbacksrc::register(plugin)?; fallbacksrc::register(plugin)?;
fallbackswitch::register(plugin)?; fallbackswitch::register(plugin)?;