mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-08 09:19:23 +00:00
fallbackswitch: Switch from lazy_static to once_cell
This commit is contained in:
parent
cb7741919d
commit
f6120fcf98
|
@ -19,12 +19,11 @@ gstreamer-audio = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs
|
|||
gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"] }
|
||||
gtk = { git = "https://github.com/gtk-rs/gtk", optional = true }
|
||||
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
|
||||
lazy_static = "1.0"
|
||||
once_cell = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
gstreamer-check = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]}
|
||||
gstreamer-app = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_14"]}
|
||||
lazy_static = "1.2"
|
||||
|
||||
[lib]
|
||||
name = "gstfallbackswitch"
|
||||
|
|
|
@ -31,6 +31,8 @@ use gst_base::prelude::*;
|
|||
use gst_base::subclass::prelude::*;
|
||||
use gst_video;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use std::sync::{Mutex, RwLock};
|
||||
|
||||
struct FallbackSwitch {
|
||||
|
@ -42,13 +44,13 @@ struct FallbackSwitch {
|
|||
settings: Mutex<Settings>,
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"fallbackswitch",
|
||||
gst::DebugColorFlags::empty(),
|
||||
Some("Fallback switch Element"),
|
||||
);
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
#[derive(Debug)]
|
||||
struct OutputState {
|
||||
|
|
|
@ -39,8 +39,7 @@ mod gst_base {
|
|||
pub use super::base::*;
|
||||
}
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate once_cell;
|
||||
|
||||
mod fallbackswitch;
|
||||
|
||||
|
|
|
@ -26,16 +26,15 @@ extern crate gstreamer_check as gst_check;
|
|||
|
||||
extern crate gstfallbackswitch;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
lazy_static! {
|
||||
static ref TEST_CAT: gst::DebugCategory = gst::DebugCategory::new(
|
||||
static TEST_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"fallbackswitch-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
Some("fallbackswitch test"),
|
||||
);
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
fn init() {
|
||||
use std::sync::Once;
|
||||
|
|
Loading…
Reference in a new issue