Remove once_cell dependency

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1868>
This commit is contained in:
Sebastian Dröge 2024-10-21 20:44:33 +03:00 committed by GStreamer Marge Bot
parent d6e7031799
commit 7e59c3f0fd
248 changed files with 1067 additions and 1144 deletions

48
Cargo.lock generated
View file

@ -2288,7 +2288,6 @@ dependencies = [
"hrtf", "hrtf",
"nnnoiseless", "nnnoiseless",
"num-traits", "num-traits",
"once_cell",
"rayon", "rayon",
"smallvec", "smallvec",
] ]
@ -2316,7 +2315,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
"percent-encoding", "percent-encoding",
"rand", "rand",
"serde", "serde",
@ -2340,7 +2338,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-video", "gstreamer-video",
"image", "image",
"once_cell",
] ]
[[package]] [[package]]
@ -2354,7 +2351,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-audio", "gstreamer-audio",
"gstreamer-check", "gstreamer-check",
"once_cell",
] ]
[[package]] [[package]]
@ -2374,7 +2370,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
"pango", "pango",
"pangocairo", "pangocairo",
"pretty_assertions", "pretty_assertions",
@ -2397,7 +2392,6 @@ dependencies = [
"gstreamer-audio", "gstreamer-audio",
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"once_cell",
] ]
[[package]] [[package]]
@ -2410,7 +2404,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-video", "gstreamer-video",
"num_cpus", "num_cpus",
"once_cell",
] ]
[[package]] [[package]]
@ -2427,7 +2420,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"gtk4", "gtk4",
"once_cell",
"parking_lot", "parking_lot",
] ]
@ -2441,7 +2433,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
] ]
[[package]] [[package]]
@ -2451,7 +2442,6 @@ dependencies = [
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"gstreamer-base", "gstreamer-base",
"once_cell",
"url", "url",
] ]
@ -2467,7 +2457,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"nom", "nom",
"num-rational", "num-rational",
"once_cell",
"smallvec", "smallvec",
] ]
@ -2488,7 +2477,6 @@ dependencies = [
"gstreamer-pbutils", "gstreamer-pbutils",
"gstreamer-video", "gstreamer-video",
"m3u8-rs", "m3u8-rs",
"once_cell",
"quick-xml 0.31.0", "quick-xml 0.31.0",
"serde", "serde",
] ]
@ -2503,7 +2491,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
] ]
[[package]] [[package]]
@ -2516,7 +2503,6 @@ dependencies = [
"gstreamer-app", "gstreamer-app",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
] ]
[[package]] [[package]]
@ -2537,7 +2523,6 @@ dependencies = [
"gstreamer-gl-x11", "gstreamer-gl-x11",
"gstreamer-video", "gstreamer-video",
"gtk4", "gtk4",
"once_cell",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@ -2556,7 +2541,6 @@ dependencies = [
"gstreamer-pbutils", "gstreamer-pbutils",
"gstreamer-video", "gstreamer-video",
"m3u8-rs", "m3u8-rs",
"once_cell",
"sprintf", "sprintf",
] ]
@ -2572,7 +2556,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"num-traits", "num-traits",
"once_cell",
] ]
[[package]] [[package]]
@ -2586,7 +2569,6 @@ dependencies = [
"gstreamer-app", "gstreamer-app",
"gstreamer-check", "gstreamer-check",
"gstreamer-utils", "gstreamer-utils",
"once_cell",
"pretty_assertions", "pretty_assertions",
"serial_test", "serial_test",
"tokio", "tokio",
@ -2600,7 +2582,6 @@ dependencies = [
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"once_cell",
"serde", "serde",
"serde_json", "serde_json",
] ]
@ -2616,7 +2597,6 @@ dependencies = [
"gstreamer-audio", "gstreamer-audio",
"gstreamer-check", "gstreamer-check",
"lewton", "lewton",
"once_cell",
] ]
[[package]] [[package]]
@ -2631,7 +2611,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gtk4", "gtk4",
"num-rational", "num-rational",
"once_cell",
"parking_lot", "parking_lot",
] ]
@ -2647,7 +2626,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-pbutils", "gstreamer-pbutils",
"gstreamer-video", "gstreamer-video",
"once_cell",
"tempfile", "tempfile",
"url", "url",
] ]
@ -2660,7 +2638,6 @@ dependencies = [
"bitstream-io", "bitstream-io",
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"once_cell",
] ]
[[package]] [[package]]
@ -2678,7 +2655,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-video", "gstreamer-video",
"libloading", "libloading",
"once_cell",
"quick-xml 0.31.0", "quick-xml 0.31.0",
"smallvec", "smallvec",
"thiserror", "thiserror",
@ -2695,7 +2671,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-rtp", "gstreamer-rtp",
"gstreamer-video", "gstreamer-video",
"once_cell",
"pango", "pango",
"pangocairo", "pangocairo",
"xmlparser", "xmlparser",
@ -2711,7 +2686,6 @@ dependencies = [
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"gstreamer-video", "gstreamer-video",
"once_cell",
] ]
[[package]] [[package]]
@ -2722,7 +2696,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
"parking_lot", "parking_lot",
"png", "png",
] ]
@ -2737,7 +2710,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"once_cell",
"quinn", "quinn",
"quinn-proto", "quinn-proto",
"rcgen", "rcgen",
@ -2758,7 +2730,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"gstreamer-rtp", "gstreamer-rtp",
"once_cell",
"rand", "rand",
"raptorq", "raptorq",
] ]
@ -2772,7 +2743,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"once_cell",
"rav1e", "rav1e",
] ]
@ -2783,7 +2753,6 @@ dependencies = [
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"once_cell",
"regex", "regex",
] ]
@ -2800,7 +2769,6 @@ dependencies = [
"http-body-util", "http-body-util",
"hyper 1.5.0", "hyper 1.5.0",
"mime", "mime",
"once_cell",
"pin-project-lite", "pin-project-lite",
"reqwest 0.12.8", "reqwest 0.12.8",
"tokio", "tokio",
@ -2829,7 +2797,6 @@ dependencies = [
"gstreamer-video", "gstreamer-video",
"hex", "hex",
"log", "log",
"once_cell",
"rand", "rand",
"rtcp-types", "rtcp-types",
"rtp-types", "rtp-types",
@ -2854,7 +2821,6 @@ dependencies = [
"gstreamer-net", "gstreamer-net",
"gstreamer-pbutils", "gstreamer-pbutils",
"lru", "lru",
"once_cell",
"rtsp-types", "rtsp-types",
"sdp-types", "sdp-types",
"socket2", "socket2",
@ -2875,7 +2841,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-check", "gstreamer-check",
"hex", "hex",
"once_cell",
"pretty_assertions", "pretty_assertions",
"rand", "rand",
"serde", "serde",
@ -2896,7 +2861,6 @@ dependencies = [
"gstreamer-audio", "gstreamer-audio",
"gstreamer-base", "gstreamer-base",
"http 1.1.0", "http 1.1.0",
"once_cell",
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
@ -2914,7 +2878,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"librespot-core", "librespot-core",
"librespot-playback", "librespot-playback",
"once_cell",
"tokio", "tokio",
"url", "url",
] ]
@ -2925,7 +2888,6 @@ version = "0.14.0-alpha.1"
dependencies = [ dependencies = [
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"once_cell",
] ]
[[package]] [[package]]
@ -2936,7 +2898,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-check", "gstreamer-check",
"hyphenation", "hyphenation",
"once_cell",
"textwrap", "textwrap",
] ]
@ -2959,7 +2920,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gstreamer-net", "gstreamer-net",
"gstreamer-rtp", "gstreamer-rtp",
"once_cell",
"pin-project-lite", "pin-project-lite",
"pkg-config", "pkg-config",
"polling", "polling",
@ -2984,7 +2944,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"gtk4", "gtk4",
"once_cell",
"parking_lot", "parking_lot",
] ]
@ -2997,7 +2956,6 @@ dependencies = [
"etherparse", "etherparse",
"gst-plugin-version-helper", "gst-plugin-version-helper",
"gstreamer", "gstreamer",
"once_cell",
"pcap-file", "pcap-file",
"regex", "regex",
"signal-hook", "signal-hook",
@ -3014,7 +2972,6 @@ dependencies = [
"gstreamer-base", "gstreamer-base",
"gstreamer-video", "gstreamer-video",
"num-traits", "num-traits",
"once_cell",
] ]
[[package]] [[package]]
@ -3027,7 +2984,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-app", "gstreamer-app",
"more-asserts", "more-asserts",
"once_cell",
"thiserror", "thiserror",
"url", "url",
] ]
@ -3056,7 +3012,6 @@ dependencies = [
"gstreamer-video", "gstreamer-video",
"image", "image",
"image_hasher", "image_hasher",
"once_cell",
"rgb", "rgb",
] ]
@ -3069,7 +3024,6 @@ dependencies = [
"gstreamer-check", "gstreamer-check",
"gstreamer-video", "gstreamer-video",
"libwebp-sys2", "libwebp-sys2",
"once_cell",
"pretty_assertions", "pretty_assertions",
] ]
@ -3113,7 +3067,6 @@ dependencies = [
"itertools 0.12.1", "itertools 0.12.1",
"livekit-api", "livekit-api",
"livekit-protocol", "livekit-protocol",
"once_cell",
"parse_link_header", "parse_link_header",
"rand", "rand",
"regex", "regex",
@ -3174,7 +3127,6 @@ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-sdp", "gstreamer-sdp",
"gstreamer-webrtc", "gstreamer-webrtc",
"once_cell",
"parse_link_header", "parse_link_header",
"reqwest 0.12.8", "reqwest 0.12.8",
"tokio", "tokio",

View file

@ -129,7 +129,6 @@ edition = "2021"
rust-version = "1.80" rust-version = "1.80"
[workspace.dependencies] [workspace.dependencies]
once_cell = "1"
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master" } gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master" }
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master", features=["use_glib"] } cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "master", features=["use_glib"] }

View file

@ -21,7 +21,6 @@ nnnoiseless = { version = "0.5", default-features = false }
smallvec = "1" smallvec = "1"
atomic_refcell = "0.1" atomic_refcell = "0.1"
rayon = "1.5" rayon = "1.5"
once_cell.workspace = true
[lib] [lib]
name = "gstrsaudiofx" name = "gstrsaudiofx"

View file

@ -19,8 +19,8 @@ use byte_slice_cast::*;
use num_traits::cast::{FromPrimitive, ToPrimitive}; use num_traits::cast::{FromPrimitive, ToPrimitive};
use num_traits::float::Float; use num_traits::float::Float;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static _CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static _CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"rsaudioecho", "rsaudioecho",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -94,7 +94,7 @@ impl ObjectSubclass for AudioEcho {
impl ObjectImpl for AudioEcho { impl ObjectImpl for AudioEcho {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecUInt64::builder("max-delay") glib::ParamSpecUInt64::builder("max-delay")
.nick("Maximum Delay") .nick("Maximum Delay")
@ -183,7 +183,7 @@ impl GstObjectImpl for AudioEcho {}
impl ElementImpl for AudioEcho { impl ElementImpl for AudioEcho {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Audio echo", "Audio echo",
"Filter/Effect/Audio", "Filter/Effect/Audio",
@ -236,7 +236,7 @@ impl BaseTransformImpl for AudioEcho {
impl AudioFilterImpl for AudioEcho { impl AudioFilterImpl for AudioEcho {
fn allowed_caps() -> &'static gst::Caps { fn allowed_caps() -> &'static gst::Caps {
static CAPS: Lazy<gst::Caps> = Lazy::new(|| { static CAPS: LazyLock<gst::Caps> = LazyLock::new(|| {
gst_audio::AudioCapsBuilder::new_interleaved() gst_audio::AudioCapsBuilder::new_interleaved()
.format_list([gst_audio::AUDIO_FORMAT_F32, gst_audio::AUDIO_FORMAT_F64]) .format_list([gst_audio::AUDIO_FORMAT_F32, gst_audio::AUDIO_FORMAT_F64])
.build() .build()

View file

@ -21,11 +21,11 @@ use std::sync::Mutex;
use byte_slice_cast::*; use byte_slice_cast::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use atomic_refcell::AtomicRefCell; use atomic_refcell::AtomicRefCell;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"audioloudnorm", "audioloudnorm",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -1722,7 +1722,7 @@ impl ObjectSubclass for AudioLoudNorm {
impl ObjectImpl for AudioLoudNorm { impl ObjectImpl for AudioLoudNorm {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecDouble::builder("loudness-target") glib::ParamSpecDouble::builder("loudness-target")
.nick("Loudness Target") .nick("Loudness Target")
@ -1819,7 +1819,7 @@ impl GstObjectImpl for AudioLoudNorm {}
impl ElementImpl for AudioLoudNorm { impl ElementImpl for AudioLoudNorm {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Audio loudness normalizer", "Audio loudness normalizer",
"Filter/Effect/Audio", "Filter/Effect/Audio",
@ -1832,7 +1832,7 @@ impl ElementImpl for AudioLoudNorm {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst_audio::AudioCapsBuilder::new_interleaved() let caps = gst_audio::AudioCapsBuilder::new_interleaved()
.format(gst_audio::AUDIO_FORMAT_F64) .format(gst_audio::AUDIO_FORMAT_F64)
.rate(192_000) .rate(192_000)

View file

@ -21,11 +21,11 @@ use nnnoiseless::DenoiseState;
use byte_slice_cast::*; use byte_slice_cast::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use atomic_refcell::AtomicRefCell; use atomic_refcell::AtomicRefCell;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"audiornnoise", "audiornnoise",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -257,7 +257,7 @@ impl ObjectSubclass for AudioRNNoise {
impl ObjectImpl for AudioRNNoise { impl ObjectImpl for AudioRNNoise {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecFloat::builder("voice-activity-threshold") vec![glib::ParamSpecFloat::builder("voice-activity-threshold")
.nick("Voice activity threshold") .nick("Voice activity threshold")
.blurb("Threshold of the voice activity detector below which to mute the output") .blurb("Threshold of the voice activity detector below which to mute the output")
@ -296,7 +296,7 @@ impl GstObjectImpl for AudioRNNoise {}
impl ElementImpl for AudioRNNoise { impl ElementImpl for AudioRNNoise {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Audio denoise", "Audio denoise",
"Filter/Effect/Audio", "Filter/Effect/Audio",
@ -389,7 +389,7 @@ impl BaseTransformImpl for AudioRNNoise {
impl AudioFilterImpl for AudioRNNoise { impl AudioFilterImpl for AudioRNNoise {
fn allowed_caps() -> &'static gst::Caps { fn allowed_caps() -> &'static gst::Caps {
static CAPS: Lazy<gst::Caps> = Lazy::new(|| { static CAPS: LazyLock<gst::Caps> = LazyLock::new(|| {
gst_audio::AudioCapsBuilder::new_interleaved() gst_audio::AudioCapsBuilder::new_interleaved()
.format(gst_audio::AUDIO_FORMAT_F32) .format(gst_audio::AUDIO_FORMAT_F32)
.rate(48000) .rate(48000)

View file

@ -15,7 +15,7 @@ use gst_base::prelude::*;
use std::sync::atomic; use std::sync::atomic;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use byte_slice_cast::*; use byte_slice_cast::*;
@ -23,7 +23,7 @@ use smallvec::SmallVec;
use atomic_refcell::AtomicRefCell; use atomic_refcell::AtomicRefCell;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ebur128level", "ebur128level",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -122,7 +122,7 @@ impl ObjectSubclass for EbuR128Level {
impl ObjectImpl for EbuR128Level { impl ObjectImpl for EbuR128Level {
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![glib::subclass::Signal::builder("reset") vec![glib::subclass::Signal::builder("reset")
.action() .action()
.class_handler(|_token, args| { .class_handler(|_token, args| {
@ -141,7 +141,7 @@ impl ObjectImpl for EbuR128Level {
} }
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecFlags::builder::<Mode>("mode") glib::ParamSpecFlags::builder::<Mode>("mode")
.nick("Mode") .nick("Mode")
@ -223,7 +223,7 @@ impl GstObjectImpl for EbuR128Level {}
impl ElementImpl for EbuR128Level { impl ElementImpl for EbuR128Level {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"EBU R128 Loudness Level Measurement", "EBU R128 Loudness Level Measurement",
"Filter/Analyzer/Audio", "Filter/Analyzer/Audio",
@ -236,7 +236,7 @@ impl ElementImpl for EbuR128Level {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst_audio::AudioCapsBuilder::new() let caps = gst_audio::AudioCapsBuilder::new()
.format_list([ .format_list([
gst_audio::AUDIO_FORMAT_S16, gst_audio::AUDIO_FORMAT_S16,
@ -486,7 +486,7 @@ impl BaseTransformImpl for EbuR128Level {
impl AudioFilterImpl for EbuR128Level { impl AudioFilterImpl for EbuR128Level {
fn allowed_caps() -> &'static gst::Caps { fn allowed_caps() -> &'static gst::Caps {
static CAPS: Lazy<gst::Caps> = Lazy::new(|| { static CAPS: LazyLock<gst::Caps> = LazyLock::new(|| {
gst_audio::AudioCapsBuilder::new() gst_audio::AudioCapsBuilder::new()
.format_list([ .format_list([
gst_audio::AUDIO_FORMAT_S16, gst_audio::AUDIO_FORMAT_S16,

View file

@ -23,8 +23,8 @@ use byte_slice_cast::*;
use rayon::prelude::*; use rayon::prelude::*;
use rayon::{ThreadPool, ThreadPoolBuilder}; use rayon::{ThreadPool, ThreadPoolBuilder};
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"hrtfrender", "hrtfrender",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -32,7 +32,7 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
) )
}); });
static THREAD_POOL: Lazy<Mutex<Weak<ThreadPool>>> = Lazy::new(|| Mutex::new(Weak::new())); static THREAD_POOL: LazyLock<Mutex<Weak<ThreadPool>>> = LazyLock::new(|| Mutex::new(Weak::new()));
const DEFAULT_INTERPOLATION_STEPS: u64 = 8; const DEFAULT_INTERPOLATION_STEPS: u64 = 8;
const DEFAULT_BLOCK_LENGTH: u64 = 512; const DEFAULT_BLOCK_LENGTH: u64 = 512;
@ -400,7 +400,7 @@ impl HrtfRender {
impl ObjectImpl for HrtfRender { impl ObjectImpl for HrtfRender {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecBoxed::builder::<glib::Bytes>("hrir-raw") glib::ParamSpecBoxed::builder::<glib::Bytes>("hrir-raw")
.nick("Head Transform Impulse Response") .nick("Head Transform Impulse Response")
@ -533,7 +533,7 @@ impl GstObjectImpl for HrtfRender {}
impl ElementImpl for HrtfRender { impl ElementImpl for HrtfRender {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Head-Related Transfer Function (HRTF) renderer", "Head-Related Transfer Function (HRTF) renderer",
"Filter/Effect/Audio", "Filter/Effect/Audio",
@ -546,7 +546,7 @@ impl ElementImpl for HrtfRender {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_caps = gst_audio::AudioCapsBuilder::new_interleaved() let src_caps = gst_audio::AudioCapsBuilder::new_interleaved()
.channels(2) .channels(2)
.format(gst_audio::AUDIO_FORMAT_F32) .format(gst_audio::AUDIO_FORMAT_F32)

View file

@ -9,9 +9,9 @@
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CONFIG: Lazy<glib::Bytes> = Lazy::new(|| { static CONFIG: LazyLock<glib::Bytes> = LazyLock::new(|| {
let buff = include_bytes!("test.hrir"); let buff = include_bytes!("test.hrir");
glib::Bytes::from_owned(buff) glib::Bytes::from_owned(buff)
}); });

View file

@ -14,7 +14,6 @@ gst-audio.workspace = true
claxon = { version = "0.4" } claxon = { version = "0.4" }
byte-slice-cast = "1.0" byte-slice-cast = "1.0"
atomic_refcell = "0.1" atomic_refcell = "0.1"
once_cell.workspace = true
[dev-dependencies] [dev-dependencies]
gst-check.workspace = true gst-check.workspace = true

View file

@ -19,9 +19,9 @@ use atomic_refcell::AtomicRefCell;
use byte_slice_cast::*; use byte_slice_cast::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"claxondec", "claxondec",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -51,7 +51,7 @@ impl GstObjectImpl for ClaxonDec {}
impl ElementImpl for ClaxonDec { impl ElementImpl for ClaxonDec {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Claxon FLAC decoder", "Claxon FLAC decoder",
"Decoder/Audio", "Decoder/Audio",
@ -64,7 +64,7 @@ impl ElementImpl for ClaxonDec {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let sink_caps = gst::Caps::builder("audio/x-flac") let sink_caps = gst::Caps::builder("audio/x-flac")
.field("framed", true) .field("framed", true)
.build(); .build();

View file

@ -14,7 +14,6 @@ gst-base.workspace = true
gst-audio.workspace = true gst-audio.workspace = true
csound = "0.1.8" csound = "0.1.8"
byte-slice-cast = "1.0" byte-slice-cast = "1.0"
once_cell.workspace = true
[dev-dependencies] [dev-dependencies]
gst-check.workspace = true gst-check.workspace = true

View file

@ -22,9 +22,9 @@ use byte_slice_cast::*;
use csound::{Csound, MessageType}; use csound::{Csound, MessageType};
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"csoundfilter", "csoundfilter",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -323,7 +323,7 @@ impl ObjectSubclass for CsoundFilter {
impl ObjectImpl for CsoundFilter { impl ObjectImpl for CsoundFilter {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecBoolean::builder("loop") glib::ParamSpecBoolean::builder("loop")
.nick("Loop") .nick("Loop")
@ -415,7 +415,7 @@ impl GstObjectImpl for CsoundFilter {}
impl ElementImpl for CsoundFilter { impl ElementImpl for CsoundFilter {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Audio filter", "Audio filter",
"Filter/Effect/Audio", "Filter/Effect/Audio",
@ -428,7 +428,7 @@ impl ElementImpl for CsoundFilter {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst_audio::AudioCapsBuilder::new_interleaved() let caps = gst_audio::AudioCapsBuilder::new_interleaved()
.format(gst_audio::AUDIO_FORMAT_F64) .format(gst_audio::AUDIO_FORMAT_F64)
.build(); .build();

View file

@ -14,7 +14,6 @@ gst-audio.workspace = true
lewton = { version = "0.10", default-features = false } lewton = { version = "0.10", default-features = false }
byte-slice-cast = "1.0" byte-slice-cast = "1.0"
atomic_refcell = "0.1" atomic_refcell = "0.1"
once_cell.workspace = true
[dev-dependencies] [dev-dependencies]
gst-check.workspace = true gst-check.workspace = true

View file

@ -18,7 +18,7 @@ use atomic_refcell::AtomicRefCell;
use byte_slice_cast::*; use byte_slice_cast::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
struct State { struct State {
header_bufs: ( header_bufs: (
@ -37,7 +37,7 @@ pub struct LewtonDec {
state: AtomicRefCell<Option<State>>, state: AtomicRefCell<Option<State>>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"lewtondec", "lewtondec",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -58,7 +58,7 @@ impl GstObjectImpl for LewtonDec {}
impl ElementImpl for LewtonDec { impl ElementImpl for LewtonDec {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"lewton Vorbis decoder", "lewton Vorbis decoder",
"Decoder/Audio", "Decoder/Audio",
@ -71,7 +71,7 @@ impl ElementImpl for LewtonDec {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let sink_caps = gst::Caps::builder("audio/x-vorbis").build(); let sink_caps = gst::Caps::builder("audio/x-vorbis").build();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -15,7 +15,6 @@ gst-base.workspace = true
gst-audio = { workspace = true, features = ["v1_16"] } gst-audio = { workspace = true, features = ["v1_16"] }
tokio = { version = "1", features = [ "full" ] } tokio = { version = "1", features = [ "full" ] }
async-tungstenite = { version = "0.28", features = ["tokio", "tokio-runtime", "tokio-native-tls"] } async-tungstenite = { version = "0.28", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
once_cell.workspace = true
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
atomic_refcell = "0.1" atomic_refcell = "0.1"

View file

@ -27,7 +27,7 @@ use std::time::Duration;
use atomic_refcell::AtomicRefCell; use atomic_refcell::AtomicRefCell;
use once_cell::sync::Lazy; use std::sync::LazyLock;
#[derive(serde::Deserialize, Debug)] #[derive(serde::Deserialize, Debug)]
#[allow(dead_code)] #[allow(dead_code)]
@ -141,7 +141,7 @@ struct EndOfStream {
last_seq_no: u64, last_seq_no: u64,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"speechmaticstranscribe", "speechmaticstranscribe",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -149,7 +149,7 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
) )
}); });
static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| { static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
runtime::Builder::new_multi_thread() runtime::Builder::new_multi_thread()
.enable_all() .enable_all()
.worker_threads(1) .worker_threads(1)
@ -1351,7 +1351,7 @@ impl GstObjectImpl for Transcriber {}
impl ObjectImpl for Transcriber { impl ObjectImpl for Transcriber {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("language-code") glib::ParamSpecString::builder("language-code")
.nick("Language Code") .nick("Language Code")
@ -1545,7 +1545,7 @@ impl ObjectImpl for Transcriber {
impl ElementImpl for Transcriber { impl ElementImpl for Transcriber {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Transcriber", "Transcriber",
"Audio/Text/Filter", "Audio/Text/Filter",
@ -1558,7 +1558,7 @@ impl ElementImpl for Transcriber {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_caps = gst::Caps::builder("text/x-raw") let src_caps = gst::Caps::builder("text/x-raw")
.field("format", "utf8") .field("format", "utf8")
.build(); .build();
@ -1751,7 +1751,7 @@ const DEFAULT_OUTPUT_LANG_CODE: Option<&str> = None;
impl ObjectImpl for TranscriberSrcPad { impl ObjectImpl for TranscriberSrcPad {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder(OUTPUT_LANG_CODE_PROPERTY) vec![glib::ParamSpecString::builder(OUTPUT_LANG_CODE_PROPERTY)
.nick("Language Code") .nick("Language Code")
.blurb("The Language the Stream must be translated to") .blurb("The Language the Stream must be translated to")

View file

@ -17,7 +17,6 @@ tokio = { version = "1", features = ["rt-multi-thread"] }
futures = "0.3" futures = "0.3"
anyhow = "1.0" anyhow = "1.0"
url = "2.3" url = "2.3"
once_cell.workspace = true
[lib] [lib]
name = "gstspotify" name = "gstspotify"

View file

@ -9,7 +9,7 @@
use std::sync::{mpsc, Arc, Mutex}; use std::sync::{mpsc, Arc, Mutex};
use futures::future::{AbortHandle, Abortable, Aborted}; use futures::future::{AbortHandle, Abortable, Aborted};
use once_cell::sync::Lazy; use std::sync::LazyLock;
use tokio::{runtime, task::JoinHandle}; use tokio::{runtime, task::JoinHandle};
use gst::glib; use gst::glib;
@ -28,7 +28,7 @@ use librespot_playback::{
use super::Bitrate; use super::Bitrate;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"spotifyaudiosrc", "spotifyaudiosrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -36,7 +36,7 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
) )
}); });
static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| { static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
runtime::Builder::new_multi_thread() runtime::Builder::new_multi_thread()
.enable_all() .enable_all()
.worker_threads(1) .worker_threads(1)
@ -112,7 +112,7 @@ impl ObjectSubclass for SpotifyAudioSrc {
impl ObjectImpl for SpotifyAudioSrc { impl ObjectImpl for SpotifyAudioSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
let mut props = crate::common::Settings::properties(); let mut props = crate::common::Settings::properties();
let default = Settings::default(); let default = Settings::default();
@ -154,7 +154,7 @@ impl GstObjectImpl for SpotifyAudioSrc {}
impl ElementImpl for SpotifyAudioSrc { impl ElementImpl for SpotifyAudioSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Spotify source", "Spotify source",
"Source/Audio", "Source/Audio",
@ -167,7 +167,7 @@ impl ElementImpl for SpotifyAudioSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::builder("application/ogg").build(); let caps = gst::Caps::builder("application/ogg").build();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(

View file

@ -12,7 +12,6 @@ rust-version.workspace = true
url = "2" url = "2"
gst.workspace = true gst.workspace = true
gst-base.workspace = true gst-base.workspace = true
once_cell.workspace = true
[lib] [lib]
name = "gstrsfile" name = "gstrsfile"

View file

@ -55,8 +55,8 @@ pub struct FileSink {
state: Mutex<State>, state: Mutex<State>,
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"rsfilesink", "rsfilesink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -119,7 +119,7 @@ impl ObjectImpl for FileSink {
} }
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("location") vec![glib::ParamSpecString::builder("location")
.nick("File Location") .nick("File Location")
.blurb("Location of the file to write") .blurb("Location of the file to write")
@ -172,7 +172,7 @@ impl GstObjectImpl for FileSink {}
impl ElementImpl for FileSink { impl ElementImpl for FileSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"File Sink", "File Sink",
"Sink/File", "Sink/File",
@ -185,7 +185,7 @@ impl ElementImpl for FileSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -54,8 +54,8 @@ pub struct FileSrc {
state: Mutex<State>, state: Mutex<State>,
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"rsfilesrc", "rsfilesrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -126,7 +126,7 @@ impl ObjectSubclass for FileSrc {
impl ObjectImpl for FileSrc { impl ObjectImpl for FileSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("location") vec![glib::ParamSpecString::builder("location")
.nick("File Location") .nick("File Location")
.blurb("Location of the file to read from") .blurb("Location of the file to read from")
@ -186,7 +186,7 @@ impl GstObjectImpl for FileSrc {}
impl ElementImpl for FileSrc { impl ElementImpl for FileSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"File Source", "File Source",
"Source/File", "Source/File",
@ -199,7 +199,7 @@ impl ElementImpl for FileSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -12,7 +12,6 @@ rust-version.workspace = true
anyhow = "1" anyhow = "1"
gst = { workspace = true, features = ["v1_18"] } gst = { workspace = true, features = ["v1_18"] }
gst-video = { workspace = true, features = ["v1_18"] } gst-video = { workspace = true, features = ["v1_18"] }
once_cell.workspace = true
[lib] [lib]
name = "gstgopbuffer" name = "gstgopbuffer"

View file

@ -32,9 +32,9 @@ use gst::subclass::prelude::*;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"gopbuffer", "gopbuffer",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -662,7 +662,7 @@ impl ObjectSubclass for GopBuffer {
impl ObjectImpl for GopBuffer { impl ObjectImpl for GopBuffer {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecUInt64::builder("minimum-duration") glib::ParamSpecUInt64::builder("minimum-duration")
.nick("Minimum Duration") .nick("Minimum Duration")
@ -804,7 +804,7 @@ impl GstObjectImpl for GopBuffer {}
impl ElementImpl for GopBuffer { impl ElementImpl for GopBuffer {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"GopBuffer", "GopBuffer",
"Video", "Video",
@ -817,7 +817,7 @@ impl ElementImpl for GopBuffer {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
// This element is designed to implement multiple streams but it has not been // This element is designed to implement multiple streams but it has not been
// implemented. // implemented.
// //

View file

@ -13,7 +13,6 @@ anyhow = "1"
gst = { workspace = true, features = ["v1_18"] } gst = { workspace = true, features = ["v1_18"] }
gst-utils.workspace = true gst-utils.workspace = true
gst-app.workspace = true gst-app.workspace = true
once_cell = "1.0"
[dev-dependencies] [dev-dependencies]
pretty_assertions = "1" pretty_assertions = "1"

View file

@ -8,7 +8,7 @@ use gst::subclass::prelude::*;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
const DEFAULT_PRODUCER_NAME: &str = "default"; const DEFAULT_PRODUCER_NAME: &str = "default";
@ -52,7 +52,7 @@ impl InterSink {
} }
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"intersink", "intersink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -82,7 +82,7 @@ impl ObjectSubclass for InterSink {
impl ObjectImpl for InterSink { impl ObjectImpl for InterSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("producer-name") vec![glib::ParamSpecString::builder("producer-name")
.nick("Producer Name") .nick("Producer Name")
.blurb("Producer Name to use") .blurb("Producer Name to use")
@ -158,7 +158,7 @@ impl GstObjectImpl for InterSink {}
impl ElementImpl for InterSink { impl ElementImpl for InterSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Inter Sink", "Inter Sink",
"Generic/Sink", "Generic/Sink",
@ -171,7 +171,7 @@ impl ElementImpl for InterSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -8,7 +8,7 @@ use gst::subclass::prelude::*;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
const DEFAULT_PRODUCER_NAME: &str = "default"; const DEFAULT_PRODUCER_NAME: &str = "default";
@ -54,7 +54,7 @@ impl InterSrc {
} }
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new("intersrc", gst::DebugColorFlags::empty(), Some("Inter Src")) gst::DebugCategory::new("intersrc", gst::DebugColorFlags::empty(), Some("Inter Src"))
}); });
@ -81,7 +81,7 @@ impl ObjectSubclass for InterSrc {
impl ObjectImpl for InterSrc { impl ObjectImpl for InterSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("producer-name") vec![glib::ParamSpecString::builder("producer-name")
.nick("Producer Name") .nick("Producer Name")
.blurb("Producer Name to consume from") .blurb("Producer Name to consume from")
@ -144,7 +144,7 @@ impl GstObjectImpl for InterSrc {}
impl ElementImpl for InterSrc { impl ElementImpl for InterSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Inter Src", "Inter Src",
"Generic/Src", "Generic/Src",
@ -157,7 +157,7 @@ impl ElementImpl for InterSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(

View file

@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
use std::sync::Mutex; use std::sync::Mutex;
use anyhow::{anyhow, Error}; use anyhow::{anyhow, Error};
use once_cell::sync::Lazy; use std::sync::LazyLock;
pub enum InterStreamProducer { pub enum InterStreamProducer {
Pending { Pending {
@ -15,8 +15,8 @@ pub enum InterStreamProducer {
}, },
} }
static PRODUCERS: Lazy<Mutex<HashMap<String, InterStreamProducer>>> = static PRODUCERS: LazyLock<Mutex<HashMap<String, InterStreamProducer>>> =
Lazy::new(|| Mutex::new(HashMap::new())); LazyLock::new(|| Mutex::new(HashMap::new()));
fn toplevel(obj: &gst::Object) -> gst::Object { fn toplevel(obj: &gst::Object) -> gst::Object {
if let Some(parent) = obj.parent() { if let Some(parent) = obj.parent() {

View file

@ -13,7 +13,6 @@ glib.workspace = true
gst.workspace = true gst.workspace = true
gst-video.workspace = true gst-video.workspace = true
atomic_refcell = "0.1" atomic_refcell = "0.1"
once_cell.workspace = true
[lib] [lib]
name = "gstoriginalbuffer" name = "gstoriginalbuffer"

View file

@ -71,9 +71,9 @@ impl fmt::Debug for OriginalBufferMeta {
mod imp { mod imp {
use gst::glib::translate::*; use gst::glib::translate::*;
use once_cell::sync::Lazy;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::sync::LazyLock;
pub(super) struct OriginalBufferMetaParams { pub(super) struct OriginalBufferMetaParams {
pub original: gst::Buffer, pub original: gst::Buffer,
@ -88,7 +88,7 @@ mod imp {
} }
pub(super) fn original_buffer_meta_api_get_type() -> glib::Type { pub(super) fn original_buffer_meta_api_get_type() -> glib::Type {
static TYPE: Lazy<glib::Type> = Lazy::new(|| unsafe { static TYPE: LazyLock<glib::Type> = LazyLock::new(|| unsafe {
let t = from_glib(gst::ffi::gst_meta_api_type_register( let t = from_glib(gst::ffi::gst_meta_api_type_register(
b"GstOriginalBufferMetaAPI\0".as_ptr() as *const _, b"GstOriginalBufferMetaAPI\0".as_ptr() as *const _,
[ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _, [ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _,
@ -157,7 +157,7 @@ mod imp {
unsafe impl Send for MetaInfo {} unsafe impl Send for MetaInfo {}
unsafe impl Sync for MetaInfo {} unsafe impl Sync for MetaInfo {}
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe { static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
MetaInfo( MetaInfo(
ptr::NonNull::new(gst::ffi::gst_meta_register( ptr::NonNull::new(gst::ffi::gst_meta_register(
original_buffer_meta_api_get_type().into_glib(), original_buffer_meta_api_get_type().into_glib(),

View file

@ -43,9 +43,9 @@ pub struct OriginalBufferRestore {
sink_pad: gst::Pad, sink_pad: gst::Pad,
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
#[allow(dead_code)] #[allow(dead_code)]
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"originalbufferrestore", "originalbufferrestore",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -119,7 +119,7 @@ impl GstObjectImpl for OriginalBufferRestore {}
impl ElementImpl for OriginalBufferRestore { impl ElementImpl for OriginalBufferRestore {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Original Buffer Restore", "Original Buffer Restore",
"Generic", "Generic",
@ -132,7 +132,7 @@ impl ElementImpl for OriginalBufferRestore {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -18,9 +18,9 @@ pub struct OriginalBufferSave {
sink_pad: gst::Pad, sink_pad: gst::Pad,
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
#[allow(dead_code)] #[allow(dead_code)]
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"originalbuffersave", "originalbuffersave",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -84,7 +84,7 @@ impl GstObjectImpl for OriginalBufferSave {}
impl ElementImpl for OriginalBufferSave { impl ElementImpl for OriginalBufferSave {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Original Buffer Save", "Original Buffer Save",
"Generic", "Generic",
@ -97,7 +97,7 @@ impl ElementImpl for OriginalBufferSave {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -12,7 +12,6 @@ rust-version.workspace = true
gst.workspace = true gst.workspace = true
gst-base.workspace = true gst-base.workspace = true
sodiumoxide = "0.2.1" sodiumoxide = "0.2.1"
once_cell = "1.3.0"
hex = "0.4" hex = "0.4"
smallvec = "1.0" smallvec = "1.0"

View file

@ -29,8 +29,8 @@ use sodiumoxide::crypto::box_;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"sodiumdecrypter", "sodiumdecrypter",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -581,7 +581,7 @@ impl ObjectSubclass for Decrypter {
impl ObjectImpl for Decrypter { impl ObjectImpl for Decrypter {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecBoxed::builder::<glib::Bytes>("receiver-key") glib::ParamSpecBoxed::builder::<glib::Bytes>("receiver-key")
.nick("Receiver Key") .nick("Receiver Key")
@ -638,7 +638,7 @@ impl GstObjectImpl for Decrypter {}
impl ElementImpl for Decrypter { impl ElementImpl for Decrypter {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Decrypter", "Decrypter",
"Generic", "Generic",
@ -651,7 +651,7 @@ impl ElementImpl for Decrypter {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,

View file

@ -32,8 +32,8 @@ type BufferVec = SmallVec<[gst::Buffer; 16]>;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"sodiumencrypter", "sodiumencrypter",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -377,7 +377,7 @@ impl ObjectSubclass for Encrypter {
impl ObjectImpl for Encrypter { impl ObjectImpl for Encrypter {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecBoxed::builder::<glib::Bytes>("receiver-key") glib::ParamSpecBoxed::builder::<glib::Bytes>("receiver-key")
.nick("Receiver Key") .nick("Receiver Key")
@ -450,7 +450,7 @@ impl GstObjectImpl for Encrypter {}
impl ElementImpl for Encrypter { impl ElementImpl for Encrypter {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Encrypter", "Encrypter",
"Generic", "Generic",
@ -463,7 +463,7 @@ impl ElementImpl for Encrypter {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_caps = gst::Caps::builder("application/x-sodium-encrypted").build(); let src_caps = gst::Caps::builder("application/x-sodium-encrypted").build();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -31,15 +31,15 @@ use std::path::PathBuf;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static SENDER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| { static SENDER_PUBLIC: LazyLock<glib::Bytes> = LazyLock::new(|| {
let public = [ let public = [
66, 248, 199, 74, 216, 55, 228, 116, 52, 17, 147, 56, 65, 130, 134, 148, 157, 153, 235, 66, 248, 199, 74, 216, 55, 228, 116, 52, 17, 147, 56, 65, 130, 134, 148, 157, 153, 235,
171, 179, 147, 120, 71, 100, 243, 133, 120, 160, 14, 111, 65, 171, 179, 147, 120, 71, 100, 243, 133, 120, 160, 14, 111, 65,
]; ];
glib::Bytes::from_owned(public) glib::Bytes::from_owned(public)
}); });
static RECEIVER_PRIVATE: Lazy<glib::Bytes> = Lazy::new(|| { static RECEIVER_PRIVATE: LazyLock<glib::Bytes> = LazyLock::new(|| {
let secret = [ let secret = [
54, 221, 217, 54, 94, 235, 167, 2, 187, 249, 71, 31, 59, 27, 19, 166, 78, 236, 102, 48, 29, 54, 221, 217, 54, 94, 235, 167, 2, 187, 249, 71, 31, 59, 27, 19, 166, 78, 236, 102, 48, 29,
142, 41, 189, 22, 146, 218, 69, 147, 165, 240, 235, 142, 41, 189, 22, 146, 218, 69, 147, 165, 240, 235,

View file

@ -25,11 +25,11 @@
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
static RECEIVER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| { static RECEIVER_PUBLIC: LazyLock<glib::Bytes> = LazyLock::new(|| {
let public = [ let public = [
28, 95, 33, 124, 28, 103, 80, 78, 7, 28, 234, 40, 226, 179, 253, 166, 169, 64, 78, 5, 57, 28, 95, 33, 124, 28, 103, 80, 78, 7, 28, 234, 40, 226, 179, 253, 166, 169, 64, 78, 5, 57,
92, 151, 179, 221, 89, 68, 70, 44, 225, 219, 19, 92, 151, 179, 221, 89, 68, 70, 44, 225, 219, 19,
@ -37,14 +37,14 @@ static RECEIVER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| {
glib::Bytes::from_owned(public) glib::Bytes::from_owned(public)
}); });
static SENDER_PRIVATE: Lazy<glib::Bytes> = Lazy::new(|| { static SENDER_PRIVATE: LazyLock<glib::Bytes> = LazyLock::new(|| {
let secret = [ let secret = [
154, 227, 90, 239, 206, 184, 202, 234, 176, 161, 14, 91, 218, 98, 142, 13, 145, 223, 210, 154, 227, 90, 239, 206, 184, 202, 234, 176, 161, 14, 91, 218, 98, 142, 13, 145, 223, 210,
222, 224, 240, 98, 51, 142, 165, 255, 1, 159, 100, 242, 162, 222, 224, 240, 98, 51, 142, 165, 255, 1, 159, 100, 242, 162,
]; ];
glib::Bytes::from_owned(secret) glib::Bytes::from_owned(secret)
}); });
static NONCE: Lazy<glib::Bytes> = Lazy::new(|| { static NONCE: LazyLock<glib::Bytes> = LazyLock::new(|| {
let nonce = [ let nonce = [
144, 187, 179, 230, 15, 4, 241, 15, 37, 133, 22, 30, 50, 106, 70, 159, 243, 218, 173, 22, 144, 187, 179, 230, 15, 4, 241, 15, 37, 133, 22, 30, 50, 106, 70, 159, 243, 218, 173, 22,
18, 36, 4, 45, 18, 36, 4, 45,

View file

@ -19,7 +19,6 @@ gst.workspace = true
gst-audio.workspace = true gst-audio.workspace = true
gst-net.workspace = true gst-net.workspace = true
gst-rtp.workspace = true gst-rtp.workspace = true
once_cell.workspace = true
pin-project-lite = "0.2.0" pin-project-lite = "0.2.0"
polling = "3.1.0" polling = "3.1.0"
rand = "0.8" rand = "0.8"

View file

@ -19,7 +19,7 @@
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::env; use std::env;
use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::atomic::{AtomicU64, Ordering};
@ -29,7 +29,7 @@ use std::time::{Duration, Instant};
const THROUGHPUT_PERIOD: Duration = Duration::from_secs(20); const THROUGHPUT_PERIOD: Duration = Duration::from_secs(20);
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-benchmark", "ts-benchmark",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -1,5 +1,5 @@
use gst::glib; use gst::glib;
use once_cell::sync::Lazy; use std::sync::LazyLock;
mod args; mod args;
use args::*; use args::*;
@ -13,7 +13,7 @@ mod src;
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::Arc; use std::sync::Arc;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-standalone-main", "ts-standalone-main",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -14,7 +14,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst::EventView; use gst::EventView;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use gstthreadshare::runtime::executor::block_on_or_add_sub_task; use gstthreadshare::runtime::executor::block_on_or_add_sub_task;
use gstthreadshare::runtime::{prelude::*, PadSink}; use gstthreadshare::runtime::{prelude::*, PadSink};
@ -257,7 +257,7 @@ impl ObjectSubclass for AsyncMutexSink {
impl ObjectImpl for AsyncMutexSink { impl ObjectImpl for AsyncMutexSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(Settings::properties); static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(Settings::properties);
PROPERTIES.as_ref() PROPERTIES.as_ref()
} }
@ -282,7 +282,7 @@ impl GstObjectImpl for AsyncMutexSink {}
impl ElementImpl for AsyncMutexSink { impl ElementImpl for AsyncMutexSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing standalone test async mutex sink", "Thread-sharing standalone test async mutex sink",
"Sink/Test", "Sink/Test",
@ -295,7 +295,7 @@ impl ElementImpl for AsyncMutexSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -12,8 +12,8 @@ pub const ASYNC_MUTEX_ELEMENT_NAME: &str = "ts-standalone-async-mutex-sink";
pub const SYNC_MUTEX_ELEMENT_NAME: &str = "ts-standalone-sync-mutex-sink"; pub const SYNC_MUTEX_ELEMENT_NAME: &str = "ts-standalone-sync-mutex-sink";
pub const TASK_ELEMENT_NAME: &str = "ts-standalone-task-sink"; pub const TASK_ELEMENT_NAME: &str = "ts-standalone-task-sink";
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-standalone-sink", "ts-standalone-sink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -14,7 +14,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst::EventView; use gst::EventView;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use gstthreadshare::runtime::{prelude::*, PadSink}; use gstthreadshare::runtime::{prelude::*, PadSink};
@ -250,7 +250,7 @@ impl ObjectSubclass for DirectSink {
impl ObjectImpl for DirectSink { impl ObjectImpl for DirectSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(Settings::properties); static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(Settings::properties);
PROPERTIES.as_ref() PROPERTIES.as_ref()
} }
@ -275,7 +275,7 @@ impl GstObjectImpl for DirectSink {}
impl ElementImpl for DirectSink { impl ElementImpl for DirectSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing standalone test direct sink", "Thread-sharing standalone test direct sink",
"Sink/Test", "Sink/Test",
@ -288,7 +288,7 @@ impl ElementImpl for DirectSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -15,7 +15,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst::EventView; use gst::EventView;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use gstthreadshare::runtime::prelude::*; use gstthreadshare::runtime::prelude::*;
use gstthreadshare::runtime::{Context, PadSink, Task}; use gstthreadshare::runtime::{Context, PadSink, Task};
@ -317,7 +317,7 @@ impl ObjectSubclass for TaskSink {
impl ObjectImpl for TaskSink { impl ObjectImpl for TaskSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(Settings::properties); static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(Settings::properties);
PROPERTIES.as_ref() PROPERTIES.as_ref()
} }
@ -342,7 +342,7 @@ impl GstObjectImpl for TaskSink {}
impl ElementImpl for TaskSink { impl ElementImpl for TaskSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing standalone test task sink", "Thread-sharing standalone test task sink",
"Sink/Test", "Sink/Test",
@ -355,7 +355,7 @@ impl ElementImpl for TaskSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -13,7 +13,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
@ -21,7 +21,7 @@ use std::time::Duration;
use gstthreadshare::runtime::prelude::*; use gstthreadshare::runtime::prelude::*;
use gstthreadshare::runtime::{task, timer, Context, PadSrc, Task}; use gstthreadshare::runtime::{task, timer, Context, PadSrc, Task};
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
super::ELEMENT_NAME, super::ELEMENT_NAME,
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -338,7 +338,7 @@ impl ObjectSubclass for TestSrc {
impl ObjectImpl for TestSrc { impl ObjectImpl for TestSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -429,7 +429,7 @@ impl GstObjectImpl for TestSrc {}
impl ElementImpl for TestSrc { impl ElementImpl for TestSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing standalone test source", "Thread-sharing standalone test source",
"Source/Test", "Source/Test",
@ -442,7 +442,7 @@ impl ElementImpl for TestSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -20,13 +20,13 @@
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::net; use std::net;
use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::{env, thread, time}; use std::{env, thread, time};
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-udpsrc-benchmark-sender", "ts-udpsrc-benchmark-sender",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -26,7 +26,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
@ -61,7 +61,7 @@ impl Default for Settings {
} }
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-appsrc", "ts-appsrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -444,7 +444,7 @@ impl ObjectSubclass for AppSrc {
impl ObjectImpl for AppSrc { impl ObjectImpl for AppSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -479,7 +479,7 @@ impl ObjectImpl for AppSrc {
} }
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder("push-buffer") glib::subclass::Signal::builder("push-buffer")
.param_types([gst::Buffer::static_type()]) .param_types([gst::Buffer::static_type()])
@ -565,7 +565,7 @@ impl GstObjectImpl for AppSrc {}
impl ElementImpl for AppSrc { impl ElementImpl for AppSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing app source", "Thread-sharing app source",
"Source/Generic", "Source/Generic",
@ -578,7 +578,7 @@ impl ElementImpl for AppSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -13,7 +13,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::mem::size_of; use std::mem::size_of;
use std::sync::Mutex; use std::sync::Mutex;
@ -24,7 +24,7 @@ use std::time::Instant;
use crate::runtime::prelude::*; use crate::runtime::prelude::*;
use crate::runtime::{self, task, timer, PadSrc, Task}; use crate::runtime::{self, task, timer, PadSrc, Task};
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-audiotestsrc", "ts-audiotestsrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -49,7 +49,7 @@ const RAMPUP_BUFFER_COUNT: u32 = 500;
#[cfg(feature = "tuning")] #[cfg(feature = "tuning")]
const LOG_BUFFER_INTERVAL: u32 = 2000; const LOG_BUFFER_INTERVAL: u32 = 2000;
static DEFAULT_CAPS: Lazy<gst::Caps> = Lazy::new(|| { static DEFAULT_CAPS: LazyLock<gst::Caps> = LazyLock::new(|| {
gst_audio::AudioCapsBuilder::new_interleaved() gst_audio::AudioCapsBuilder::new_interleaved()
.format(gst_audio::AUDIO_FORMAT_S16) .format(gst_audio::AUDIO_FORMAT_S16)
.rate_range(8_000..i32::MAX) .rate_range(8_000..i32::MAX)
@ -554,7 +554,7 @@ impl ObjectSubclass for AudioTestSrc {
impl ObjectImpl for AudioTestSrc { impl ObjectImpl for AudioTestSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -663,7 +663,7 @@ impl GstObjectImpl for AudioTestSrc {}
impl ElementImpl for AudioTestSrc { impl ElementImpl for AudioTestSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing audio test source", "Thread-sharing audio test source",
"Source/Test", "Source/Test",
@ -676,7 +676,7 @@ impl ElementImpl for AudioTestSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,

View file

@ -21,13 +21,13 @@ use futures::future::{self, abortable, AbortHandle};
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::sync::Arc; use std::sync::Arc;
use std::sync::Mutex as StdMutex; use std::sync::Mutex as StdMutex;
static DATA_QUEUE_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static DATA_QUEUE_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-dataqueue", "ts-dataqueue",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -25,7 +25,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -328,7 +328,7 @@ pub struct InputSelector {
pads: Mutex<Pads>, pads: Mutex<Pads>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-input-selector", "ts-input-selector",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -366,7 +366,7 @@ impl ObjectSubclass for InputSelector {
impl ObjectImpl for InputSelector { impl ObjectImpl for InputSelector {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -474,7 +474,7 @@ impl GstObjectImpl for InputSelector {}
impl ElementImpl for InputSelector { impl ElementImpl for InputSelector {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing input selector", "Thread-sharing input selector",
"Generic", "Generic",
@ -487,7 +487,7 @@ impl ElementImpl for InputSelector {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink_%u", "sink_%u",

View file

@ -26,7 +26,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst_rtp::RTPBuffer; use gst_rtp::RTPBuffer;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::collections::{BTreeSet, VecDeque}; use std::collections::{BTreeSet, VecDeque};
@ -1243,7 +1243,7 @@ pub struct JitterBuffer {
settings: StdMutex<Settings>, settings: StdMutex<Settings>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-jitterbuffer", "ts-jitterbuffer",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -1331,7 +1331,7 @@ impl ObjectSubclass for JitterBuffer {
impl ObjectImpl for JitterBuffer { impl ObjectImpl for JitterBuffer {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -1376,7 +1376,7 @@ impl ObjectImpl for JitterBuffer {
} }
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder("clear-pt-map") glib::subclass::Signal::builder("clear-pt-map")
.action() .action()
@ -1497,7 +1497,7 @@ impl GstObjectImpl for JitterBuffer {}
impl ElementImpl for JitterBuffer { impl ElementImpl for JitterBuffer {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing jitterbuffer", "Thread-sharing jitterbuffer",
"Generic", "Generic",
@ -1510,7 +1510,7 @@ impl ElementImpl for JitterBuffer {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -25,7 +25,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::collections::{HashMap, VecDeque}; use std::collections::{HashMap, VecDeque};
use std::sync::{Arc, Weak}; use std::sync::{Arc, Weak};
@ -37,12 +37,12 @@ use crate::runtime::{Context, PadSink, PadSinkWeak, PadSrc, PadSrcWeak, Task};
use crate::dataqueue::{DataQueue, DataQueueItem}; use crate::dataqueue::{DataQueue, DataQueueItem};
static PROXY_CONTEXTS: Lazy<Mutex<HashMap<String, Weak<Mutex<ProxyContextInner>>>>> = static PROXY_CONTEXTS: LazyLock<Mutex<HashMap<String, Weak<Mutex<ProxyContextInner>>>>> =
Lazy::new(|| Mutex::new(HashMap::new())); LazyLock::new(|| Mutex::new(HashMap::new()));
static PROXY_SRC_PADS: Lazy<Mutex<HashMap<String, PadSrcWeak>>> = static PROXY_SRC_PADS: LazyLock<Mutex<HashMap<String, PadSrcWeak>>> =
Lazy::new(|| Mutex::new(HashMap::new())); LazyLock::new(|| Mutex::new(HashMap::new()));
static PROXY_SINK_PADS: Lazy<Mutex<HashMap<String, PadSinkWeak>>> = static PROXY_SINK_PADS: LazyLock<Mutex<HashMap<String, PadSinkWeak>>> =
Lazy::new(|| Mutex::new(HashMap::new())); LazyLock::new(|| Mutex::new(HashMap::new()));
const DEFAULT_PROXY_CONTEXT: &str = ""; const DEFAULT_PROXY_CONTEXT: &str = "";
@ -304,7 +304,7 @@ pub struct ProxySink {
settings: Mutex<SettingsSink>, settings: Mutex<SettingsSink>,
} }
static SINK_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static SINK_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-proxysink", "ts-proxysink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -552,7 +552,7 @@ impl ObjectSubclass for ProxySink {
impl ObjectImpl for ProxySink { impl ObjectImpl for ProxySink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("proxy-context") vec![glib::ParamSpecString::builder("proxy-context")
.nick("Proxy Context") .nick("Proxy Context")
.blurb("Context name of the proxy to share with") .blurb("Context name of the proxy to share with")
@ -597,7 +597,7 @@ impl GstObjectImpl for ProxySink {}
impl ElementImpl for ProxySink { impl ElementImpl for ProxySink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing proxy sink", "Thread-sharing proxy sink",
"Sink/Generic", "Sink/Generic",
@ -610,7 +610,7 @@ impl ElementImpl for ProxySink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
@ -927,7 +927,7 @@ pub struct ProxySrc {
settings: Mutex<SettingsSrc>, settings: Mutex<SettingsSrc>,
} }
static SRC_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static SRC_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-proxysrc", "ts-proxysrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -1057,7 +1057,7 @@ impl ObjectSubclass for ProxySrc {
impl ObjectImpl for ProxySrc { impl ObjectImpl for ProxySrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -1156,7 +1156,7 @@ impl GstObjectImpl for ProxySrc {}
impl ElementImpl for ProxySrc { impl ElementImpl for ProxySrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing proxy source", "Thread-sharing proxy source",
"Source/Generic", "Source/Generic",
@ -1169,7 +1169,7 @@ impl ElementImpl for ProxySrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(

View file

@ -25,7 +25,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::sync::Mutex; use std::sync::Mutex;
@ -396,7 +396,7 @@ pub struct Queue {
settings: Mutex<Settings>, settings: Mutex<Settings>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-queue", "ts-queue",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -648,7 +648,7 @@ impl ObjectSubclass for Queue {
impl ObjectImpl for Queue { impl ObjectImpl for Queue {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -735,7 +735,7 @@ impl GstObjectImpl for Queue {}
impl ElementImpl for Queue { impl ElementImpl for Queue {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing queue", "Thread-sharing queue",
"Generic", "Generic",
@ -748,7 +748,7 @@ impl ElementImpl for Queue {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -5,7 +5,7 @@
use futures::prelude::*; use futures::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::collections::HashMap; use std::collections::HashMap;
use std::io; use std::io;
@ -27,8 +27,8 @@ use crate::runtime::RUNTIME_CAT;
// //
// Also, we want to be able to `acquire` a `Context` outside of an `async` context. // Also, we want to be able to `acquire` a `Context` outside of an `async` context.
// These `Mutex`es must be `lock`ed for a short period. // These `Mutex`es must be `lock`ed for a short period.
static CONTEXTS: Lazy<Mutex<HashMap<Arc<str>, ContextWeak>>> = static CONTEXTS: LazyLock<Mutex<HashMap<Arc<str>, ContextWeak>>> =
Lazy::new(|| Mutex::new(HashMap::new())); LazyLock::new(|| Mutex::new(HashMap::new()));
/// Blocks on `future` in one way or another if possible. /// Blocks on `future` in one way or another if possible.
/// ///

View file

@ -44,9 +44,9 @@ pub mod prelude {
pub use super::task::TaskImpl; pub use super::task::TaskImpl;
} }
use once_cell::sync::Lazy; use std::sync::LazyLock;
static RUNTIME_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static RUNTIME_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-runtime", "ts-runtime",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -23,7 +23,7 @@ use futures::future::BoxFuture;
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::error; use std::error;
use std::fmt; use std::fmt;
@ -41,7 +41,7 @@ use std::os::{
#[cfg(windows)] #[cfg(windows)]
use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}; use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket};
static SOCKET_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static SOCKET_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-socket", "ts-socket",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -25,7 +25,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::io; use std::io;
use std::net::{IpAddr, SocketAddr, TcpStream}; use std::net::{IpAddr, SocketAddr, TcpStream};
@ -453,7 +453,7 @@ pub struct TcpClientSrc {
state: Mutex<State>, state: Mutex<State>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-tcpclientsrc", "ts-tcpclientsrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -584,7 +584,7 @@ impl ObjectSubclass for TcpClientSrc {
impl ObjectImpl for TcpClientSrc { impl ObjectImpl for TcpClientSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -680,7 +680,7 @@ impl GstObjectImpl for TcpClientSrc {}
impl ElementImpl for TcpClientSrc { impl ElementImpl for TcpClientSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing TCP client source", "Thread-sharing TCP client source",
"Source/Network", "Source/Network",
@ -693,7 +693,7 @@ impl ElementImpl for TcpClientSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -26,7 +26,7 @@ use gst::subclass::prelude::*;
use gst::EventView; use gst::EventView;
use gst::{element_error, error_msg}; use gst::{element_error, error_msg};
use once_cell::sync::Lazy; use std::sync::LazyLock;
use crate::runtime::executor::block_on_or_add_sub_task; use crate::runtime::executor::block_on_or_add_sub_task;
use crate::runtime::prelude::*; use crate::runtime::prelude::*;
@ -114,7 +114,7 @@ impl Default for Settings {
} }
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-udpsink", "ts-udpsink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -858,7 +858,7 @@ impl ObjectSubclass for UdpSink {
impl ObjectImpl for UdpSink { impl ObjectImpl for UdpSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -959,7 +959,7 @@ impl ObjectImpl for UdpSink {
} }
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder("add") glib::subclass::Signal::builder("add")
.param_types([String::static_type(), i32::static_type()]) .param_types([String::static_type(), i32::static_type()])
@ -1181,7 +1181,7 @@ impl GstObjectImpl for UdpSink {}
impl ElementImpl for UdpSink { impl ElementImpl for UdpSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing UDP sink", "Thread-sharing UDP sink",
"Sink/Network", "Sink/Network",
@ -1194,7 +1194,7 @@ impl ElementImpl for UdpSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(

View file

@ -25,7 +25,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst_net::*; use gst_net::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::io; use std::io;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket};
@ -677,7 +677,7 @@ pub struct UdpSrc {
state: Mutex<State>, state: Mutex<State>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-udpsrc", "ts-udpsrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -769,7 +769,7 @@ impl ObjectSubclass for UdpSrc {
impl ObjectImpl for UdpSrc { impl ObjectImpl for UdpSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
let mut properties = vec![ let mut properties = vec![
glib::ParamSpecString::builder("context") glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
@ -942,7 +942,7 @@ impl GstObjectImpl for UdpSrc {}
impl ElementImpl for UdpSrc { impl ElementImpl for UdpSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Thread-sharing UDP source", "Thread-sharing UDP source",
"Source/Network", "Source/Network",
@ -955,7 +955,7 @@ impl ElementImpl for UdpSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -21,9 +21,9 @@ use gst::prelude::*;
use std::sync::mpsc; use std::sync::mpsc;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-test", "ts-test",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -29,7 +29,7 @@ use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst::EventView; use gst::EventView;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex; use std::sync::Mutex;
@ -73,7 +73,7 @@ mod imp_src {
context: String, context: String,
} }
pub static SRC_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { pub static SRC_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-element-src-test", "ts-element-src-test",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -294,7 +294,7 @@ mod imp_src {
impl ObjectImpl for ElementSrcTest { impl ObjectImpl for ElementSrcTest {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("context") vec![glib::ParamSpecString::builder("context")
.nick("Context") .nick("Context")
.blurb("Context name to share threads with") .blurb("Context name to share threads with")
@ -333,20 +333,21 @@ mod imp_src {
impl ElementImpl for ElementSrcTest { impl ElementImpl for ElementSrcTest {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> =
gst::subclass::ElementMetadata::new( LazyLock::new(|| {
"Thread-sharing Test Src Element", gst::subclass::ElementMetadata::new(
"Generic", "Thread-sharing Test Src Element",
"Src Element for Pad Src Test", "Generic",
"François Laignel <fengalin@free.fr>", "Src Element for Pad Src Test",
) "François Laignel <fengalin@free.fr>",
}); )
});
Some(&*ELEMENT_METADATA) Some(&*ELEMENT_METADATA)
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
@ -558,7 +559,7 @@ mod imp_sink {
} }
} }
static SINK_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static SINK_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-element-sink-test", "ts-element-sink-test",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -586,7 +587,7 @@ mod imp_sink {
impl ObjectImpl for ElementSinkTest { impl ObjectImpl for ElementSinkTest {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecBoxed::builder::<ItemSender>("sender") vec![glib::ParamSpecBoxed::builder::<ItemSender>("sender")
.nick("Sender") .nick("Sender")
.blurb("Channel sender to forward the incoming items to") .blurb("Channel sender to forward the incoming items to")
@ -624,20 +625,21 @@ mod imp_sink {
impl ElementImpl for ElementSinkTest { impl ElementImpl for ElementSinkTest {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> =
gst::subclass::ElementMetadata::new( LazyLock::new(|| {
"Thread-sharing Test Sink Element", gst::subclass::ElementMetadata::new(
"Generic", "Thread-sharing Test Sink Element",
"Sink Element for Pad Test", "Generic",
"François Laignel <fengalin@free.fr>", "Sink Element for Pad Test",
) "François Laignel <fengalin@free.fr>",
}); )
});
Some(&*ELEMENT_METADATA) Some(&*ELEMENT_METADATA)
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -20,11 +20,11 @@
use gst::glib; use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::mpsc; use std::sync::mpsc;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ts-test", "ts-test",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -17,7 +17,6 @@ nom = "7"
flavors = { git = "https://github.com/rust-av/flavors" } flavors = { git = "https://github.com/rust-av/flavors" }
byteorder = "1.0" byteorder = "1.0"
smallvec = "1.0" smallvec = "1.0"
once_cell.workspace = true
[lib] [lib]
name = "gstrsflv" name = "gstrsflv"

View file

@ -21,11 +21,11 @@ use gst::subclass::prelude::*;
use num_rational::Rational32; use num_rational::Rational32;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use smallvec::SmallVec; use smallvec::SmallVec;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"rsflvdemux", "rsflvdemux",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -191,7 +191,7 @@ impl GstObjectImpl for FlvDemux {}
impl ElementImpl for FlvDemux { impl ElementImpl for FlvDemux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"FLV Demuxer", "FLV Demuxer",
"Codec/Demuxer", "Codec/Demuxer",
@ -204,7 +204,7 @@ impl ElementImpl for FlvDemux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let mut caps = gst::Caps::new_empty(); let mut caps = gst::Caps::new_empty();
{ {
let caps = caps.get_mut().unwrap(); let caps = caps.get_mut().unwrap();

View file

@ -15,7 +15,6 @@ gst-base = { workspace = true, features = ["v1_18"] }
gst-audio = { workspace = true, features = ["v1_18"] } gst-audio = { workspace = true, features = ["v1_18"] }
gst-video = { workspace = true, features = ["v1_18"] } gst-video = { workspace = true, features = ["v1_18"] }
gst-pbutils = { workspace = true, features = ["v1_20"] } gst-pbutils = { workspace = true, features = ["v1_20"] }
once_cell.workspace = true
bitstream-io = "2.3" bitstream-io = "2.3"
[lib] [lib]

View file

@ -21,7 +21,7 @@ use std::sync::Mutex;
use crate::fmp4mux::obu::read_seq_header_obu_bytes; use crate::fmp4mux::obu::read_seq_header_obu_bytes;
use crate::fmp4mux::ImageOrientation; use crate::fmp4mux::ImageOrientation;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use super::boxes; use super::boxes;
use super::Buffer; use super::Buffer;
@ -40,10 +40,12 @@ const UNIX_1601_OFFSET: u64 = 11_644_473_600;
const NTP_UNIX_OFFSET: u64 = 2_208_988_800; const NTP_UNIX_OFFSET: u64 = 2_208_988_800;
/// Reference timestamp meta caps for NTP timestamps. /// Reference timestamp meta caps for NTP timestamps.
static NTP_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-ntp").build()); static NTP_CAPS: LazyLock<gst::Caps> =
LazyLock::new(|| gst::Caps::builder("timestamp/x-ntp").build());
/// Reference timestamp meta caps for UNIX timestamps. /// Reference timestamp meta caps for UNIX timestamps.
static UNIX_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-unix").build()); static UNIX_CAPS: LazyLock<gst::Caps> =
LazyLock::new(|| gst::Caps::builder("timestamp/x-unix").build());
/// Returns the UTC time of the buffer in the UNIX epoch. /// Returns the UTC time of the buffer in the UNIX epoch.
fn get_utc_time_from_buffer(buffer: &gst::BufferRef) -> Option<gst::ClockTime> { fn get_utc_time_from_buffer(buffer: &gst::BufferRef) -> Option<gst::ClockTime> {
@ -92,7 +94,7 @@ fn utc_time_to_running_time(
.and_then(|res| res.positive()) .and_then(|res| res.positive())
} }
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"fmp4mux", "fmp4mux",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -3254,7 +3256,7 @@ static FMP4_SIGNAL_SPLIT_AT_RUNNING_TIME: &str = "split-at-running-time";
impl ObjectImpl for FMP4Mux { impl ObjectImpl for FMP4Mux {
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder(FMP4_SIGNAL_SEND_HEADERS) glib::subclass::Signal::builder(FMP4_SIGNAL_SEND_HEADERS)
.action() .action()
@ -3298,7 +3300,7 @@ impl ObjectImpl for FMP4Mux {
} }
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecUInt64::builder("fragment-duration") glib::ParamSpecUInt64::builder("fragment-duration")
.nick("Fragment Duration") .nick("Fragment Duration")
@ -3971,7 +3973,7 @@ impl ObjectSubclass for ISOFMP4Mux {
impl ObjectImpl for ISOFMP4Mux { impl ObjectImpl for ISOFMP4Mux {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecBoolean::builder("offset-to-zero") vec![glib::ParamSpecBoolean::builder("offset-to-zero")
.nick("Offset to Zero") .nick("Offset to Zero")
.blurb("Offsets all streams so that the earliest stream starts at 0") .blurb("Offsets all streams so that the earliest stream starts at 0")
@ -4015,7 +4017,7 @@ impl GstObjectImpl for ISOFMP4Mux {}
impl ElementImpl for ISOFMP4Mux { impl ElementImpl for ISOFMP4Mux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"ISOFMP4Mux", "ISOFMP4Mux",
"Codec/Muxer", "Codec/Muxer",
@ -4028,7 +4030,7 @@ impl ElementImpl for ISOFMP4Mux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -4133,7 +4135,7 @@ impl GstObjectImpl for CMAFMux {}
impl ElementImpl for CMAFMux { impl ElementImpl for CMAFMux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"CMAFMux", "CMAFMux",
"Codec/Muxer", "Codec/Muxer",
@ -4146,7 +4148,7 @@ impl ElementImpl for CMAFMux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -4234,7 +4236,7 @@ impl GstObjectImpl for DASHMP4Mux {}
impl ElementImpl for DASHMP4Mux { impl ElementImpl for DASHMP4Mux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"DASHMP4Mux", "DASHMP4Mux",
"Codec/Muxer", "Codec/Muxer",
@ -4247,7 +4249,7 @@ impl ElementImpl for DASHMP4Mux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -4347,7 +4349,7 @@ impl GstObjectImpl for ONVIFFMP4Mux {}
impl ElementImpl for ONVIFFMP4Mux { impl ElementImpl for ONVIFFMP4Mux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"ONVIFFMP4Mux", "ONVIFFMP4Mux",
"Codec/Muxer", "Codec/Muxer",
@ -4360,7 +4362,7 @@ impl ElementImpl for ONVIFFMP4Mux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -4461,7 +4463,7 @@ impl ObjectSubclass for FMP4MuxPad {
impl ObjectImpl for FMP4MuxPad { impl ObjectImpl for FMP4MuxPad {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecUInt::builder("trak-timescale") vec![glib::ParamSpecUInt::builder("trak-timescale")
.nick("Track Timescale") .nick("Track Timescale")
.blurb("Timescale to use for the track (units per second, 0 is automatic)") .blurb("Timescale to use for the track (units per second, 0 is automatic)")

View file

@ -204,11 +204,11 @@ impl From<ObuType> for u8 {
mod tests { mod tests {
use super::*; use super::*;
use bitstream_io::{BigEndian, BitReader}; use bitstream_io::{BigEndian, BitReader};
use once_cell::sync::Lazy;
use std::io::Cursor; use std::io::Cursor;
use std::sync::LazyLock;
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
static OBUS: Lazy<Vec<(SizedObu, Vec<u8>)>> = Lazy::new(|| { static OBUS: LazyLock<Vec<(SizedObu, Vec<u8>)>> = LazyLock::new(|| {
vec![ vec![
( (
SizedObu { SizedObu {

View file

@ -15,7 +15,6 @@ gst-base = { workspace = true, features = ["v1_18"] }
gst-audio = { workspace = true, features = ["v1_18"] } gst-audio = { workspace = true, features = ["v1_18"] }
gst-video = { workspace = true, features = ["v1_18"] } gst-video = { workspace = true, features = ["v1_18"] }
gst-pbutils = { workspace = true, features = ["v1_18"] } gst-pbutils = { workspace = true, features = ["v1_18"] }
once_cell.workspace = true
bitstream-io = "2.3" bitstream-io = "2.3"
[lib] [lib]

View file

@ -17,7 +17,7 @@ use std::collections::VecDeque;
use std::sync::Mutex; use std::sync::Mutex;
use crate::mp4mux::obu::read_seq_header_obu_bytes; use crate::mp4mux::obu::read_seq_header_obu_bytes;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use super::{boxes, ImageOrientation}; use super::{boxes, ImageOrientation};
@ -26,10 +26,12 @@ use super::{boxes, ImageOrientation};
const NTP_UNIX_OFFSET: u64 = 2_208_988_800; const NTP_UNIX_OFFSET: u64 = 2_208_988_800;
/// Reference timestamp meta caps for NTP timestamps. /// Reference timestamp meta caps for NTP timestamps.
static NTP_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-ntp").build()); static NTP_CAPS: LazyLock<gst::Caps> =
LazyLock::new(|| gst::Caps::builder("timestamp/x-ntp").build());
/// Reference timestamp meta caps for UNIX timestamps. /// Reference timestamp meta caps for UNIX timestamps.
static UNIX_CAPS: Lazy<gst::Caps> = Lazy::new(|| gst::Caps::builder("timestamp/x-unix").build()); static UNIX_CAPS: LazyLock<gst::Caps> =
LazyLock::new(|| gst::Caps::builder("timestamp/x-unix").build());
/// Returns the UTC time of the buffer in the UNIX epoch. /// Returns the UTC time of the buffer in the UNIX epoch.
fn get_utc_time_from_buffer(buffer: &gst::BufferRef) -> Option<gst::ClockTime> { fn get_utc_time_from_buffer(buffer: &gst::BufferRef) -> Option<gst::ClockTime> {
@ -62,7 +64,7 @@ fn running_time_to_utc_time(
.and_then(|res| res.positive()) .and_then(|res| res.positive())
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"mp4mux", "mp4mux",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -1268,7 +1270,7 @@ impl ObjectSubclass for MP4Mux {
impl ObjectImpl for MP4Mux { impl ObjectImpl for MP4Mux {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecUInt64::builder("interleave-bytes") glib::ParamSpecUInt64::builder("interleave-bytes")
.nick("Interleave Bytes") .nick("Interleave Bytes")
@ -1805,7 +1807,7 @@ impl GstObjectImpl for ISOMP4Mux {}
impl ElementImpl for ISOMP4Mux { impl ElementImpl for ISOMP4Mux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"ISOMP4Mux", "ISOMP4Mux",
"Codec/Muxer", "Codec/Muxer",
@ -1818,7 +1820,7 @@ impl ElementImpl for ISOMP4Mux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -1923,7 +1925,7 @@ impl GstObjectImpl for ONVIFMP4Mux {}
impl ElementImpl for ONVIFMP4Mux { impl ElementImpl for ONVIFMP4Mux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"ONVIFMP4Mux", "ONVIFMP4Mux",
"Codec/Muxer", "Codec/Muxer",
@ -1936,7 +1938,7 @@ impl ElementImpl for ONVIFMP4Mux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,
@ -2030,7 +2032,7 @@ impl ObjectSubclass for MP4MuxPad {
impl ObjectImpl for MP4MuxPad { impl ObjectImpl for MP4MuxPad {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecUInt::builder("trak-timescale") vec![glib::ParamSpecUInt::builder("trak-timescale")
.nick("Track Timescale") .nick("Track Timescale")
.blurb("Timescale to use for the track (units per second, 0 is automatic)") .blurb("Timescale to use for the track (units per second, 0 is automatic)")

View file

@ -204,11 +204,11 @@ impl From<ObuType> for u8 {
mod tests { mod tests {
use super::*; use super::*;
use bitstream_io::{BigEndian, BitReader}; use bitstream_io::{BigEndian, BitReader};
use once_cell::sync::Lazy;
use std::io::Cursor; use std::io::Cursor;
use std::sync::LazyLock;
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
static OBUS: Lazy<Vec<(SizedObu, Vec<u8>)>> = Lazy::new(|| { static OBUS: LazyLock<Vec<(SizedObu, Vec<u8>)>> = LazyLock::new(|| {
vec![ vec![
( (
SizedObu { SizedObu {

View file

@ -31,7 +31,6 @@ serde = "1"
serde_derive = "1" serde_derive = "1"
serde_json = "1" serde_json = "1"
url = "2" url = "2"
once_cell.workspace = true
gst-video = { workspace = true, features = ["v1_22"] } gst-video = { workspace = true, features = ["v1_22"] }
sprintf = "0.2" sprintf = "0.2"

View file

@ -8,10 +8,10 @@
// //
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use once_cell::sync::Lazy;
use std::io::Write; use std::io::Write;
use std::str::FromStr; use std::str::FromStr;
use std::sync::mpsc::{self, Receiver, SyncSender}; use std::sync::mpsc::{self, Receiver, SyncSender};
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::thread::{spawn, JoinHandle}; use std::thread::{spawn, JoinHandle};
use std::time::Duration; use std::time::Duration;
@ -92,7 +92,7 @@ pub struct S3HlsSink {
canceller: Mutex<s3utils::Canceller>, canceller: Mutex<s3utils::Canceller>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awss3hlssink", "awss3hlssink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -474,7 +474,7 @@ impl ObjectSubclass for S3HlsSink {
impl ObjectImpl for S3HlsSink { impl ObjectImpl for S3HlsSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("access-key") glib::ParamSpecString::builder("access-key")
.nick("Access Key") .nick("Access Key")
@ -777,7 +777,7 @@ impl GstObjectImpl for S3HlsSink {}
impl ElementImpl for S3HlsSink { impl ElementImpl for S3HlsSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"S3 HLS Sink", "S3 HLS Sink",
"Generic", "Generic",
@ -790,7 +790,7 @@ impl ElementImpl for S3HlsSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let audio_sink_pad_template = gst::PadTemplate::new( let audio_sink_pad_template = gst::PadTemplate::new(

View file

@ -25,9 +25,9 @@ use aws_sdk_s3::{
Client, Client,
}; };
use once_cell::sync::Lazy;
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::From; use std::convert::From;
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
@ -188,7 +188,7 @@ pub struct S3Sink {
abort_multipart_canceller: Mutex<s3utils::Canceller>, abort_multipart_canceller: Mutex<s3utils::Canceller>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awss3sink", "awss3sink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -665,7 +665,7 @@ impl ObjectImpl for S3Sink {
} }
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("bucket") glib::ParamSpecString::builder("bucket")
.nick("S3 Bucket") .nick("S3 Bucket")
@ -978,7 +978,7 @@ impl GstObjectImpl for S3Sink {}
impl ElementImpl for S3Sink { impl ElementImpl for S3Sink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
#[cfg(feature = "doc")] #[cfg(feature = "doc")]
OnError::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty()); OnError::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
@ -993,7 +993,7 @@ impl ElementImpl for S3Sink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -21,9 +21,9 @@ use aws_sdk_s3::{
}; };
use super::NextFile; use super::NextFile;
use once_cell::sync::Lazy;
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::From; use std::convert::From;
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
@ -176,7 +176,7 @@ pub struct S3PutObjectSink {
canceller: Mutex<s3utils::Canceller>, canceller: Mutex<s3utils::Canceller>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awss3putobjectsink", "awss3putobjectsink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -534,7 +534,7 @@ impl ObjectSubclass for S3PutObjectSink {
impl ObjectImpl for S3PutObjectSink { impl ObjectImpl for S3PutObjectSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("bucket") glib::ParamSpecString::builder("bucket")
.nick("S3 Bucket") .nick("S3 Bucket")
@ -819,7 +819,7 @@ impl GstObjectImpl for S3PutObjectSink {}
impl ElementImpl for S3PutObjectSink { impl ElementImpl for S3PutObjectSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
#[cfg(feature = "doc")] #[cfg(feature = "doc")]
NextFile::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty()); NextFile::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
@ -834,7 +834,7 @@ impl ElementImpl for S3PutObjectSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -7,7 +7,7 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
use bytes::Bytes; use bytes::Bytes;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
@ -78,7 +78,7 @@ pub struct S3Src {
canceller: Mutex<s3utils::Canceller>, canceller: Mutex<s3utils::Canceller>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awss3src", "awss3src",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -265,7 +265,7 @@ impl ObjectSubclass for S3Src {
impl ObjectImpl for S3Src { impl ObjectImpl for S3Src {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("uri") glib::ParamSpecString::builder("uri")
.nick("URI") .nick("URI")
@ -412,7 +412,7 @@ impl GstObjectImpl for S3Src {}
impl ElementImpl for S3Src { impl ElementImpl for S3Src {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Amazon S3 source", "Amazon S3 source",
"Source/Network", "Source/Network",
@ -425,7 +425,7 @@ impl ElementImpl for S3Src {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",

View file

@ -16,8 +16,8 @@ use aws_types::sdk_config::SdkConfig;
use bytes::{buf::BufMut, Bytes, BytesMut}; use bytes::{buf::BufMut, Bytes, BytesMut};
use futures::{future, Future}; use futures::{future, Future};
use once_cell::sync::Lazy;
use std::fmt; use std::fmt;
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Duration; use std::time::Duration;
use tokio::runtime; use tokio::runtime;
@ -25,10 +25,10 @@ use tokio::runtime;
pub const DEFAULT_S3_REGION: &str = "us-west-2"; pub const DEFAULT_S3_REGION: &str = "us-west-2";
#[allow(deprecated)] #[allow(deprecated)]
pub static AWS_BEHAVIOR_VERSION: Lazy<aws_config::BehaviorVersion> = pub static AWS_BEHAVIOR_VERSION: LazyLock<aws_config::BehaviorVersion> =
Lazy::new(aws_config::BehaviorVersion::v2023_11_09); LazyLock::new(aws_config::BehaviorVersion::v2023_11_09);
static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| { static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
runtime::Builder::new_multi_thread() runtime::Builder::new_multi_thread()
.enable_all() .enable_all()
.worker_threads(2) .worker_threads(2)

View file

@ -11,11 +11,11 @@ use gst::subclass::prelude::*;
use gst::{element_imp_error, error_msg}; use gst::{element_imp_error, error_msg};
use serde_derive::Deserialize; use serde_derive::Deserialize;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awstranscribeparse", "awstranscribeparse",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -294,7 +294,7 @@ impl GstObjectImpl for TranscribeParse {}
impl ElementImpl for TranscribeParse { impl ElementImpl for TranscribeParse {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"AWS transcript parser", "AWS transcript parser",
"Text/Subtitle", "Text/Subtitle",
@ -307,7 +307,7 @@ impl ElementImpl for TranscribeParse {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::builder("application/x-json").build(); let caps = gst::Caps::builder("application/x-json").build();
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",

View file

@ -32,7 +32,7 @@ use tokio::{runtime, sync::broadcast, task};
use std::collections::{BTreeSet, VecDeque}; use std::collections::{BTreeSet, VecDeque};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use once_cell::sync::Lazy; use std::sync::LazyLock;
use super::transcribe::{TranscriberSettings, TranscriberStream, TranscriptEvent, TranscriptItem}; use super::transcribe::{TranscriberSettings, TranscriberStream, TranscriptEvent, TranscriptItem};
use super::translate::{TranslateLoop, TranslatedItem}; use super::translate::{TranslateLoop, TranslatedItem};
@ -41,7 +41,7 @@ use super::{
TranslationTokenizationMethod, CAT, TranslationTokenizationMethod, CAT,
}; };
static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| { static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
runtime::Builder::new_multi_thread() runtime::Builder::new_multi_thread()
.enable_all() .enable_all()
.build() .build()
@ -49,8 +49,8 @@ static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
}); });
#[allow(deprecated)] #[allow(deprecated)]
static AWS_BEHAVIOR_VERSION: Lazy<aws_config::BehaviorVersion> = static AWS_BEHAVIOR_VERSION: LazyLock<aws_config::BehaviorVersion> =
Lazy::new(aws_config::BehaviorVersion::v2023_11_09); LazyLock::new(aws_config::BehaviorVersion::v2023_11_09);
const DEFAULT_TRANSCRIBER_REGION: &str = "us-east-1"; const DEFAULT_TRANSCRIBER_REGION: &str = "us-east-1";
@ -688,7 +688,7 @@ impl ObjectSubclass for Transcriber {
impl ObjectImpl for Transcriber { impl ObjectImpl for Transcriber {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("language-code") glib::ParamSpecString::builder("language-code")
.nick("Language Code") .nick("Language Code")
@ -931,7 +931,7 @@ impl GstObjectImpl for Transcriber {}
impl ElementImpl for Transcriber { impl ElementImpl for Transcriber {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"Transcriber", "Transcriber",
"Audio/Text/Filter", "Audio/Text/Filter",
@ -944,7 +944,7 @@ impl ElementImpl for Transcriber {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_caps = gst::Caps::builder("text/x-raw") let src_caps = gst::Caps::builder("text/x-raw")
.field("format", "utf8") .field("format", "utf8")
.build(); .build();
@ -1771,7 +1771,7 @@ impl ObjectSubclass for TranslateSrcPad {
impl ObjectImpl for TranslateSrcPad { impl ObjectImpl for TranslateSrcPad {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder(OUTPUT_LANG_CODE_PROPERTY) glib::ParamSpecString::builder(OUTPUT_LANG_CODE_PROPERTY)
.nick("Language Code") .nick("Language Code")

View file

@ -13,9 +13,9 @@ mod imp;
mod transcribe; mod transcribe;
mod translate; mod translate;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"awstranscribe", "awstranscribe",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -12,7 +12,6 @@ rust-version.workspace = true
gst.workspace = true gst.workspace = true
gst-app.workspace = true gst-app.workspace = true
gio.workspace = true gio.workspace = true
once_cell = "1.7.2"
m3u8-rs = "5.0" m3u8-rs = "5.0"
chrono = "0.4" chrono = "0.4"
sprintf = "0.2" sprintf = "0.2"

View file

@ -14,10 +14,10 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use m3u8_rs::MediaSegment; use m3u8_rs::MediaSegment;
use once_cell::sync::Lazy;
use std::fs; use std::fs;
use std::io::Write; use std::io::Write;
use std::path; use std::path;
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
const DEFAULT_PLAYLIST_LOCATION: &str = "playlist.m3u8"; const DEFAULT_PLAYLIST_LOCATION: &str = "playlist.m3u8";
@ -31,7 +31,7 @@ const SIGNAL_GET_PLAYLIST_STREAM: &str = "get-playlist-stream";
const SIGNAL_GET_FRAGMENT_STREAM: &str = "get-fragment-stream"; const SIGNAL_GET_FRAGMENT_STREAM: &str = "get-fragment-stream";
const SIGNAL_DELETE_FRAGMENT: &str = "delete-fragment"; const SIGNAL_DELETE_FRAGMENT: &str = "delete-fragment";
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"hlsbasesink", "hlsbasesink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -106,7 +106,7 @@ impl ObjectImpl for HlsBaseSink {
} }
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("playlist-location") glib::ParamSpecString::builder("playlist-location")
.nick("Playlist Location") .nick("Playlist Location")
@ -199,7 +199,7 @@ impl ObjectImpl for HlsBaseSink {
} }
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder(SIGNAL_GET_PLAYLIST_STREAM) glib::subclass::Signal::builder(SIGNAL_GET_PLAYLIST_STREAM)
.param_types([String::static_type()]) .param_types([String::static_type()])

View file

@ -15,8 +15,8 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment}; use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment};
use once_cell::sync::Lazy;
use std::io::Write; use std::io::Write;
use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
const DEFAULT_INIT_LOCATION: &str = "init%05d.mp4"; const DEFAULT_INIT_LOCATION: &str = "init%05d.mp4";
@ -29,7 +29,7 @@ const DEFAULT_LATENCY: gst::ClockTime =
const SIGNAL_GET_INIT_STREAM: &str = "get-init-stream"; const SIGNAL_GET_INIT_STREAM: &str = "get-init-stream";
const SIGNAL_NEW_PLAYLIST: &str = "new-playlist"; const SIGNAL_NEW_PLAYLIST: &str = "new-playlist";
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"hlscmafsink", "hlscmafsink",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -110,7 +110,7 @@ impl ObjectSubclass for HlsCmafSink {
impl ObjectImpl for HlsCmafSink { impl ObjectImpl for HlsCmafSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("init-location") glib::ParamSpecString::builder("init-location")
.nick("Init Location") .nick("Init Location")
@ -220,7 +220,7 @@ impl ObjectImpl for HlsCmafSink {
} }
fn signals() -> &'static [glib::subclass::Signal] { fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| { static SIGNALS: LazyLock<Vec<glib::subclass::Signal>> = LazyLock::new(|| {
vec![ vec![
glib::subclass::Signal::builder(SIGNAL_GET_INIT_STREAM) glib::subclass::Signal::builder(SIGNAL_GET_INIT_STREAM)
.param_types([String::static_type()]) .param_types([String::static_type()])
@ -315,7 +315,7 @@ impl GstObjectImpl for HlsCmafSink {}
impl ElementImpl for HlsCmafSink { impl ElementImpl for HlsCmafSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"HTTP Live Streaming CMAF Sink", "HTTP Live Streaming CMAF Sink",
"Sink/Muxer", "Sink/Muxer",
@ -328,7 +328,7 @@ impl ElementImpl for HlsCmafSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let pad_template = gst::PadTemplate::new( let pad_template = gst::PadTemplate::new(
"sink", "sink",
gst::PadDirection::Sink, gst::PadDirection::Sink,

View file

@ -16,7 +16,7 @@ use gst::glib;
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment}; use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment};
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
const DEFAULT_TS_LOCATION: &str = "segment%05d.ts"; const DEFAULT_TS_LOCATION: &str = "segment%05d.ts";
@ -25,7 +25,7 @@ const DEFAULT_PLAYLIST_TYPE: HlsSink3PlaylistType = HlsSink3PlaylistType::Unspec
const DEFAULT_I_FRAMES_ONLY_PLAYLIST: bool = false; const DEFAULT_I_FRAMES_ONLY_PLAYLIST: bool = false;
const DEFAULT_SEND_KEYFRAME_REQUESTS: bool = true; const DEFAULT_SEND_KEYFRAME_REQUESTS: bool = true;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new("hlssink3", gst::DebugColorFlags::empty(), Some("HLS sink")) gst::DebugCategory::new("hlssink3", gst::DebugColorFlags::empty(), Some("HLS sink"))
}); });
@ -142,7 +142,7 @@ impl ObjectSubclass for HlsSink3 {
impl ObjectImpl for HlsSink3 { impl ObjectImpl for HlsSink3 {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecString::builder("location") glib::ParamSpecString::builder("location")
.nick("File Location") .nick("File Location")
@ -288,7 +288,7 @@ impl GstObjectImpl for HlsSink3 {}
impl ElementImpl for HlsSink3 { impl ElementImpl for HlsSink3 {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"HTTP Live Streaming sink", "HTTP Live Streaming sink",
"Sink/Muxer", "Sink/Muxer",
@ -303,7 +303,7 @@ impl ElementImpl for HlsSink3 {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::new_any(); let caps = gst::Caps::new_any();
let video_pad_template = gst::PadTemplate::new( let video_pad_template = gst::PadTemplate::new(
"video", "video",

View file

@ -9,12 +9,12 @@
use gio::prelude::*; use gio::prelude::*;
use gst::prelude::*; use gst::prelude::*;
use gsthlssink3::hlssink3::HlsSink3PlaylistType; use gsthlssink3::hlssink3::HlsSink3PlaylistType;
use once_cell::sync::Lazy;
use std::io::Write; use std::io::Write;
use std::sync::LazyLock;
use std::sync::{mpsc, Arc, Mutex}; use std::sync::{mpsc, Arc, Mutex};
use std::time::Duration; use std::time::Duration;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"hlssink3-test", "hlssink3-test",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -10,7 +10,6 @@ rust-version.workspace = true
[dependencies] [dependencies]
gst.workspace = true gst.workspace = true
once_cell = "1.19"
bitstream-io = "2.3" bitstream-io = "2.3"
anyhow = "1" anyhow = "1"

View file

@ -31,9 +31,9 @@ use std::ops::Add;
use std::ops::ControlFlow; use std::ops::ControlFlow;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"mpegtslivesrc", "mpegtslivesrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -508,7 +508,7 @@ impl ObjectSubclass for MpegTsLiveSource {
impl ObjectImpl for MpegTsLiveSource { impl ObjectImpl for MpegTsLiveSource {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![ vec![
glib::ParamSpecObject::builder::<gst::Element>("source") glib::ParamSpecObject::builder::<gst::Element>("source")
.nick("Source") .nick("Source")
@ -670,7 +670,7 @@ impl ElementImpl for MpegTsLiveSource {
} }
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"MpegTsLiveSource", "MpegTsLiveSource",
"Network", "Network",
@ -683,7 +683,7 @@ impl ElementImpl for MpegTsLiveSource {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,

View file

@ -22,7 +22,6 @@ libloading = "0.8"
quick-xml = "0.31" quick-xml = "0.31"
smallvec = { version = "1.11", features = ["const_generics"] } smallvec = { version = "1.11", features = ["const_generics"] }
thiserror = "1.0" thiserror = "1.0"
once_cell.workspace = true
[build-dependencies] [build-dependencies]
gst-plugin-version-helper.workspace = true gst-plugin-version-helper.workspace = true

View file

@ -8,11 +8,11 @@ use std::{
thread, thread,
}; };
use once_cell::sync::Lazy; use std::sync::LazyLock;
use crate::ndi; use crate::ndi;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndideviceprovider", "ndideviceprovider",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -50,7 +50,7 @@ impl GstObjectImpl for DeviceProvider {}
impl DeviceProviderImpl for DeviceProvider { impl DeviceProviderImpl for DeviceProvider {
fn metadata() -> Option<&'static gst::subclass::DeviceProviderMetadata> { fn metadata() -> Option<&'static gst::subclass::DeviceProviderMetadata> {
static METADATA: Lazy<gst::subclass::DeviceProviderMetadata> = Lazy::new(|| { static METADATA: LazyLock<gst::subclass::DeviceProviderMetadata> = LazyLock::new(|| {
gst::subclass::DeviceProviderMetadata::new("NewTek NDI Device Provider", gst::subclass::DeviceProviderMetadata::new("NewTek NDI Device Provider",
"Source/Audio/Video/Network", "Source/Audio/Video/Network",
"NewTek NDI Device Provider", "NewTek NDI Device Provider",

View file

@ -30,7 +30,7 @@ mod ndi_cc_meta;
#[cfg(feature = "doc")] #[cfg(feature = "doc")]
use gst::prelude::*; use gst::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum, Default)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum, Default)]
#[repr(u32)] #[repr(u32)]
@ -152,10 +152,10 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(()) Ok(())
} }
static TIMECODE_CAPS: Lazy<gst::Caps> = static TIMECODE_CAPS: LazyLock<gst::Caps> =
Lazy::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timecode")); LazyLock::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timecode"));
static TIMESTAMP_CAPS: Lazy<gst::Caps> = static TIMESTAMP_CAPS: LazyLock<gst::Caps> =
Lazy::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timestamp")); LazyLock::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timestamp"));
gst::plugin_define!( gst::plugin_define!(
ndi, ndi,

View file

@ -13,12 +13,12 @@ use gst::glib::translate::IntoGlib;
#[cfg(feature = "sink")] #[cfg(feature = "sink")]
use gst_video::VideoVBIEncoder; use gst_video::VideoVBIEncoder;
use gst_video::{VideoAncillary, VideoAncillaryDID16, VideoVBIParser}; use gst_video::{VideoAncillary, VideoAncillaryDID16, VideoVBIParser};
use once_cell::sync::Lazy; use std::sync::LazyLock;
#[cfg(feature = "sink")] #[cfg(feature = "sink")]
use std::ffi::CString; use std::ffi::CString;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndiccmeta", "ndiccmeta",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -8,12 +8,12 @@ use gst_base::subclass::prelude::*;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use crate::ndi::SendInstance; use crate::ndi::SendInstance;
use crate::ndi_cc_meta::NDICCMetaEncoder; use crate::ndi_cc_meta::NDICCMetaEncoder;
static DEFAULT_SENDER_NDI_NAME: Lazy<String> = Lazy::new(|| { static DEFAULT_SENDER_NDI_NAME: LazyLock<String> = LazyLock::new(|| {
format!( format!(
"GStreamer NewTek NDI Sink {}-{}", "GStreamer NewTek NDI Sink {}-{}",
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
@ -46,7 +46,7 @@ pub struct NdiSink {
state: Mutex<Option<State>>, state: Mutex<Option<State>>,
} }
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new("ndisink", gst::DebugColorFlags::empty(), Some("NDI Sink")) gst::DebugCategory::new("ndisink", gst::DebugColorFlags::empty(), Some("NDI Sink"))
}); });
@ -66,7 +66,7 @@ impl ObjectSubclass for NdiSink {
impl ObjectImpl for NdiSink { impl ObjectImpl for NdiSink {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
vec![glib::ParamSpecString::builder("ndi-name") vec![glib::ParamSpecString::builder("ndi-name")
.nick("NDI Name") .nick("NDI Name")
.blurb("NDI Name to use") .blurb("NDI Name to use")
@ -104,7 +104,7 @@ impl GstObjectImpl for NdiSink {}
impl ElementImpl for NdiSink { impl ElementImpl for NdiSink {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"NewTek NDI Sink", "NewTek NDI Sink",
"Sink/Audio/Video", "Sink/Audio/Video",
@ -117,7 +117,7 @@ impl ElementImpl for NdiSink {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst::Caps::builder_full() let caps = gst::Caps::builder_full()
.structure( .structure(
gst::Structure::builder("video/x-raw") gst::Structure::builder("video/x-raw")

View file

@ -7,12 +7,12 @@ use gst::subclass::prelude::*;
use gst_base::prelude::*; use gst_base::prelude::*;
use gst_base::subclass::prelude::*; use gst_base::subclass::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::mem; use std::mem;
use std::sync::Mutex; use std::sync::Mutex;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndisinkcombiner", "ndisinkcombiner",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -75,7 +75,7 @@ impl GstObjectImpl for NdiSinkCombiner {}
impl ElementImpl for NdiSinkCombiner { impl ElementImpl for NdiSinkCombiner {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"NewTek NDI Sink Combiner", "NewTek NDI Sink Combiner",
"Combiner/Audio/Video", "Combiner/Audio/Video",
@ -88,7 +88,7 @@ impl ElementImpl for NdiSinkCombiner {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let caps = gst_video::VideoCapsBuilder::new() let caps = gst_video::VideoCapsBuilder::new()
.format_list([ .format_list([
gst_video::VideoFormat::Uyvy, gst_video::VideoFormat::Uyvy,

View file

@ -53,9 +53,9 @@ impl fmt::Debug for NdiSinkAudioMeta {
mod imp { mod imp {
use glib::translate::*; use glib::translate::*;
use once_cell::sync::Lazy;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::sync::LazyLock;
pub(super) struct NdiSinkAudioMetaParams { pub(super) struct NdiSinkAudioMetaParams {
pub buffers: Vec<(gst::Buffer, gst_audio::AudioInfo, i64)>, pub buffers: Vec<(gst::Buffer, gst_audio::AudioInfo, i64)>,
@ -68,7 +68,7 @@ mod imp {
} }
pub(super) fn ndi_sink_audio_meta_api_get_type() -> glib::Type { pub(super) fn ndi_sink_audio_meta_api_get_type() -> glib::Type {
static TYPE: Lazy<glib::Type> = Lazy::new(|| unsafe { static TYPE: LazyLock<glib::Type> = LazyLock::new(|| unsafe {
let t = from_glib(gst::ffi::gst_meta_api_type_register( let t = from_glib(gst::ffi::gst_meta_api_type_register(
b"GstNdiSinkAudioMetaAPI\0".as_ptr() as *const _, b"GstNdiSinkAudioMetaAPI\0".as_ptr() as *const _,
[ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _, [ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _,
@ -125,7 +125,7 @@ mod imp {
unsafe impl Send for MetaInfo {} unsafe impl Send for MetaInfo {}
unsafe impl Sync for MetaInfo {} unsafe impl Sync for MetaInfo {}
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe { static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
MetaInfo( MetaInfo(
ptr::NonNull::new(gst::ffi::gst_meta_register( ptr::NonNull::new(gst::ffi::gst_meta_register(
ndi_sink_audio_meta_api_get_type().into_glib(), ndi_sink_audio_meta_api_get_type().into_glib(),

View file

@ -10,7 +10,7 @@ use std::cmp;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::sync::Mutex; use std::sync::Mutex;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use crate::ndisrcmeta::NdiSrcMeta; use crate::ndisrcmeta::NdiSrcMeta;
use crate::ndisys; use crate::ndisys;
@ -20,7 +20,7 @@ use crate::TimestampMode;
use super::receiver::{Receiver, ReceiverControlHandle, ReceiverItem}; use super::receiver::{Receiver, ReceiverControlHandle, ReceiverItem};
use crate::ndisrcmeta::Buffer; use crate::ndisrcmeta::Buffer;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndisrc", "ndisrc",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -28,7 +28,7 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
) )
}); });
static DEFAULT_RECEIVER_NDI_NAME: Lazy<String> = Lazy::new(|| { static DEFAULT_RECEIVER_NDI_NAME: LazyLock<String> = LazyLock::new(|| {
format!( format!(
"GStreamer NewTek NDI Source {}-{}", "GStreamer NewTek NDI Source {}-{}",
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
@ -113,7 +113,7 @@ impl ObjectSubclass for NdiSrc {
impl ObjectImpl for NdiSrc { impl ObjectImpl for NdiSrc {
fn properties() -> &'static [glib::ParamSpec] { fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
let receiver = glib::ParamSpecString::builder("receiver-ndi-name") let receiver = glib::ParamSpecString::builder("receiver-ndi-name")
.nick("Receiver NDI Name") .nick("Receiver NDI Name")
.blurb("NDI stream name of this receiver"); .blurb("NDI stream name of this receiver");
@ -350,7 +350,7 @@ impl GstObjectImpl for NdiSrc {}
impl ElementImpl for NdiSrc { impl ElementImpl for NdiSrc {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"NewTek NDI Source", "NewTek NDI Source",
"Source/Audio/Video/Network", "Source/Audio/Video/Network",
@ -363,7 +363,7 @@ impl ElementImpl for NdiSrc {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let src_pad_template = gst::PadTemplate::new( let src_pad_template = gst::PadTemplate::new(
"src", "src",
gst::PadDirection::Src, gst::PadDirection::Src,

View file

@ -8,13 +8,13 @@ use std::sync::{Arc, Condvar, Mutex, Weak};
use std::thread; use std::thread;
use std::time; use std::time;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use crate::ndi::*; use crate::ndi::*;
use crate::ndisrcmeta::Buffer; use crate::ndisrcmeta::Buffer;
use crate::ndisys::*; use crate::ndisys::*;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndireceiver", "ndireceiver",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),

View file

@ -3,7 +3,7 @@
use gst::prelude::*; use gst::prelude::*;
use gst::subclass::prelude::*; use gst::subclass::prelude::*;
use gst_video::prelude::*; use gst_video::prelude::*;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use std::sync::Mutex; use std::sync::Mutex;
@ -15,7 +15,7 @@ use crate::{
ndisys, ndisys,
}; };
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
gst::DebugCategory::new( gst::DebugCategory::new(
"ndisrcdemux", "ndisrcdemux",
gst::DebugColorFlags::empty(), gst::DebugColorFlags::empty(),
@ -115,7 +115,7 @@ impl GstObjectImpl for NdiSrcDemux {}
impl ElementImpl for NdiSrcDemux { impl ElementImpl for NdiSrcDemux {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| { static ELEMENT_METADATA: LazyLock<gst::subclass::ElementMetadata> = LazyLock::new(|| {
gst::subclass::ElementMetadata::new( gst::subclass::ElementMetadata::new(
"NewTek NDI Source Demuxer", "NewTek NDI Source Demuxer",
"Demuxer/Audio/Video", "Demuxer/Audio/Video",
@ -128,7 +128,7 @@ impl ElementImpl for NdiSrcDemux {
} }
fn pad_templates() -> &'static [gst::PadTemplate] { fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { static PAD_TEMPLATES: LazyLock<Vec<gst::PadTemplate>> = LazyLock::new(|| {
let sink_pad_template = gst::PadTemplate::new( let sink_pad_template = gst::PadTemplate::new(
"sink", "sink",
gst::PadDirection::Sink, gst::PadDirection::Sink,

View file

@ -78,9 +78,9 @@ impl fmt::Debug for NdiSrcMeta {
mod imp { mod imp {
use super::Buffer; use super::Buffer;
use glib::translate::*; use glib::translate::*;
use once_cell::sync::Lazy;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::sync::LazyLock;
pub(super) struct NdiSrcMetaParams { pub(super) struct NdiSrcMetaParams {
pub ndi_buffer: Buffer, pub ndi_buffer: Buffer,
@ -93,7 +93,7 @@ mod imp {
} }
pub(super) fn ndi_src_meta_api_get_type() -> glib::Type { pub(super) fn ndi_src_meta_api_get_type() -> glib::Type {
static TYPE: Lazy<glib::Type> = Lazy::new(|| unsafe { static TYPE: LazyLock<glib::Type> = LazyLock::new(|| unsafe {
let t = from_glib(gst::ffi::gst_meta_api_type_register( let t = from_glib(gst::ffi::gst_meta_api_type_register(
b"GstNdiSrcMetaAPI\0".as_ptr() as *const _, b"GstNdiSrcMetaAPI\0".as_ptr() as *const _,
[ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _, [ptr::null::<std::os::raw::c_char>()].as_ptr() as *mut *const _,
@ -146,7 +146,7 @@ mod imp {
unsafe impl Send for MetaInfo {} unsafe impl Send for MetaInfo {}
unsafe impl Sync for MetaInfo {} unsafe impl Sync for MetaInfo {}
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe { static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
MetaInfo( MetaInfo(
ptr::NonNull::new(gst::ffi::gst_meta_register( ptr::NonNull::new(gst::ffi::gst_meta_register(
ndi_src_meta_api_get_type().into_glib(), ndi_src_meta_api_get_type().into_glib(),

View file

@ -8,7 +8,7 @@
clippy::missing_safety_doc clippy::missing_safety_doc
)] )]
use once_cell::sync::{Lazy, OnceCell}; use std::sync::{LazyLock, OnceLock};
#[cfg(unix)] #[cfg(unix)]
use libloading::os::unix::{Library, Symbol}; use libloading::os::unix::{Library, Symbol};
@ -326,13 +326,14 @@ pub const NDIlib_compressed_packet_flags_keyframe: u32 = 1;
#[cfg(feature = "advanced-sdk")] #[cfg(feature = "advanced-sdk")]
pub const NDIlib_compressed_packet_version_0: u32 = 44; pub const NDIlib_compressed_packet_version_0: u32 = 44;
static CAT: Lazy<gst::DebugCategory> = static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
Lazy::new(|| gst::DebugCategory::new("ndi", gst::DebugColorFlags::empty(), Some("NewTek NDI"))); gst::DebugCategory::new("ndi", gst::DebugColorFlags::empty(), Some("NewTek NDI"))
});
static FFI: OnceCell<FFI> = OnceCell::new(); static FFI: OnceLock<FFI> = OnceLock::new();
pub fn load() -> Result<(), glib::BoolError> { pub fn load() -> Result<(), glib::BoolError> {
static ERR: OnceCell<Result<(), glib::BoolError>> = OnceCell::new(); static ERR: OnceLock<Result<(), glib::BoolError>> = OnceLock::new();
ERR.get_or_init(|| unsafe { ERR.get_or_init(|| unsafe {
use std::env; use std::env;
@ -447,58 +448,58 @@ pub fn load() -> Result<(), glib::BoolError> {
} }
pub unsafe fn NDIlib_initialize() -> bool { pub unsafe fn NDIlib_initialize() -> bool {
(FFI.get_unchecked().initialize)() (FFI.get().unwrap_unchecked().initialize)()
} }
pub unsafe fn NDIlib_destroy() { pub unsafe fn NDIlib_destroy() {
(FFI.get_unchecked().destroy)() (FFI.get().unwrap_unchecked().destroy)()
} }
pub unsafe fn NDIlib_find_create_v2( pub unsafe fn NDIlib_find_create_v2(
p_create_settings: *const NDIlib_find_create_t, p_create_settings: *const NDIlib_find_create_t,
) -> NDIlib_find_instance_t { ) -> NDIlib_find_instance_t {
(FFI.get_unchecked().find_create_v2)(p_create_settings) (FFI.get().unwrap_unchecked().find_create_v2)(p_create_settings)
} }
pub unsafe fn NDIlib_find_destroy(p_instance: NDIlib_find_instance_t) { pub unsafe fn NDIlib_find_destroy(p_instance: NDIlib_find_instance_t) {
(FFI.get_unchecked().find_destroy)(p_instance) (FFI.get().unwrap_unchecked().find_destroy)(p_instance)
} }
pub unsafe fn NDIlib_find_wait_for_sources( pub unsafe fn NDIlib_find_wait_for_sources(
p_instance: NDIlib_find_instance_t, p_instance: NDIlib_find_instance_t,
timeout_in_ms: u32, timeout_in_ms: u32,
) -> bool { ) -> bool {
(FFI.get_unchecked().find_wait_for_sources)(p_instance, timeout_in_ms) (FFI.get().unwrap_unchecked().find_wait_for_sources)(p_instance, timeout_in_ms)
} }
pub unsafe fn NDIlib_find_get_current_sources( pub unsafe fn NDIlib_find_get_current_sources(
p_instance: NDIlib_find_instance_t, p_instance: NDIlib_find_instance_t,
p_no_sources: *mut u32, p_no_sources: *mut u32,
) -> *const NDIlib_source_t { ) -> *const NDIlib_source_t {
(FFI.get_unchecked().find_get_current_sources)(p_instance, p_no_sources) (FFI.get().unwrap_unchecked().find_get_current_sources)(p_instance, p_no_sources)
} }
pub unsafe fn NDIlib_recv_create_v3( pub unsafe fn NDIlib_recv_create_v3(
p_create_settings: *const NDIlib_recv_create_v3_t, p_create_settings: *const NDIlib_recv_create_v3_t,
) -> NDIlib_recv_instance_t { ) -> NDIlib_recv_instance_t {
(FFI.get_unchecked().recv_create_v3)(p_create_settings) (FFI.get().unwrap_unchecked().recv_create_v3)(p_create_settings)
} }
pub unsafe fn NDIlib_recv_destroy(p_instance: NDIlib_recv_instance_t) { pub unsafe fn NDIlib_recv_destroy(p_instance: NDIlib_recv_instance_t) {
(FFI.get_unchecked().recv_destroy)(p_instance) (FFI.get().unwrap_unchecked().recv_destroy)(p_instance)
} }
pub unsafe fn NDIlib_recv_set_tally( pub unsafe fn NDIlib_recv_set_tally(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_tally: *const NDIlib_tally_t, p_tally: *const NDIlib_tally_t,
) -> bool { ) -> bool {
(FFI.get_unchecked().recv_set_tally)(p_instance, p_tally) (FFI.get().unwrap_unchecked().recv_set_tally)(p_instance, p_tally)
} }
pub unsafe fn NDIlib_recv_send_metadata( pub unsafe fn NDIlib_recv_send_metadata(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_metadata: *const NDIlib_metadata_frame_t, p_metadata: *const NDIlib_metadata_frame_t,
) -> bool { ) -> bool {
(FFI.get_unchecked().recv_send_metadata)(p_instance, p_metadata) (FFI.get().unwrap_unchecked().recv_send_metadata)(p_instance, p_metadata)
} }
pub unsafe fn NDIlib_recv_capture_v3( pub unsafe fn NDIlib_recv_capture_v3(
@ -508,7 +509,7 @@ pub unsafe fn NDIlib_recv_capture_v3(
p_metadata: *mut NDIlib_metadata_frame_t, p_metadata: *mut NDIlib_metadata_frame_t,
timeout_in_ms: u32, timeout_in_ms: u32,
) -> NDIlib_frame_type_e { ) -> NDIlib_frame_type_e {
(FFI.get_unchecked().recv_capture_v3)( (FFI.get().unwrap_unchecked().recv_capture_v3)(
p_instance, p_instance,
p_video_data, p_video_data,
p_audio_data, p_audio_data,
@ -521,57 +522,57 @@ pub unsafe fn NDIlib_recv_free_video_v2(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_video_data: *mut NDIlib_video_frame_v2_t, p_video_data: *mut NDIlib_video_frame_v2_t,
) { ) {
(FFI.get_unchecked().recv_free_video_v2)(p_instance, p_video_data) (FFI.get().unwrap_unchecked().recv_free_video_v2)(p_instance, p_video_data)
} }
pub unsafe fn NDIlib_recv_free_audio_v3( pub unsafe fn NDIlib_recv_free_audio_v3(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_audio_data: *mut NDIlib_audio_frame_v3_t, p_audio_data: *mut NDIlib_audio_frame_v3_t,
) { ) {
(FFI.get_unchecked().recv_free_audio_v3)(p_instance, p_audio_data) (FFI.get().unwrap_unchecked().recv_free_audio_v3)(p_instance, p_audio_data)
} }
pub unsafe fn NDIlib_recv_free_metadata( pub unsafe fn NDIlib_recv_free_metadata(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_metadata: *mut NDIlib_metadata_frame_t, p_metadata: *mut NDIlib_metadata_frame_t,
) { ) {
(FFI.get_unchecked().recv_free_metadata)(p_instance, p_metadata) (FFI.get().unwrap_unchecked().recv_free_metadata)(p_instance, p_metadata)
} }
pub unsafe fn NDIlib_recv_get_queue( pub unsafe fn NDIlib_recv_get_queue(
p_instance: NDIlib_recv_instance_t, p_instance: NDIlib_recv_instance_t,
p_total: *mut NDIlib_recv_queue_t, p_total: *mut NDIlib_recv_queue_t,
) { ) {
(FFI.get_unchecked().recv_get_queue)(p_instance, p_total) (FFI.get().unwrap_unchecked().recv_get_queue)(p_instance, p_total)
} }
pub unsafe fn NDIlib_send_create( pub unsafe fn NDIlib_send_create(
p_create_settings: *const NDIlib_send_create_t, p_create_settings: *const NDIlib_send_create_t,
) -> NDIlib_send_instance_t { ) -> NDIlib_send_instance_t {
(FFI.get_unchecked().send_create)(p_create_settings) (FFI.get().unwrap_unchecked().send_create)(p_create_settings)
} }
pub unsafe fn NDIlib_send_destroy(p_instance: NDIlib_send_instance_t) { pub unsafe fn NDIlib_send_destroy(p_instance: NDIlib_send_instance_t) {
(FFI.get_unchecked().send_destroy)(p_instance) (FFI.get().unwrap_unchecked().send_destroy)(p_instance)
} }
pub unsafe fn NDIlib_send_send_video_v2( pub unsafe fn NDIlib_send_send_video_v2(
p_instance: NDIlib_send_instance_t, p_instance: NDIlib_send_instance_t,
p_video_data: *const NDIlib_video_frame_v2_t, p_video_data: *const NDIlib_video_frame_v2_t,
) { ) {
(FFI.get_unchecked().send_send_video_v2)(p_instance, p_video_data) (FFI.get().unwrap_unchecked().send_send_video_v2)(p_instance, p_video_data)
} }
pub unsafe fn NDIlib_send_send_audio_v3( pub unsafe fn NDIlib_send_send_audio_v3(
p_instance: NDIlib_send_instance_t, p_instance: NDIlib_send_instance_t,
p_audio_data: *const NDIlib_audio_frame_v3_t, p_audio_data: *const NDIlib_audio_frame_v3_t,
) { ) {
(FFI.get_unchecked().send_send_audio_v3)(p_instance, p_audio_data) (FFI.get().unwrap_unchecked().send_send_audio_v3)(p_instance, p_audio_data)
} }
pub unsafe fn NDIlib_send_send_metadata( pub unsafe fn NDIlib_send_send_metadata(
p_instance: NDIlib_send_instance_t, p_instance: NDIlib_send_instance_t,
p_metadata: *const NDIlib_metadata_frame_t, p_metadata: *const NDIlib_metadata_frame_t,
) { ) {
(FFI.get_unchecked().send_send_metadata)(p_instance, p_metadata) (FFI.get().unwrap_unchecked().send_send_metadata)(p_instance, p_metadata)
} }

View file

@ -19,7 +19,6 @@ cairo-rs.workspace = true
pango.workspace = true pango.workspace = true
pangocairo.workspace = true pangocairo.workspace = true
xmltree = "0.10" xmltree = "0.10"
once_cell.workspace = true
[lib] [lib]
name = "gstrsonvif" name = "gstrsonvif"

View file

@ -13,7 +13,7 @@
* Since: plugins-rs-0.9.0 * Since: plugins-rs-0.9.0
*/ */
use gst::glib; use gst::glib;
use once_cell::sync::Lazy; use std::sync::LazyLock;
mod onvifmetadatacombiner; mod onvifmetadatacombiner;
mod onvifmetadatadepay; mod onvifmetadatadepay;
@ -28,10 +28,10 @@ pub(crate) const ONVIF_METADATA_SCHEMA: &str = "http://www.onvif.org/ver10/schem
// midnight 01-01-1970 (UNIX epoch) // midnight 01-01-1970 (UNIX epoch)
pub(crate) const PRIME_EPOCH_OFFSET: gst::ClockTime = gst::ClockTime::from_seconds(2_208_988_800); pub(crate) const PRIME_EPOCH_OFFSET: gst::ClockTime = gst::ClockTime::from_seconds(2_208_988_800);
pub(crate) static NTP_CAPS: Lazy<gst::Caps> = pub(crate) static NTP_CAPS: LazyLock<gst::Caps> =
Lazy::new(|| gst::Caps::builder("timestamp/x-ntp").build()); LazyLock::new(|| gst::Caps::builder("timestamp/x-ntp").build());
pub(crate) static UNIX_CAPS: Lazy<gst::Caps> = pub(crate) static UNIX_CAPS: LazyLock<gst::Caps> =
Lazy::new(|| gst::Caps::builder("timestamp/x-unix").build()); LazyLock::new(|| gst::Caps::builder("timestamp/x-unix").build());
pub(crate) fn lookup_reference_timestamp(buffer: &gst::Buffer) -> Option<gst::ClockTime> { pub(crate) fn lookup_reference_timestamp(buffer: &gst::Buffer) -> Option<gst::ClockTime> {
for meta in buffer.iter_meta::<gst::ReferenceTimestampMeta>() { for meta in buffer.iter_meta::<gst::ReferenceTimestampMeta>() {

Some files were not shown because too many files have changed in this diff Show more