Skip to main content

gstfallbackswitch/fallbacksrc/
mod.rs

1// Copyright (C) 2020 Sebastian Dröge <sebastian@centricular.com>
2//
3// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
4// If a copy of the MPL was not distributed with this file, You can obtain one at
5// <https://mozilla.org/MPL/2.0/>.
6//
7// SPDX-License-Identifier: MPL-2.0
8
9use gst::glib;
10use gst::prelude::*;
11
12mod custom_source;
13mod imp;
14
15#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
16#[repr(u32)]
17#[enum_type(name = "GstFallbackSourceRetryReason")]
18pub enum RetryReason {
19    None,
20    Error,
21    Eos,
22    StateChangeFailure,
23    Timeout,
24}
25
26#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
27#[repr(u32)]
28#[enum_type(name = "GstFallbackSourceStatus")]
29pub enum Status {
30    Stopped,
31    Buffering,
32    Retrying,
33    Running,
34}
35
36glib::wrapper! {
37    pub struct FallbackSrc(ObjectSubclass<imp::FallbackSrc>) @extends gst::Bin, gst::Element, gst::Object;
38}
39
40pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
41    gst::Element::register(
42        Some(plugin),
43        "fallbacksrc",
44        gst::Rank::NONE,
45        FallbackSrc::static_type(),
46    )
47}