mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-24 12:31:02 +00:00
Remove once_cell dependency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1868>
This commit is contained in:
parent
d6e7031799
commit
7e59c3f0fd
248 changed files with 1067 additions and 1144 deletions
48
Cargo.lock
generated
48
Cargo.lock
generated
|
@ -2288,7 +2288,6 @@ dependencies = [
|
|||
"hrtf",
|
||||
"nnnoiseless",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
"rayon",
|
||||
"smallvec",
|
||||
]
|
||||
|
@ -2316,7 +2315,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"rand",
|
||||
"serde",
|
||||
|
@ -2340,7 +2338,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-video",
|
||||
"image",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2354,7 +2351,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-audio",
|
||||
"gstreamer-check",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2374,7 +2370,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"pango",
|
||||
"pangocairo",
|
||||
"pretty_assertions",
|
||||
|
@ -2397,7 +2392,6 @@ dependencies = [
|
|||
"gstreamer-audio",
|
||||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2410,7 +2404,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-video",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2427,7 +2420,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"gtk4",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
|
@ -2441,7 +2433,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2451,7 +2442,6 @@ dependencies = [
|
|||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"gstreamer-base",
|
||||
"once_cell",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
@ -2467,7 +2457,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"nom",
|
||||
"num-rational",
|
||||
"once_cell",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
|
@ -2488,7 +2477,6 @@ dependencies = [
|
|||
"gstreamer-pbutils",
|
||||
"gstreamer-video",
|
||||
"m3u8-rs",
|
||||
"once_cell",
|
||||
"quick-xml 0.31.0",
|
||||
"serde",
|
||||
]
|
||||
|
@ -2503,7 +2491,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2516,7 +2503,6 @@ dependencies = [
|
|||
"gstreamer-app",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2537,7 +2523,6 @@ dependencies = [
|
|||
"gstreamer-gl-x11",
|
||||
"gstreamer-video",
|
||||
"gtk4",
|
||||
"once_cell",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
|
@ -2556,7 +2541,6 @@ dependencies = [
|
|||
"gstreamer-pbutils",
|
||||
"gstreamer-video",
|
||||
"m3u8-rs",
|
||||
"once_cell",
|
||||
"sprintf",
|
||||
]
|
||||
|
||||
|
@ -2572,7 +2556,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2586,7 +2569,6 @@ dependencies = [
|
|||
"gstreamer-app",
|
||||
"gstreamer-check",
|
||||
"gstreamer-utils",
|
||||
"once_cell",
|
||||
"pretty_assertions",
|
||||
"serial_test",
|
||||
"tokio",
|
||||
|
@ -2600,7 +2582,6 @@ dependencies = [
|
|||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
@ -2616,7 +2597,6 @@ dependencies = [
|
|||
"gstreamer-audio",
|
||||
"gstreamer-check",
|
||||
"lewton",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2631,7 +2611,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gtk4",
|
||||
"num-rational",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
|
@ -2647,7 +2626,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-pbutils",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"tempfile",
|
||||
"url",
|
||||
]
|
||||
|
@ -2660,7 +2638,6 @@ dependencies = [
|
|||
"bitstream-io",
|
||||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2678,7 +2655,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-video",
|
||||
"libloading",
|
||||
"once_cell",
|
||||
"quick-xml 0.31.0",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
|
@ -2695,7 +2671,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-rtp",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"pango",
|
||||
"pangocairo",
|
||||
"xmlparser",
|
||||
|
@ -2711,7 +2686,6 @@ dependencies = [
|
|||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2722,7 +2696,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"png",
|
||||
]
|
||||
|
@ -2737,7 +2710,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"once_cell",
|
||||
"quinn",
|
||||
"quinn-proto",
|
||||
"rcgen",
|
||||
|
@ -2758,7 +2730,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"gstreamer-rtp",
|
||||
"once_cell",
|
||||
"rand",
|
||||
"raptorq",
|
||||
]
|
||||
|
@ -2772,7 +2743,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"once_cell",
|
||||
"rav1e",
|
||||
]
|
||||
|
||||
|
@ -2783,7 +2753,6 @@ dependencies = [
|
|||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"once_cell",
|
||||
"regex",
|
||||
]
|
||||
|
||||
|
@ -2800,7 +2769,6 @@ dependencies = [
|
|||
"http-body-util",
|
||||
"hyper 1.5.0",
|
||||
"mime",
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"reqwest 0.12.8",
|
||||
"tokio",
|
||||
|
@ -2829,7 +2797,6 @@ dependencies = [
|
|||
"gstreamer-video",
|
||||
"hex",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rand",
|
||||
"rtcp-types",
|
||||
"rtp-types",
|
||||
|
@ -2854,7 +2821,6 @@ dependencies = [
|
|||
"gstreamer-net",
|
||||
"gstreamer-pbutils",
|
||||
"lru",
|
||||
"once_cell",
|
||||
"rtsp-types",
|
||||
"sdp-types",
|
||||
"socket2",
|
||||
|
@ -2875,7 +2841,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-check",
|
||||
"hex",
|
||||
"once_cell",
|
||||
"pretty_assertions",
|
||||
"rand",
|
||||
"serde",
|
||||
|
@ -2896,7 +2861,6 @@ dependencies = [
|
|||
"gstreamer-audio",
|
||||
"gstreamer-base",
|
||||
"http 1.1.0",
|
||||
"once_cell",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
|
@ -2914,7 +2878,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"librespot-core",
|
||||
"librespot-playback",
|
||||
"once_cell",
|
||||
"tokio",
|
||||
"url",
|
||||
]
|
||||
|
@ -2925,7 +2888,6 @@ version = "0.14.0-alpha.1"
|
|||
dependencies = [
|
||||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2936,7 +2898,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-check",
|
||||
"hyphenation",
|
||||
"once_cell",
|
||||
"textwrap",
|
||||
]
|
||||
|
||||
|
@ -2959,7 +2920,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gstreamer-net",
|
||||
"gstreamer-rtp",
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"pkg-config",
|
||||
"polling",
|
||||
|
@ -2984,7 +2944,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"gtk4",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
|
@ -2997,7 +2956,6 @@ dependencies = [
|
|||
"etherparse",
|
||||
"gst-plugin-version-helper",
|
||||
"gstreamer",
|
||||
"once_cell",
|
||||
"pcap-file",
|
||||
"regex",
|
||||
"signal-hook",
|
||||
|
@ -3014,7 +2972,6 @@ dependencies = [
|
|||
"gstreamer-base",
|
||||
"gstreamer-video",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3027,7 +2984,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-app",
|
||||
"more-asserts",
|
||||
"once_cell",
|
||||
"thiserror",
|
||||
"url",
|
||||
]
|
||||
|
@ -3056,7 +3012,6 @@ dependencies = [
|
|||
"gstreamer-video",
|
||||
"image",
|
||||
"image_hasher",
|
||||
"once_cell",
|
||||
"rgb",
|
||||
]
|
||||
|
||||
|
@ -3069,7 +3024,6 @@ dependencies = [
|
|||
"gstreamer-check",
|
||||
"gstreamer-video",
|
||||
"libwebp-sys2",
|
||||
"once_cell",
|
||||
"pretty_assertions",
|
||||
]
|
||||
|
||||
|
@ -3113,7 +3067,6 @@ dependencies = [
|
|||
"itertools 0.12.1",
|
||||
"livekit-api",
|
||||
"livekit-protocol",
|
||||
"once_cell",
|
||||
"parse_link_header",
|
||||
"rand",
|
||||
"regex",
|
||||
|
@ -3174,7 +3127,6 @@ dependencies = [
|
|||
"gstreamer",
|
||||
"gstreamer-sdp",
|
||||
"gstreamer-webrtc",
|
||||
"once_cell",
|
||||
"parse_link_header",
|
||||
"reqwest 0.12.8",
|
||||
"tokio",
|
||||
|
|
|
@ -129,7 +129,6 @@ edition = "2021"
|
|||
rust-version = "1.80"
|
||||
|
||||
[workspace.dependencies]
|
||||
once_cell = "1"
|
||||
glib = { 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"] }
|
||||
|
|
|
@ -21,7 +21,6 @@ nnnoiseless = { version = "0.5", default-features = false }
|
|||
smallvec = "1"
|
||||
atomic_refcell = "0.1"
|
||||
rayon = "1.5"
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstrsaudiofx"
|
||||
|
|
|
@ -19,8 +19,8 @@ use byte_slice_cast::*;
|
|||
use num_traits::cast::{FromPrimitive, ToPrimitive};
|
||||
use num_traits::float::Float;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static _CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static _CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"rsaudioecho",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -94,7 +94,7 @@ impl ObjectSubclass for AudioEcho {
|
|||
|
||||
impl ObjectImpl for AudioEcho {
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecUInt64::builder("max-delay")
|
||||
.nick("Maximum Delay")
|
||||
|
@ -183,7 +183,7 @@ impl GstObjectImpl for AudioEcho {}
|
|||
|
||||
impl ElementImpl for AudioEcho {
|
||||
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(
|
||||
"Audio echo",
|
||||
"Filter/Effect/Audio",
|
||||
|
@ -236,7 +236,7 @@ impl BaseTransformImpl for AudioEcho {
|
|||
|
||||
impl AudioFilterImpl for AudioEcho {
|
||||
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()
|
||||
.format_list([gst_audio::AUDIO_FORMAT_F32, gst_audio::AUDIO_FORMAT_F64])
|
||||
.build()
|
||||
|
|
|
@ -21,11 +21,11 @@ use std::sync::Mutex;
|
|||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"audioloudnorm",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -1722,7 +1722,7 @@ impl ObjectSubclass for AudioLoudNorm {
|
|||
|
||||
impl ObjectImpl for AudioLoudNorm {
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecDouble::builder("loudness-target")
|
||||
.nick("Loudness Target")
|
||||
|
@ -1819,7 +1819,7 @@ impl GstObjectImpl for AudioLoudNorm {}
|
|||
|
||||
impl ElementImpl for AudioLoudNorm {
|
||||
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(
|
||||
"Audio loudness normalizer",
|
||||
"Filter/Effect/Audio",
|
||||
|
@ -1832,7 +1832,7 @@ impl ElementImpl for AudioLoudNorm {
|
|||
}
|
||||
|
||||
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()
|
||||
.format(gst_audio::AUDIO_FORMAT_F64)
|
||||
.rate(192_000)
|
||||
|
|
|
@ -21,11 +21,11 @@ use nnnoiseless::DenoiseState;
|
|||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"audiornnoise",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -257,7 +257,7 @@ impl ObjectSubclass for AudioRNNoise {
|
|||
|
||||
impl ObjectImpl for AudioRNNoise {
|
||||
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")
|
||||
.nick("Voice activity threshold")
|
||||
.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 {
|
||||
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(
|
||||
"Audio denoise",
|
||||
"Filter/Effect/Audio",
|
||||
|
@ -389,7 +389,7 @@ impl BaseTransformImpl for AudioRNNoise {
|
|||
|
||||
impl AudioFilterImpl for AudioRNNoise {
|
||||
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()
|
||||
.format(gst_audio::AUDIO_FORMAT_F32)
|
||||
.rate(48000)
|
||||
|
|
|
@ -15,7 +15,7 @@ use gst_base::prelude::*;
|
|||
use std::sync::atomic;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
|
@ -23,7 +23,7 @@ use smallvec::SmallVec;
|
|||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ebur128level",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -122,7 +122,7 @@ impl ObjectSubclass for EbuR128Level {
|
|||
|
||||
impl ObjectImpl for EbuR128Level {
|
||||
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")
|
||||
.action()
|
||||
.class_handler(|_token, args| {
|
||||
|
@ -141,7 +141,7 @@ impl ObjectImpl for EbuR128Level {
|
|||
}
|
||||
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecFlags::builder::<Mode>("mode")
|
||||
.nick("Mode")
|
||||
|
@ -223,7 +223,7 @@ impl GstObjectImpl for EbuR128Level {}
|
|||
|
||||
impl ElementImpl for EbuR128Level {
|
||||
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(
|
||||
"EBU R128 Loudness Level Measurement",
|
||||
"Filter/Analyzer/Audio",
|
||||
|
@ -236,7 +236,7 @@ impl ElementImpl for EbuR128Level {
|
|||
}
|
||||
|
||||
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()
|
||||
.format_list([
|
||||
gst_audio::AUDIO_FORMAT_S16,
|
||||
|
@ -486,7 +486,7 @@ impl BaseTransformImpl for EbuR128Level {
|
|||
|
||||
impl AudioFilterImpl for EbuR128Level {
|
||||
fn allowed_caps() -> &'static gst::Caps {
|
||||
static CAPS: Lazy<gst::Caps> = Lazy::new(|| {
|
||||
static CAPS: LazyLock<gst::Caps> = LazyLock::new(|| {
|
||||
gst_audio::AudioCapsBuilder::new()
|
||||
.format_list([
|
||||
gst_audio::AUDIO_FORMAT_S16,
|
||||
|
|
|
@ -23,8 +23,8 @@ use byte_slice_cast::*;
|
|||
use rayon::prelude::*;
|
||||
use rayon::{ThreadPool, ThreadPoolBuilder};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"hrtfrender",
|
||||
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_BLOCK_LENGTH: u64 = 512;
|
||||
|
@ -400,7 +400,7 @@ impl HrtfRender {
|
|||
|
||||
impl ObjectImpl for HrtfRender {
|
||||
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::<glib::Bytes>("hrir-raw")
|
||||
.nick("Head Transform Impulse Response")
|
||||
|
@ -533,7 +533,7 @@ impl GstObjectImpl for HrtfRender {}
|
|||
|
||||
impl ElementImpl for HrtfRender {
|
||||
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(
|
||||
"Head-Related Transfer Function (HRTF) renderer",
|
||||
"Filter/Effect/Audio",
|
||||
|
@ -546,7 +546,7 @@ impl ElementImpl for HrtfRender {
|
|||
}
|
||||
|
||||
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()
|
||||
.channels(2)
|
||||
.format(gst_audio::AUDIO_FORMAT_F32)
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
use gst::glib;
|
||||
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");
|
||||
glib::Bytes::from_owned(buff)
|
||||
});
|
||||
|
|
|
@ -14,7 +14,6 @@ gst-audio.workspace = true
|
|||
claxon = { version = "0.4" }
|
||||
byte-slice-cast = "1.0"
|
||||
atomic_refcell = "0.1"
|
||||
once_cell.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
gst-check.workspace = true
|
||||
|
|
|
@ -19,9 +19,9 @@ use atomic_refcell::AtomicRefCell;
|
|||
|
||||
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(
|
||||
"claxondec",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -51,7 +51,7 @@ impl GstObjectImpl for ClaxonDec {}
|
|||
|
||||
impl ElementImpl for ClaxonDec {
|
||||
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(
|
||||
"Claxon FLAC decoder",
|
||||
"Decoder/Audio",
|
||||
|
@ -64,7 +64,7 @@ impl ElementImpl for ClaxonDec {
|
|||
}
|
||||
|
||||
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")
|
||||
.field("framed", true)
|
||||
.build();
|
||||
|
|
|
@ -14,7 +14,6 @@ gst-base.workspace = true
|
|||
gst-audio.workspace = true
|
||||
csound = "0.1.8"
|
||||
byte-slice-cast = "1.0"
|
||||
once_cell.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
gst-check.workspace = true
|
||||
|
|
|
@ -22,9 +22,9 @@ use byte_slice_cast::*;
|
|||
|
||||
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(
|
||||
"csoundfilter",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -323,7 +323,7 @@ impl ObjectSubclass for CsoundFilter {
|
|||
|
||||
impl ObjectImpl for CsoundFilter {
|
||||
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("loop")
|
||||
.nick("Loop")
|
||||
|
@ -415,7 +415,7 @@ impl GstObjectImpl for CsoundFilter {}
|
|||
|
||||
impl ElementImpl for CsoundFilter {
|
||||
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(
|
||||
"Audio filter",
|
||||
"Filter/Effect/Audio",
|
||||
|
@ -428,7 +428,7 @@ impl ElementImpl for CsoundFilter {
|
|||
}
|
||||
|
||||
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()
|
||||
.format(gst_audio::AUDIO_FORMAT_F64)
|
||||
.build();
|
||||
|
|
|
@ -14,7 +14,6 @@ gst-audio.workspace = true
|
|||
lewton = { version = "0.10", default-features = false }
|
||||
byte-slice-cast = "1.0"
|
||||
atomic_refcell = "0.1"
|
||||
once_cell.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
gst-check.workspace = true
|
||||
|
|
|
@ -18,7 +18,7 @@ use atomic_refcell::AtomicRefCell;
|
|||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
struct State {
|
||||
header_bufs: (
|
||||
|
@ -37,7 +37,7 @@ pub struct LewtonDec {
|
|||
state: AtomicRefCell<Option<State>>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"lewtondec",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -58,7 +58,7 @@ impl GstObjectImpl for LewtonDec {}
|
|||
|
||||
impl ElementImpl for LewtonDec {
|
||||
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(
|
||||
"lewton Vorbis decoder",
|
||||
"Decoder/Audio",
|
||||
|
@ -71,7 +71,7 @@ impl ElementImpl for LewtonDec {
|
|||
}
|
||||
|
||||
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_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -15,7 +15,6 @@ gst-base.workspace = true
|
|||
gst-audio = { workspace = true, features = ["v1_16"] }
|
||||
tokio = { version = "1", features = [ "full" ] }
|
||||
async-tungstenite = { version = "0.28", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
|
||||
once_cell.workspace = true
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
atomic_refcell = "0.1"
|
||||
|
|
|
@ -27,7 +27,7 @@ use std::time::Duration;
|
|||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
#[derive(serde::Deserialize, Debug)]
|
||||
#[allow(dead_code)]
|
||||
|
@ -141,7 +141,7 @@ struct EndOfStream {
|
|||
last_seq_no: u64,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"speechmaticstranscribe",
|
||||
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()
|
||||
.enable_all()
|
||||
.worker_threads(1)
|
||||
|
@ -1351,7 +1351,7 @@ impl GstObjectImpl for Transcriber {}
|
|||
|
||||
impl ObjectImpl for Transcriber {
|
||||
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("language-code")
|
||||
.nick("Language Code")
|
||||
|
@ -1545,7 +1545,7 @@ impl ObjectImpl for Transcriber {
|
|||
|
||||
impl ElementImpl for Transcriber {
|
||||
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(
|
||||
"Transcriber",
|
||||
"Audio/Text/Filter",
|
||||
|
@ -1558,7 +1558,7 @@ impl ElementImpl for Transcriber {
|
|||
}
|
||||
|
||||
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")
|
||||
.field("format", "utf8")
|
||||
.build();
|
||||
|
@ -1751,7 +1751,7 @@ const DEFAULT_OUTPUT_LANG_CODE: Option<&str> = None;
|
|||
|
||||
impl ObjectImpl for TranscriberSrcPad {
|
||||
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)
|
||||
.nick("Language Code")
|
||||
.blurb("The Language the Stream must be translated to")
|
||||
|
|
|
@ -17,7 +17,6 @@ tokio = { version = "1", features = ["rt-multi-thread"] }
|
|||
futures = "0.3"
|
||||
anyhow = "1.0"
|
||||
url = "2.3"
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstspotify"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
use std::sync::{mpsc, Arc, Mutex};
|
||||
|
||||
use futures::future::{AbortHandle, Abortable, Aborted};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
use tokio::{runtime, task::JoinHandle};
|
||||
|
||||
use gst::glib;
|
||||
|
@ -28,7 +28,7 @@ use librespot_playback::{
|
|||
|
||||
use super::Bitrate;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"spotifyaudiosrc",
|
||||
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()
|
||||
.enable_all()
|
||||
.worker_threads(1)
|
||||
|
@ -112,7 +112,7 @@ impl ObjectSubclass for SpotifyAudioSrc {
|
|||
|
||||
impl ObjectImpl for SpotifyAudioSrc {
|
||||
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 default = Settings::default();
|
||||
|
||||
|
@ -154,7 +154,7 @@ impl GstObjectImpl for SpotifyAudioSrc {}
|
|||
|
||||
impl ElementImpl for SpotifyAudioSrc {
|
||||
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(
|
||||
"Spotify source",
|
||||
"Source/Audio",
|
||||
|
@ -167,7 +167,7 @@ impl ElementImpl for SpotifyAudioSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -12,7 +12,6 @@ rust-version.workspace = true
|
|||
url = "2"
|
||||
gst.workspace = true
|
||||
gst-base.workspace = true
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstrsfile"
|
||||
|
|
|
@ -55,8 +55,8 @@ pub struct FileSink {
|
|||
state: Mutex<State>,
|
||||
}
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"rsfilesink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -119,7 +119,7 @@ impl ObjectImpl for FileSink {
|
|||
}
|
||||
|
||||
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")
|
||||
.nick("File Location")
|
||||
.blurb("Location of the file to write")
|
||||
|
@ -172,7 +172,7 @@ impl GstObjectImpl for FileSink {}
|
|||
|
||||
impl ElementImpl for FileSink {
|
||||
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(
|
||||
"File Sink",
|
||||
"Sink/File",
|
||||
|
@ -185,7 +185,7 @@ impl ElementImpl for FileSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -54,8 +54,8 @@ pub struct FileSrc {
|
|||
state: Mutex<State>,
|
||||
}
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"rsfilesrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -126,7 +126,7 @@ impl ObjectSubclass for FileSrc {
|
|||
|
||||
impl ObjectImpl for FileSrc {
|
||||
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")
|
||||
.nick("File Location")
|
||||
.blurb("Location of the file to read from")
|
||||
|
@ -186,7 +186,7 @@ impl GstObjectImpl for FileSrc {}
|
|||
|
||||
impl ElementImpl for FileSrc {
|
||||
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(
|
||||
"File Source",
|
||||
"Source/File",
|
||||
|
@ -199,7 +199,7 @@ impl ElementImpl for FileSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -12,7 +12,6 @@ rust-version.workspace = true
|
|||
anyhow = "1"
|
||||
gst = { workspace = true, features = ["v1_18"] }
|
||||
gst-video = { workspace = true, features = ["v1_18"] }
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstgopbuffer"
|
||||
|
|
|
@ -32,9 +32,9 @@ use gst::subclass::prelude::*;
|
|||
use std::collections::VecDeque;
|
||||
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(
|
||||
"gopbuffer",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -662,7 +662,7 @@ impl ObjectSubclass for GopBuffer {
|
|||
|
||||
impl ObjectImpl for GopBuffer {
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecUInt64::builder("minimum-duration")
|
||||
.nick("Minimum Duration")
|
||||
|
@ -804,7 +804,7 @@ impl GstObjectImpl for GopBuffer {}
|
|||
|
||||
impl ElementImpl for GopBuffer {
|
||||
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(
|
||||
"GopBuffer",
|
||||
"Video",
|
||||
|
@ -817,7 +817,7 @@ impl ElementImpl for GopBuffer {
|
|||
}
|
||||
|
||||
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
|
||||
// implemented.
|
||||
//
|
||||
|
|
|
@ -13,7 +13,6 @@ anyhow = "1"
|
|||
gst = { workspace = true, features = ["v1_18"] }
|
||||
gst-utils.workspace = true
|
||||
gst-app.workspace = true
|
||||
once_cell = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1"
|
||||
|
|
|
@ -8,7 +8,7 @@ use gst::subclass::prelude::*;
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
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(
|
||||
"intersink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -82,7 +82,7 @@ impl ObjectSubclass for InterSink {
|
|||
|
||||
impl ObjectImpl for InterSink {
|
||||
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")
|
||||
.nick("Producer Name")
|
||||
.blurb("Producer Name to use")
|
||||
|
@ -158,7 +158,7 @@ impl GstObjectImpl for InterSink {}
|
|||
|
||||
impl ElementImpl for InterSink {
|
||||
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(
|
||||
"Inter Sink",
|
||||
"Generic/Sink",
|
||||
|
@ -171,7 +171,7 @@ impl ElementImpl for InterSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -8,7 +8,7 @@ use gst::subclass::prelude::*;
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
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"))
|
||||
});
|
||||
|
||||
|
@ -81,7 +81,7 @@ impl ObjectSubclass for InterSrc {
|
|||
|
||||
impl ObjectImpl for InterSrc {
|
||||
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")
|
||||
.nick("Producer Name")
|
||||
.blurb("Producer Name to consume from")
|
||||
|
@ -144,7 +144,7 @@ impl GstObjectImpl for InterSrc {}
|
|||
|
||||
impl ElementImpl for InterSrc {
|
||||
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(
|
||||
"Inter Src",
|
||||
"Generic/Src",
|
||||
|
@ -157,7 +157,7 @@ impl ElementImpl for InterSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
|
|||
use std::sync::Mutex;
|
||||
|
||||
use anyhow::{anyhow, Error};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub enum InterStreamProducer {
|
||||
Pending {
|
||||
|
@ -15,8 +15,8 @@ pub enum InterStreamProducer {
|
|||
},
|
||||
}
|
||||
|
||||
static PRODUCERS: Lazy<Mutex<HashMap<String, InterStreamProducer>>> =
|
||||
Lazy::new(|| Mutex::new(HashMap::new()));
|
||||
static PRODUCERS: LazyLock<Mutex<HashMap<String, InterStreamProducer>>> =
|
||||
LazyLock::new(|| Mutex::new(HashMap::new()));
|
||||
|
||||
fn toplevel(obj: &gst::Object) -> gst::Object {
|
||||
if let Some(parent) = obj.parent() {
|
||||
|
|
|
@ -13,7 +13,6 @@ glib.workspace = true
|
|||
gst.workspace = true
|
||||
gst-video.workspace = true
|
||||
atomic_refcell = "0.1"
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstoriginalbuffer"
|
||||
|
|
|
@ -71,9 +71,9 @@ impl fmt::Debug for OriginalBufferMeta {
|
|||
|
||||
mod imp {
|
||||
use gst::glib::translate::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub(super) struct OriginalBufferMetaParams {
|
||||
pub original: gst::Buffer,
|
||||
|
@ -88,7 +88,7 @@ mod imp {
|
|||
}
|
||||
|
||||
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(
|
||||
b"GstOriginalBufferMetaAPI\0".as_ptr() as *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 Sync for MetaInfo {}
|
||||
|
||||
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe {
|
||||
static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
|
||||
MetaInfo(
|
||||
ptr::NonNull::new(gst::ffi::gst_meta_register(
|
||||
original_buffer_meta_api_get_type().into_glib(),
|
||||
|
|
|
@ -43,9 +43,9 @@ pub struct OriginalBufferRestore {
|
|||
sink_pad: gst::Pad,
|
||||
}
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
#[allow(dead_code)]
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"originalbufferrestore",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -119,7 +119,7 @@ impl GstObjectImpl for OriginalBufferRestore {}
|
|||
|
||||
impl ElementImpl for OriginalBufferRestore {
|
||||
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(
|
||||
"Original Buffer Restore",
|
||||
"Generic",
|
||||
|
@ -132,7 +132,7 @@ impl ElementImpl for OriginalBufferRestore {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -18,9 +18,9 @@ pub struct OriginalBufferSave {
|
|||
sink_pad: gst::Pad,
|
||||
}
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
#[allow(dead_code)]
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"originalbuffersave",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -84,7 +84,7 @@ impl GstObjectImpl for OriginalBufferSave {}
|
|||
|
||||
impl ElementImpl for OriginalBufferSave {
|
||||
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(
|
||||
"Original Buffer Save",
|
||||
"Generic",
|
||||
|
@ -97,7 +97,7 @@ impl ElementImpl for OriginalBufferSave {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -12,7 +12,6 @@ rust-version.workspace = true
|
|||
gst.workspace = true
|
||||
gst-base.workspace = true
|
||||
sodiumoxide = "0.2.1"
|
||||
once_cell = "1.3.0"
|
||||
hex = "0.4"
|
||||
smallvec = "1.0"
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ use sodiumoxide::crypto::box_;
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"sodiumdecrypter",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -581,7 +581,7 @@ impl ObjectSubclass for Decrypter {
|
|||
|
||||
impl ObjectImpl for Decrypter {
|
||||
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::<glib::Bytes>("receiver-key")
|
||||
.nick("Receiver Key")
|
||||
|
@ -638,7 +638,7 @@ impl GstObjectImpl for Decrypter {}
|
|||
|
||||
impl ElementImpl for Decrypter {
|
||||
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(
|
||||
"Decrypter",
|
||||
"Generic",
|
||||
|
@ -651,7 +651,7 @@ impl ElementImpl for Decrypter {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
|
|
@ -32,8 +32,8 @@ type BufferVec = SmallVec<[gst::Buffer; 16]>;
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"sodiumencrypter",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -377,7 +377,7 @@ impl ObjectSubclass for Encrypter {
|
|||
|
||||
impl ObjectImpl for Encrypter {
|
||||
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::<glib::Bytes>("receiver-key")
|
||||
.nick("Receiver Key")
|
||||
|
@ -450,7 +450,7 @@ impl GstObjectImpl for Encrypter {}
|
|||
|
||||
impl ElementImpl for Encrypter {
|
||||
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(
|
||||
"Encrypter",
|
||||
"Generic",
|
||||
|
@ -463,7 +463,7 @@ impl ElementImpl for Encrypter {
|
|||
}
|
||||
|
||||
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_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -31,15 +31,15 @@ use std::path::PathBuf;
|
|||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static SENDER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static SENDER_PUBLIC: LazyLock<glib::Bytes> = LazyLock::new(|| {
|
||||
let public = [
|
||||
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,
|
||||
];
|
||||
glib::Bytes::from_owned(public)
|
||||
});
|
||||
static RECEIVER_PRIVATE: Lazy<glib::Bytes> = Lazy::new(|| {
|
||||
static RECEIVER_PRIVATE: LazyLock<glib::Bytes> = LazyLock::new(|| {
|
||||
let secret = [
|
||||
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,
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
static RECEIVER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| {
|
||||
static RECEIVER_PUBLIC: LazyLock<glib::Bytes> = LazyLock::new(|| {
|
||||
let public = [
|
||||
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,
|
||||
|
@ -37,14 +37,14 @@ static RECEIVER_PUBLIC: Lazy<glib::Bytes> = Lazy::new(|| {
|
|||
|
||||
glib::Bytes::from_owned(public)
|
||||
});
|
||||
static SENDER_PRIVATE: Lazy<glib::Bytes> = Lazy::new(|| {
|
||||
static SENDER_PRIVATE: LazyLock<glib::Bytes> = LazyLock::new(|| {
|
||||
let secret = [
|
||||
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,
|
||||
];
|
||||
glib::Bytes::from_owned(secret)
|
||||
});
|
||||
static NONCE: Lazy<glib::Bytes> = Lazy::new(|| {
|
||||
static NONCE: LazyLock<glib::Bytes> = LazyLock::new(|| {
|
||||
let nonce = [
|
||||
144, 187, 179, 230, 15, 4, 241, 15, 37, 133, 22, 30, 50, 106, 70, 159, 243, 218, 173, 22,
|
||||
18, 36, 4, 45,
|
||||
|
|
|
@ -19,7 +19,6 @@ gst.workspace = true
|
|||
gst-audio.workspace = true
|
||||
gst-net.workspace = true
|
||||
gst-rtp.workspace = true
|
||||
once_cell.workspace = true
|
||||
pin-project-lite = "0.2.0"
|
||||
polling = "3.1.0"
|
||||
rand = "0.8"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::env;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
|
@ -29,7 +29,7 @@ use std::time::{Duration, Instant};
|
|||
|
||||
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(
|
||||
"ts-benchmark",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use gst::glib;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
mod args;
|
||||
use args::*;
|
||||
|
@ -13,7 +13,7 @@ mod src;
|
|||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-standalone-main",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -14,7 +14,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
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::{prelude::*, PadSink};
|
||||
|
@ -257,7 +257,7 @@ impl ObjectSubclass for AsyncMutexSink {
|
|||
|
||||
impl ObjectImpl for AsyncMutexSink {
|
||||
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()
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ impl GstObjectImpl for AsyncMutexSink {}
|
|||
|
||||
impl ElementImpl for AsyncMutexSink {
|
||||
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(
|
||||
"Thread-sharing standalone test async mutex sink",
|
||||
"Sink/Test",
|
||||
|
@ -295,7 +295,7 @@ impl ElementImpl for AsyncMutexSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -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 TASK_ELEMENT_NAME: &str = "ts-standalone-task-sink";
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
use std::sync::LazyLock;
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-standalone-sink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -14,7 +14,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst::EventView;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use gstthreadshare::runtime::{prelude::*, PadSink};
|
||||
|
||||
|
@ -250,7 +250,7 @@ impl ObjectSubclass for DirectSink {
|
|||
|
||||
impl ObjectImpl for DirectSink {
|
||||
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()
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ impl GstObjectImpl for DirectSink {}
|
|||
|
||||
impl ElementImpl for DirectSink {
|
||||
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(
|
||||
"Thread-sharing standalone test direct sink",
|
||||
"Sink/Test",
|
||||
|
@ -288,7 +288,7 @@ impl ElementImpl for DirectSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -15,7 +15,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst::EventView;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use gstthreadshare::runtime::prelude::*;
|
||||
use gstthreadshare::runtime::{Context, PadSink, Task};
|
||||
|
@ -317,7 +317,7 @@ impl ObjectSubclass for TaskSink {
|
|||
|
||||
impl ObjectImpl for TaskSink {
|
||||
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()
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ impl GstObjectImpl for TaskSink {}
|
|||
|
||||
impl ElementImpl for TaskSink {
|
||||
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(
|
||||
"Thread-sharing standalone test task sink",
|
||||
"Sink/Test",
|
||||
|
@ -355,7 +355,7 @@ impl ElementImpl for TaskSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -13,7 +13,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
@ -21,7 +21,7 @@ use std::time::Duration;
|
|||
use gstthreadshare::runtime::prelude::*;
|
||||
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(
|
||||
super::ELEMENT_NAME,
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -338,7 +338,7 @@ impl ObjectSubclass for TestSrc {
|
|||
|
||||
impl ObjectImpl for TestSrc {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -429,7 +429,7 @@ impl GstObjectImpl for TestSrc {}
|
|||
|
||||
impl ElementImpl for TestSrc {
|
||||
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(
|
||||
"Thread-sharing standalone test source",
|
||||
"Source/Test",
|
||||
|
@ -442,7 +442,7 @@ impl ElementImpl for TestSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::net;
|
||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||
use std::{env, thread, time};
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-udpsrc-benchmark-sender",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -26,7 +26,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::Mutex;
|
||||
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(
|
||||
"ts-appsrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -444,7 +444,7 @@ impl ObjectSubclass for AppSrc {
|
|||
|
||||
impl ObjectImpl for AppSrc {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -479,7 +479,7 @@ impl ObjectImpl for AppSrc {
|
|||
}
|
||||
|
||||
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("push-buffer")
|
||||
.param_types([gst::Buffer::static_type()])
|
||||
|
@ -565,7 +565,7 @@ impl GstObjectImpl for AppSrc {}
|
|||
|
||||
impl ElementImpl for AppSrc {
|
||||
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(
|
||||
"Thread-sharing app source",
|
||||
"Source/Generic",
|
||||
|
@ -578,7 +578,7 @@ impl ElementImpl for AppSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -13,7 +13,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::mem::size_of;
|
||||
use std::sync::Mutex;
|
||||
|
@ -24,7 +24,7 @@ use std::time::Instant;
|
|||
use crate::runtime::prelude::*;
|
||||
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(
|
||||
"ts-audiotestsrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -49,7 +49,7 @@ const RAMPUP_BUFFER_COUNT: u32 = 500;
|
|||
#[cfg(feature = "tuning")]
|
||||
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()
|
||||
.format(gst_audio::AUDIO_FORMAT_S16)
|
||||
.rate_range(8_000..i32::MAX)
|
||||
|
@ -554,7 +554,7 @@ impl ObjectSubclass for AudioTestSrc {
|
|||
|
||||
impl ObjectImpl for AudioTestSrc {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -663,7 +663,7 @@ impl GstObjectImpl for AudioTestSrc {}
|
|||
|
||||
impl ElementImpl for AudioTestSrc {
|
||||
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(
|
||||
"Thread-sharing audio test source",
|
||||
"Source/Test",
|
||||
|
@ -676,7 +676,7 @@ impl ElementImpl for AudioTestSrc {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
|
|
@ -21,13 +21,13 @@ use futures::future::{self, abortable, AbortHandle};
|
|||
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::Arc;
|
||||
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(
|
||||
"ts-dataqueue",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -25,7 +25,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
@ -328,7 +328,7 @@ pub struct InputSelector {
|
|||
pads: Mutex<Pads>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-input-selector",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -366,7 +366,7 @@ impl ObjectSubclass for InputSelector {
|
|||
|
||||
impl ObjectImpl for InputSelector {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -474,7 +474,7 @@ impl GstObjectImpl for InputSelector {}
|
|||
|
||||
impl ElementImpl for InputSelector {
|
||||
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(
|
||||
"Thread-sharing input selector",
|
||||
"Generic",
|
||||
|
@ -487,7 +487,7 @@ impl ElementImpl for InputSelector {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink_%u",
|
||||
|
|
|
@ -26,7 +26,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst_rtp::RTPBuffer;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::{BTreeSet, VecDeque};
|
||||
|
@ -1243,7 +1243,7 @@ pub struct JitterBuffer {
|
|||
settings: StdMutex<Settings>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-jitterbuffer",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -1331,7 +1331,7 @@ impl ObjectSubclass for JitterBuffer {
|
|||
|
||||
impl ObjectImpl for JitterBuffer {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -1376,7 +1376,7 @@ impl ObjectImpl for JitterBuffer {
|
|||
}
|
||||
|
||||
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("clear-pt-map")
|
||||
.action()
|
||||
|
@ -1497,7 +1497,7 @@ impl GstObjectImpl for JitterBuffer {}
|
|||
|
||||
impl ElementImpl for JitterBuffer {
|
||||
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(
|
||||
"Thread-sharing jitterbuffer",
|
||||
"Generic",
|
||||
|
@ -1510,7 +1510,7 @@ impl ElementImpl for JitterBuffer {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -25,7 +25,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::sync::{Arc, Weak};
|
||||
|
@ -37,12 +37,12 @@ use crate::runtime::{Context, PadSink, PadSinkWeak, PadSrc, PadSrcWeak, Task};
|
|||
|
||||
use crate::dataqueue::{DataQueue, DataQueueItem};
|
||||
|
||||
static PROXY_CONTEXTS: Lazy<Mutex<HashMap<String, Weak<Mutex<ProxyContextInner>>>>> =
|
||||
Lazy::new(|| Mutex::new(HashMap::new()));
|
||||
static PROXY_SRC_PADS: Lazy<Mutex<HashMap<String, PadSrcWeak>>> =
|
||||
Lazy::new(|| Mutex::new(HashMap::new()));
|
||||
static PROXY_SINK_PADS: Lazy<Mutex<HashMap<String, PadSinkWeak>>> =
|
||||
Lazy::new(|| Mutex::new(HashMap::new()));
|
||||
static PROXY_CONTEXTS: LazyLock<Mutex<HashMap<String, Weak<Mutex<ProxyContextInner>>>>> =
|
||||
LazyLock::new(|| Mutex::new(HashMap::new()));
|
||||
static PROXY_SRC_PADS: LazyLock<Mutex<HashMap<String, PadSrcWeak>>> =
|
||||
LazyLock::new(|| Mutex::new(HashMap::new()));
|
||||
static PROXY_SINK_PADS: LazyLock<Mutex<HashMap<String, PadSinkWeak>>> =
|
||||
LazyLock::new(|| Mutex::new(HashMap::new()));
|
||||
|
||||
const DEFAULT_PROXY_CONTEXT: &str = "";
|
||||
|
||||
|
@ -304,7 +304,7 @@ pub struct ProxySink {
|
|||
settings: Mutex<SettingsSink>,
|
||||
}
|
||||
|
||||
static SINK_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static SINK_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-proxysink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -552,7 +552,7 @@ impl ObjectSubclass for ProxySink {
|
|||
|
||||
impl ObjectImpl for ProxySink {
|
||||
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")
|
||||
.nick("Proxy Context")
|
||||
.blurb("Context name of the proxy to share with")
|
||||
|
@ -597,7 +597,7 @@ impl GstObjectImpl for ProxySink {}
|
|||
|
||||
impl ElementImpl for ProxySink {
|
||||
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(
|
||||
"Thread-sharing proxy sink",
|
||||
"Sink/Generic",
|
||||
|
@ -610,7 +610,7 @@ impl ElementImpl for ProxySink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
@ -927,7 +927,7 @@ pub struct ProxySrc {
|
|||
settings: Mutex<SettingsSrc>,
|
||||
}
|
||||
|
||||
static SRC_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static SRC_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-proxysrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -1057,7 +1057,7 @@ impl ObjectSubclass for ProxySrc {
|
|||
|
||||
impl ObjectImpl for ProxySrc {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -1156,7 +1156,7 @@ impl GstObjectImpl for ProxySrc {}
|
|||
|
||||
impl ElementImpl for ProxySrc {
|
||||
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(
|
||||
"Thread-sharing proxy source",
|
||||
"Source/Generic",
|
||||
|
@ -1169,7 +1169,7 @@ impl ElementImpl for ProxySrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -25,7 +25,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::Mutex;
|
||||
|
@ -396,7 +396,7 @@ pub struct Queue {
|
|||
settings: Mutex<Settings>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-queue",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -648,7 +648,7 @@ impl ObjectSubclass for Queue {
|
|||
|
||||
impl ObjectImpl for Queue {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -735,7 +735,7 @@ impl GstObjectImpl for Queue {}
|
|||
|
||||
impl ElementImpl for Queue {
|
||||
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(
|
||||
"Thread-sharing queue",
|
||||
"Generic",
|
||||
|
@ -748,7 +748,7 @@ impl ElementImpl for Queue {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
use futures::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::collections::HashMap;
|
||||
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.
|
||||
// These `Mutex`es must be `lock`ed for a short period.
|
||||
static CONTEXTS: Lazy<Mutex<HashMap<Arc<str>, ContextWeak>>> =
|
||||
Lazy::new(|| Mutex::new(HashMap::new()));
|
||||
static CONTEXTS: LazyLock<Mutex<HashMap<Arc<str>, ContextWeak>>> =
|
||||
LazyLock::new(|| Mutex::new(HashMap::new()));
|
||||
|
||||
/// Blocks on `future` in one way or another if possible.
|
||||
///
|
||||
|
|
|
@ -44,9 +44,9 @@ pub mod prelude {
|
|||
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(
|
||||
"ts-runtime",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -23,7 +23,7 @@ use futures::future::BoxFuture;
|
|||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
|
@ -41,7 +41,7 @@ use std::os::{
|
|||
#[cfg(windows)]
|
||||
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(
|
||||
"ts-socket",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -25,7 +25,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::io;
|
||||
use std::net::{IpAddr, SocketAddr, TcpStream};
|
||||
|
@ -453,7 +453,7 @@ pub struct TcpClientSrc {
|
|||
state: Mutex<State>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-tcpclientsrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -584,7 +584,7 @@ impl ObjectSubclass for TcpClientSrc {
|
|||
|
||||
impl ObjectImpl for TcpClientSrc {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -680,7 +680,7 @@ impl GstObjectImpl for TcpClientSrc {}
|
|||
|
||||
impl ElementImpl for TcpClientSrc {
|
||||
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(
|
||||
"Thread-sharing TCP client source",
|
||||
"Source/Network",
|
||||
|
@ -693,7 +693,7 @@ impl ElementImpl for TcpClientSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -26,7 +26,7 @@ use gst::subclass::prelude::*;
|
|||
use gst::EventView;
|
||||
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::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(
|
||||
"ts-udpsink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -858,7 +858,7 @@ impl ObjectSubclass for UdpSink {
|
|||
|
||||
impl ObjectImpl for UdpSink {
|
||||
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")
|
||||
.nick("Context")
|
||||
|
@ -959,7 +959,7 @@ impl ObjectImpl for UdpSink {
|
|||
}
|
||||
|
||||
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("add")
|
||||
.param_types([String::static_type(), i32::static_type()])
|
||||
|
@ -1181,7 +1181,7 @@ impl GstObjectImpl for UdpSink {}
|
|||
|
||||
impl ElementImpl for UdpSink {
|
||||
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(
|
||||
"Thread-sharing UDP sink",
|
||||
"Sink/Network",
|
||||
|
@ -1194,7 +1194,7 @@ impl ElementImpl for UdpSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -25,7 +25,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst_net::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::io;
|
||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket};
|
||||
|
@ -677,7 +677,7 @@ pub struct UdpSrc {
|
|||
state: Mutex<State>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-udpsrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -769,7 +769,7 @@ impl ObjectSubclass for UdpSrc {
|
|||
|
||||
impl ObjectImpl for UdpSrc {
|
||||
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![
|
||||
glib::ParamSpecString::builder("context")
|
||||
.nick("Context")
|
||||
|
@ -942,7 +942,7 @@ impl GstObjectImpl for UdpSrc {}
|
|||
|
||||
impl ElementImpl for UdpSrc {
|
||||
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(
|
||||
"Thread-sharing UDP source",
|
||||
"Source/Network",
|
||||
|
@ -955,7 +955,7 @@ impl ElementImpl for UdpSrc {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -21,9 +21,9 @@ use gst::prelude::*;
|
|||
|
||||
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(
|
||||
"ts-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -29,7 +29,7 @@ use gst::prelude::*;
|
|||
use gst::subclass::prelude::*;
|
||||
use gst::EventView;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Mutex;
|
||||
|
@ -73,7 +73,7 @@ mod imp_src {
|
|||
context: String,
|
||||
}
|
||||
|
||||
pub static SRC_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
pub static SRC_CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-element-src-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -294,7 +294,7 @@ mod imp_src {
|
|||
|
||||
impl ObjectImpl for ElementSrcTest {
|
||||
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")
|
||||
.nick("Context")
|
||||
.blurb("Context name to share threads with")
|
||||
|
@ -333,7 +333,8 @@ mod imp_src {
|
|||
|
||||
impl ElementImpl for ElementSrcTest {
|
||||
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(
|
||||
"Thread-sharing Test Src Element",
|
||||
"Generic",
|
||||
|
@ -346,7 +347,7 @@ mod imp_src {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"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(
|
||||
"ts-element-sink-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -586,7 +587,7 @@ mod imp_sink {
|
|||
|
||||
impl ObjectImpl for ElementSinkTest {
|
||||
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")
|
||||
.nick("Sender")
|
||||
.blurb("Channel sender to forward the incoming items to")
|
||||
|
@ -624,7 +625,8 @@ mod imp_sink {
|
|||
|
||||
impl ElementImpl for ElementSinkTest {
|
||||
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(
|
||||
"Thread-sharing Test Sink Element",
|
||||
"Generic",
|
||||
|
@ -637,7 +639,7 @@ mod imp_sink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::mpsc;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ts-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -17,7 +17,6 @@ nom = "7"
|
|||
flavors = { git = "https://github.com/rust-av/flavors" }
|
||||
byteorder = "1.0"
|
||||
smallvec = "1.0"
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstrsflv"
|
||||
|
|
|
@ -21,11 +21,11 @@ use gst::subclass::prelude::*;
|
|||
|
||||
use num_rational::Rational32;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use smallvec::SmallVec;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"rsflvdemux",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -191,7 +191,7 @@ impl GstObjectImpl for FlvDemux {}
|
|||
|
||||
impl ElementImpl for FlvDemux {
|
||||
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(
|
||||
"FLV Demuxer",
|
||||
"Codec/Demuxer",
|
||||
|
@ -204,7 +204,7 @@ impl ElementImpl for FlvDemux {
|
|||
}
|
||||
|
||||
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 caps = caps.get_mut().unwrap();
|
||||
|
|
|
@ -15,7 +15,6 @@ gst-base = { workspace = true, features = ["v1_18"] }
|
|||
gst-audio = { workspace = true, features = ["v1_18"] }
|
||||
gst-video = { workspace = true, features = ["v1_18"] }
|
||||
gst-pbutils = { workspace = true, features = ["v1_20"] }
|
||||
once_cell.workspace = true
|
||||
bitstream-io = "2.3"
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -21,7 +21,7 @@ use std::sync::Mutex;
|
|||
|
||||
use crate::fmp4mux::obu::read_seq_header_obu_bytes;
|
||||
use crate::fmp4mux::ImageOrientation;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use super::boxes;
|
||||
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;
|
||||
|
||||
/// 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.
|
||||
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.
|
||||
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())
|
||||
}
|
||||
|
||||
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"fmp4mux",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -3254,7 +3256,7 @@ static FMP4_SIGNAL_SPLIT_AT_RUNNING_TIME: &str = "split-at-running-time";
|
|||
|
||||
impl ObjectImpl for FMP4Mux {
|
||||
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(FMP4_SIGNAL_SEND_HEADERS)
|
||||
.action()
|
||||
|
@ -3298,7 +3300,7 @@ impl ObjectImpl for FMP4Mux {
|
|||
}
|
||||
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecUInt64::builder("fragment-duration")
|
||||
.nick("Fragment Duration")
|
||||
|
@ -3971,7 +3973,7 @@ impl ObjectSubclass for ISOFMP4Mux {
|
|||
|
||||
impl ObjectImpl for ISOFMP4Mux {
|
||||
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")
|
||||
.nick("Offset to Zero")
|
||||
.blurb("Offsets all streams so that the earliest stream starts at 0")
|
||||
|
@ -4015,7 +4017,7 @@ impl GstObjectImpl for ISOFMP4Mux {}
|
|||
|
||||
impl ElementImpl for ISOFMP4Mux {
|
||||
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(
|
||||
"ISOFMP4Mux",
|
||||
"Codec/Muxer",
|
||||
|
@ -4028,7 +4030,7 @@ impl ElementImpl for ISOFMP4Mux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -4133,7 +4135,7 @@ impl GstObjectImpl for CMAFMux {}
|
|||
|
||||
impl ElementImpl for CMAFMux {
|
||||
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(
|
||||
"CMAFMux",
|
||||
"Codec/Muxer",
|
||||
|
@ -4146,7 +4148,7 @@ impl ElementImpl for CMAFMux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -4234,7 +4236,7 @@ impl GstObjectImpl for DASHMP4Mux {}
|
|||
|
||||
impl ElementImpl for DASHMP4Mux {
|
||||
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(
|
||||
"DASHMP4Mux",
|
||||
"Codec/Muxer",
|
||||
|
@ -4247,7 +4249,7 @@ impl ElementImpl for DASHMP4Mux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -4347,7 +4349,7 @@ impl GstObjectImpl for ONVIFFMP4Mux {}
|
|||
|
||||
impl ElementImpl for ONVIFFMP4Mux {
|
||||
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(
|
||||
"ONVIFFMP4Mux",
|
||||
"Codec/Muxer",
|
||||
|
@ -4360,7 +4362,7 @@ impl ElementImpl for ONVIFFMP4Mux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -4461,7 +4463,7 @@ impl ObjectSubclass for FMP4MuxPad {
|
|||
|
||||
impl ObjectImpl for FMP4MuxPad {
|
||||
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")
|
||||
.nick("Track Timescale")
|
||||
.blurb("Timescale to use for the track (units per second, 0 is automatic)")
|
||||
|
|
|
@ -204,11 +204,11 @@ impl From<ObuType> for u8 {
|
|||
mod tests {
|
||||
use super::*;
|
||||
use bitstream_io::{BigEndian, BitReader};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::io::Cursor;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
static OBUS: Lazy<Vec<(SizedObu, Vec<u8>)>> = Lazy::new(|| {
|
||||
static OBUS: LazyLock<Vec<(SizedObu, Vec<u8>)>> = LazyLock::new(|| {
|
||||
vec![
|
||||
(
|
||||
SizedObu {
|
||||
|
|
|
@ -15,7 +15,6 @@ gst-base = { workspace = true, features = ["v1_18"] }
|
|||
gst-audio = { workspace = true, features = ["v1_18"] }
|
||||
gst-video = { workspace = true, features = ["v1_18"] }
|
||||
gst-pbutils = { workspace = true, features = ["v1_18"] }
|
||||
once_cell.workspace = true
|
||||
bitstream-io = "2.3"
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -17,7 +17,7 @@ use std::collections::VecDeque;
|
|||
use std::sync::Mutex;
|
||||
|
||||
use crate::mp4mux::obu::read_seq_header_obu_bytes;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use super::{boxes, ImageOrientation};
|
||||
|
||||
|
@ -26,10 +26,12 @@ use super::{boxes, ImageOrientation};
|
|||
const NTP_UNIX_OFFSET: u64 = 2_208_988_800;
|
||||
|
||||
/// 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.
|
||||
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.
|
||||
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())
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"mp4mux",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -1268,7 +1270,7 @@ impl ObjectSubclass for MP4Mux {
|
|||
|
||||
impl ObjectImpl for MP4Mux {
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecUInt64::builder("interleave-bytes")
|
||||
.nick("Interleave Bytes")
|
||||
|
@ -1805,7 +1807,7 @@ impl GstObjectImpl for ISOMP4Mux {}
|
|||
|
||||
impl ElementImpl for ISOMP4Mux {
|
||||
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(
|
||||
"ISOMP4Mux",
|
||||
"Codec/Muxer",
|
||||
|
@ -1818,7 +1820,7 @@ impl ElementImpl for ISOMP4Mux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -1923,7 +1925,7 @@ impl GstObjectImpl for ONVIFMP4Mux {}
|
|||
|
||||
impl ElementImpl for ONVIFMP4Mux {
|
||||
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(
|
||||
"ONVIFMP4Mux",
|
||||
"Codec/Muxer",
|
||||
|
@ -1936,7 +1938,7 @@ impl ElementImpl for ONVIFMP4Mux {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
@ -2030,7 +2032,7 @@ impl ObjectSubclass for MP4MuxPad {
|
|||
|
||||
impl ObjectImpl for MP4MuxPad {
|
||||
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")
|
||||
.nick("Track Timescale")
|
||||
.blurb("Timescale to use for the track (units per second, 0 is automatic)")
|
||||
|
|
|
@ -204,11 +204,11 @@ impl From<ObuType> for u8 {
|
|||
mod tests {
|
||||
use super::*;
|
||||
use bitstream_io::{BigEndian, BitReader};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::io::Cursor;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
static OBUS: Lazy<Vec<(SizedObu, Vec<u8>)>> = Lazy::new(|| {
|
||||
static OBUS: LazyLock<Vec<(SizedObu, Vec<u8>)>> = LazyLock::new(|| {
|
||||
vec![
|
||||
(
|
||||
SizedObu {
|
||||
|
|
|
@ -31,7 +31,6 @@ serde = "1"
|
|||
serde_derive = "1"
|
||||
serde_json = "1"
|
||||
url = "2"
|
||||
once_cell.workspace = true
|
||||
gst-video = { workspace = true, features = ["v1_22"] }
|
||||
sprintf = "0.2"
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::io::Write;
|
||||
use std::str::FromStr;
|
||||
use std::sync::mpsc::{self, Receiver, SyncSender};
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
use std::thread::{spawn, JoinHandle};
|
||||
use std::time::Duration;
|
||||
|
@ -92,7 +92,7 @@ pub struct S3HlsSink {
|
|||
canceller: Mutex<s3utils::Canceller>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"awss3hlssink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -474,7 +474,7 @@ impl ObjectSubclass for S3HlsSink {
|
|||
|
||||
impl ObjectImpl for S3HlsSink {
|
||||
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("access-key")
|
||||
.nick("Access Key")
|
||||
|
@ -777,7 +777,7 @@ impl GstObjectImpl for S3HlsSink {}
|
|||
|
||||
impl ElementImpl for S3HlsSink {
|
||||
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(
|
||||
"S3 HLS Sink",
|
||||
"Generic",
|
||||
|
@ -790,7 +790,7 @@ impl ElementImpl for S3HlsSink {
|
|||
}
|
||||
|
||||
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 audio_sink_pad_template = gst::PadTemplate::new(
|
||||
|
|
|
@ -25,9 +25,9 @@ use aws_sdk_s3::{
|
|||
Client,
|
||||
};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::collections::HashMap;
|
||||
use std::convert::From;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -188,7 +188,7 @@ pub struct S3Sink {
|
|||
abort_multipart_canceller: Mutex<s3utils::Canceller>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"awss3sink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -665,7 +665,7 @@ impl ObjectImpl for S3Sink {
|
|||
}
|
||||
|
||||
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("bucket")
|
||||
.nick("S3 Bucket")
|
||||
|
@ -978,7 +978,7 @@ impl GstObjectImpl for S3Sink {}
|
|||
|
||||
impl ElementImpl for S3Sink {
|
||||
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")]
|
||||
OnError::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
|
||||
gst::subclass::ElementMetadata::new(
|
||||
|
@ -993,7 +993,7 @@ impl ElementImpl for S3Sink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -21,9 +21,9 @@ use aws_sdk_s3::{
|
|||
};
|
||||
|
||||
use super::NextFile;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::collections::HashMap;
|
||||
use std::convert::From;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -176,7 +176,7 @@ pub struct S3PutObjectSink {
|
|||
canceller: Mutex<s3utils::Canceller>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"awss3putobjectsink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -534,7 +534,7 @@ impl ObjectSubclass for S3PutObjectSink {
|
|||
|
||||
impl ObjectImpl for S3PutObjectSink {
|
||||
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("bucket")
|
||||
.nick("S3 Bucket")
|
||||
|
@ -819,7 +819,7 @@ impl GstObjectImpl for S3PutObjectSink {}
|
|||
|
||||
impl ElementImpl for S3PutObjectSink {
|
||||
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")]
|
||||
NextFile::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
|
||||
gst::subclass::ElementMetadata::new(
|
||||
|
@ -834,7 +834,7 @@ impl ElementImpl for S3PutObjectSink {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use bytes::Bytes;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -78,7 +78,7 @@ pub struct S3Src {
|
|||
canceller: Mutex<s3utils::Canceller>,
|
||||
}
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"awss3src",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -265,7 +265,7 @@ impl ObjectSubclass for S3Src {
|
|||
|
||||
impl ObjectImpl for S3Src {
|
||||
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("uri")
|
||||
.nick("URI")
|
||||
|
@ -412,7 +412,7 @@ impl GstObjectImpl for S3Src {}
|
|||
|
||||
impl ElementImpl for S3Src {
|
||||
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(
|
||||
"Amazon S3 source",
|
||||
"Source/Network",
|
||||
|
@ -425,7 +425,7 @@ impl ElementImpl for S3Src {
|
|||
}
|
||||
|
||||
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 src_pad_template = gst::PadTemplate::new(
|
||||
"src",
|
||||
|
|
|
@ -16,8 +16,8 @@ use aws_types::sdk_config::SdkConfig;
|
|||
|
||||
use bytes::{buf::BufMut, Bytes, BytesMut};
|
||||
use futures::{future, Future};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::fmt;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
use tokio::runtime;
|
||||
|
@ -25,10 +25,10 @@ use tokio::runtime;
|
|||
pub const DEFAULT_S3_REGION: &str = "us-west-2";
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub static AWS_BEHAVIOR_VERSION: Lazy<aws_config::BehaviorVersion> =
|
||||
Lazy::new(aws_config::BehaviorVersion::v2023_11_09);
|
||||
pub static AWS_BEHAVIOR_VERSION: LazyLock<aws_config::BehaviorVersion> =
|
||||
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()
|
||||
.enable_all()
|
||||
.worker_threads(2)
|
||||
|
|
|
@ -11,11 +11,11 @@ use gst::subclass::prelude::*;
|
|||
use gst::{element_imp_error, error_msg};
|
||||
use serde_derive::Deserialize;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::Mutex;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"awstranscribeparse",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -294,7 +294,7 @@ impl GstObjectImpl for TranscribeParse {}
|
|||
|
||||
impl ElementImpl for TranscribeParse {
|
||||
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(
|
||||
"AWS transcript parser",
|
||||
"Text/Subtitle",
|
||||
|
@ -307,7 +307,7 @@ impl ElementImpl for TranscribeParse {
|
|||
}
|
||||
|
||||
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 sink_pad_template = gst::PadTemplate::new(
|
||||
"sink",
|
||||
|
|
|
@ -32,7 +32,7 @@ use tokio::{runtime, sync::broadcast, task};
|
|||
use std::collections::{BTreeSet, VecDeque};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use super::transcribe::{TranscriberSettings, TranscriberStream, TranscriptEvent, TranscriptItem};
|
||||
use super::translate::{TranslateLoop, TranslatedItem};
|
||||
|
@ -41,7 +41,7 @@ use super::{
|
|||
TranslationTokenizationMethod, CAT,
|
||||
};
|
||||
|
||||
static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
|
||||
static RUNTIME: LazyLock<runtime::Runtime> = LazyLock::new(|| {
|
||||
runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
|
@ -49,8 +49,8 @@ static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
|
|||
});
|
||||
|
||||
#[allow(deprecated)]
|
||||
static AWS_BEHAVIOR_VERSION: Lazy<aws_config::BehaviorVersion> =
|
||||
Lazy::new(aws_config::BehaviorVersion::v2023_11_09);
|
||||
static AWS_BEHAVIOR_VERSION: LazyLock<aws_config::BehaviorVersion> =
|
||||
LazyLock::new(aws_config::BehaviorVersion::v2023_11_09);
|
||||
|
||||
const DEFAULT_TRANSCRIBER_REGION: &str = "us-east-1";
|
||||
|
||||
|
@ -688,7 +688,7 @@ impl ObjectSubclass for Transcriber {
|
|||
|
||||
impl ObjectImpl for Transcriber {
|
||||
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("language-code")
|
||||
.nick("Language Code")
|
||||
|
@ -931,7 +931,7 @@ impl GstObjectImpl for Transcriber {}
|
|||
|
||||
impl ElementImpl for Transcriber {
|
||||
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(
|
||||
"Transcriber",
|
||||
"Audio/Text/Filter",
|
||||
|
@ -944,7 +944,7 @@ impl ElementImpl for Transcriber {
|
|||
}
|
||||
|
||||
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")
|
||||
.field("format", "utf8")
|
||||
.build();
|
||||
|
@ -1771,7 +1771,7 @@ impl ObjectSubclass for TranslateSrcPad {
|
|||
|
||||
impl ObjectImpl for TranslateSrcPad {
|
||||
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)
|
||||
.nick("Language Code")
|
||||
|
|
|
@ -13,9 +13,9 @@ mod imp;
|
|||
mod transcribe;
|
||||
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(
|
||||
"awstranscribe",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -12,7 +12,6 @@ rust-version.workspace = true
|
|||
gst.workspace = true
|
||||
gst-app.workspace = true
|
||||
gio.workspace = true
|
||||
once_cell = "1.7.2"
|
||||
m3u8-rs = "5.0"
|
||||
chrono = "0.4"
|
||||
sprintf = "0.2"
|
||||
|
|
|
@ -14,10 +14,10 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
use m3u8_rs::MediaSegment;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
use std::path;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
|
||||
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_DELETE_FRAGMENT: &str = "delete-fragment";
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"hlsbasesink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -106,7 +106,7 @@ impl ObjectImpl for HlsBaseSink {
|
|||
}
|
||||
|
||||
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("playlist-location")
|
||||
.nick("Playlist Location")
|
||||
|
@ -199,7 +199,7 @@ impl ObjectImpl for HlsBaseSink {
|
|||
}
|
||||
|
||||
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(SIGNAL_GET_PLAYLIST_STREAM)
|
||||
.param_types([String::static_type()])
|
||||
|
|
|
@ -15,8 +15,8 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::io::Write;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
|
||||
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_NEW_PLAYLIST: &str = "new-playlist";
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"hlscmafsink",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -110,7 +110,7 @@ impl ObjectSubclass for HlsCmafSink {
|
|||
|
||||
impl ObjectImpl for HlsCmafSink {
|
||||
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("init-location")
|
||||
.nick("Init Location")
|
||||
|
@ -220,7 +220,7 @@ impl ObjectImpl for HlsCmafSink {
|
|||
}
|
||||
|
||||
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(SIGNAL_GET_INIT_STREAM)
|
||||
.param_types([String::static_type()])
|
||||
|
@ -315,7 +315,7 @@ impl GstObjectImpl for HlsCmafSink {}
|
|||
|
||||
impl ElementImpl for HlsCmafSink {
|
||||
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(
|
||||
"HTTP Live Streaming CMAF Sink",
|
||||
"Sink/Muxer",
|
||||
|
@ -328,7 +328,7 @@ impl ElementImpl for HlsCmafSink {
|
|||
}
|
||||
|
||||
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(
|
||||
"sink",
|
||||
gst::PadDirection::Sink,
|
||||
|
|
|
@ -16,7 +16,7 @@ use gst::glib;
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
use m3u8_rs::{MediaPlaylist, MediaPlaylistType, MediaSegment};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::Mutex;
|
||||
|
||||
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_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"))
|
||||
});
|
||||
|
||||
|
@ -142,7 +142,7 @@ impl ObjectSubclass for HlsSink3 {
|
|||
|
||||
impl ObjectImpl for HlsSink3 {
|
||||
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")
|
||||
.nick("File Location")
|
||||
|
@ -288,7 +288,7 @@ impl GstObjectImpl for HlsSink3 {}
|
|||
|
||||
impl ElementImpl for HlsSink3 {
|
||||
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(
|
||||
"HTTP Live Streaming sink",
|
||||
"Sink/Muxer",
|
||||
|
@ -303,7 +303,7 @@ impl ElementImpl for HlsSink3 {
|
|||
}
|
||||
|
||||
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 video_pad_template = gst::PadTemplate::new(
|
||||
"video",
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
use gio::prelude::*;
|
||||
use gst::prelude::*;
|
||||
use gsthlssink3::hlssink3::HlsSink3PlaylistType;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::io::Write;
|
||||
use std::sync::LazyLock;
|
||||
use std::sync::{mpsc, Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"hlssink3-test",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -10,7 +10,6 @@ rust-version.workspace = true
|
|||
|
||||
[dependencies]
|
||||
gst.workspace = true
|
||||
once_cell = "1.19"
|
||||
bitstream-io = "2.3"
|
||||
anyhow = "1"
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ use std::ops::Add;
|
|||
use std::ops::ControlFlow;
|
||||
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(
|
||||
"mpegtslivesrc",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -508,7 +508,7 @@ impl ObjectSubclass for MpegTsLiveSource {
|
|||
|
||||
impl ObjectImpl for MpegTsLiveSource {
|
||||
fn properties() -> &'static [glib::ParamSpec] {
|
||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||
static PROPERTIES: LazyLock<Vec<glib::ParamSpec>> = LazyLock::new(|| {
|
||||
vec![
|
||||
glib::ParamSpecObject::builder::<gst::Element>("source")
|
||||
.nick("Source")
|
||||
|
@ -670,7 +670,7 @@ impl ElementImpl for MpegTsLiveSource {
|
|||
}
|
||||
|
||||
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(
|
||||
"MpegTsLiveSource",
|
||||
"Network",
|
||||
|
@ -683,7 +683,7 @@ impl ElementImpl for MpegTsLiveSource {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
|
|
@ -22,7 +22,6 @@ libloading = "0.8"
|
|||
quick-xml = "0.31"
|
||||
smallvec = { version = "1.11", features = ["const_generics"] }
|
||||
thiserror = "1.0"
|
||||
once_cell.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
gst-plugin-version-helper.workspace = true
|
||||
|
|
|
@ -8,11 +8,11 @@ use std::{
|
|||
thread,
|
||||
};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::ndi;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndideviceprovider",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -50,7 +50,7 @@ impl GstObjectImpl for DeviceProvider {}
|
|||
|
||||
impl DeviceProviderImpl for DeviceProvider {
|
||||
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",
|
||||
"Source/Audio/Video/Network",
|
||||
"NewTek NDI Device Provider",
|
||||
|
|
|
@ -30,7 +30,7 @@ mod ndi_cc_meta;
|
|||
#[cfg(feature = "doc")]
|
||||
use gst::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum, Default)]
|
||||
#[repr(u32)]
|
||||
|
@ -152,10 +152,10 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
static TIMECODE_CAPS: Lazy<gst::Caps> =
|
||||
Lazy::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timecode"));
|
||||
static TIMESTAMP_CAPS: Lazy<gst::Caps> =
|
||||
Lazy::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timestamp"));
|
||||
static TIMECODE_CAPS: LazyLock<gst::Caps> =
|
||||
LazyLock::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timecode"));
|
||||
static TIMESTAMP_CAPS: LazyLock<gst::Caps> =
|
||||
LazyLock::new(|| gst::Caps::new_empty_simple("timestamp/x-ndi-timestamp"));
|
||||
|
||||
gst::plugin_define!(
|
||||
ndi,
|
||||
|
|
|
@ -13,12 +13,12 @@ use gst::glib::translate::IntoGlib;
|
|||
#[cfg(feature = "sink")]
|
||||
use gst_video::VideoVBIEncoder;
|
||||
use gst_video::{VideoAncillary, VideoAncillaryDID16, VideoVBIParser};
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
#[cfg(feature = "sink")]
|
||||
use std::ffi::CString;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndiccmeta",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -8,12 +8,12 @@ use gst_base::subclass::prelude::*;
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::ndi::SendInstance;
|
||||
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!(
|
||||
"GStreamer NewTek NDI Sink {}-{}",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
|
@ -46,7 +46,7 @@ pub struct NdiSink {
|
|||
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"))
|
||||
});
|
||||
|
||||
|
@ -66,7 +66,7 @@ impl ObjectSubclass for NdiSink {
|
|||
|
||||
impl ObjectImpl for NdiSink {
|
||||
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")
|
||||
.nick("NDI Name")
|
||||
.blurb("NDI Name to use")
|
||||
|
@ -104,7 +104,7 @@ impl GstObjectImpl for NdiSink {}
|
|||
|
||||
impl ElementImpl for NdiSink {
|
||||
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(
|
||||
"NewTek NDI Sink",
|
||||
"Sink/Audio/Video",
|
||||
|
@ -117,7 +117,7 @@ impl ElementImpl for NdiSink {
|
|||
}
|
||||
|
||||
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()
|
||||
.structure(
|
||||
gst::Structure::builder("video/x-raw")
|
||||
|
|
|
@ -7,12 +7,12 @@ use gst::subclass::prelude::*;
|
|||
use gst_base::prelude::*;
|
||||
use gst_base::subclass::prelude::*;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::mem;
|
||||
use std::sync::Mutex;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndisinkcombiner",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -75,7 +75,7 @@ impl GstObjectImpl for NdiSinkCombiner {}
|
|||
|
||||
impl ElementImpl for NdiSinkCombiner {
|
||||
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(
|
||||
"NewTek NDI Sink Combiner",
|
||||
"Combiner/Audio/Video",
|
||||
|
@ -88,7 +88,7 @@ impl ElementImpl for NdiSinkCombiner {
|
|||
}
|
||||
|
||||
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()
|
||||
.format_list([
|
||||
gst_video::VideoFormat::Uyvy,
|
||||
|
|
|
@ -53,9 +53,9 @@ impl fmt::Debug for NdiSinkAudioMeta {
|
|||
|
||||
mod imp {
|
||||
use glib::translate::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub(super) struct NdiSinkAudioMetaParams {
|
||||
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 {
|
||||
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(
|
||||
b"GstNdiSinkAudioMetaAPI\0".as_ptr() as *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 Sync for MetaInfo {}
|
||||
|
||||
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe {
|
||||
static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
|
||||
MetaInfo(
|
||||
ptr::NonNull::new(gst::ffi::gst_meta_register(
|
||||
ndi_sink_audio_meta_api_get_type().into_glib(),
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::cmp;
|
|||
use std::collections::VecDeque;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::ndisrcmeta::NdiSrcMeta;
|
||||
use crate::ndisys;
|
||||
|
@ -20,7 +20,7 @@ use crate::TimestampMode;
|
|||
use super::receiver::{Receiver, ReceiverControlHandle, ReceiverItem};
|
||||
use crate::ndisrcmeta::Buffer;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndisrc",
|
||||
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!(
|
||||
"GStreamer NewTek NDI Source {}-{}",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
|
@ -113,7 +113,7 @@ impl ObjectSubclass for NdiSrc {
|
|||
|
||||
impl ObjectImpl for NdiSrc {
|
||||
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")
|
||||
.nick("Receiver NDI Name")
|
||||
.blurb("NDI stream name of this receiver");
|
||||
|
@ -350,7 +350,7 @@ impl GstObjectImpl for NdiSrc {}
|
|||
|
||||
impl ElementImpl for NdiSrc {
|
||||
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(
|
||||
"NewTek NDI Source",
|
||||
"Source/Audio/Video/Network",
|
||||
|
@ -363,7 +363,7 @@ impl ElementImpl for NdiSrc {
|
|||
}
|
||||
|
||||
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(
|
||||
"src",
|
||||
gst::PadDirection::Src,
|
||||
|
|
|
@ -8,13 +8,13 @@ use std::sync::{Arc, Condvar, Mutex, Weak};
|
|||
use std::thread;
|
||||
use std::time;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::ndi::*;
|
||||
use crate::ndisrcmeta::Buffer;
|
||||
use crate::ndisys::*;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndireceiver",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use gst::prelude::*;
|
||||
use gst::subclass::prelude::*;
|
||||
use gst_video::prelude::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use std::sync::Mutex;
|
||||
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
|||
ndisys,
|
||||
};
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
"ndisrcdemux",
|
||||
gst::DebugColorFlags::empty(),
|
||||
|
@ -115,7 +115,7 @@ impl GstObjectImpl for NdiSrcDemux {}
|
|||
|
||||
impl ElementImpl for NdiSrcDemux {
|
||||
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(
|
||||
"NewTek NDI Source Demuxer",
|
||||
"Demuxer/Audio/Video",
|
||||
|
@ -128,7 +128,7 @@ impl ElementImpl for NdiSrcDemux {
|
|||
}
|
||||
|
||||
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(
|
||||
"sink",
|
||||
gst::PadDirection::Sink,
|
||||
|
|
|
@ -78,9 +78,9 @@ impl fmt::Debug for NdiSrcMeta {
|
|||
mod imp {
|
||||
use super::Buffer;
|
||||
use glib::translate::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub(super) struct NdiSrcMetaParams {
|
||||
pub ndi_buffer: Buffer,
|
||||
|
@ -93,7 +93,7 @@ mod imp {
|
|||
}
|
||||
|
||||
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(
|
||||
b"GstNdiSrcMetaAPI\0".as_ptr() as *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 Sync for MetaInfo {}
|
||||
|
||||
static META_INFO: Lazy<MetaInfo> = Lazy::new(|| unsafe {
|
||||
static META_INFO: LazyLock<MetaInfo> = LazyLock::new(|| unsafe {
|
||||
MetaInfo(
|
||||
ptr::NonNull::new(gst::ffi::gst_meta_register(
|
||||
ndi_src_meta_api_get_type().into_glib(),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
clippy::missing_safety_doc
|
||||
)]
|
||||
|
||||
use once_cell::sync::{Lazy, OnceCell};
|
||||
use std::sync::{LazyLock, OnceLock};
|
||||
|
||||
#[cfg(unix)]
|
||||
use libloading::os::unix::{Library, Symbol};
|
||||
|
@ -326,13 +326,14 @@ pub const NDIlib_compressed_packet_flags_keyframe: u32 = 1;
|
|||
#[cfg(feature = "advanced-sdk")]
|
||||
pub const NDIlib_compressed_packet_version_0: u32 = 44;
|
||||
|
||||
static CAT: Lazy<gst::DebugCategory> =
|
||||
Lazy::new(|| gst::DebugCategory::new("ndi", gst::DebugColorFlags::empty(), Some("NewTek NDI")));
|
||||
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||
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> {
|
||||
static ERR: OnceCell<Result<(), glib::BoolError>> = OnceCell::new();
|
||||
static ERR: OnceLock<Result<(), glib::BoolError>> = OnceLock::new();
|
||||
|
||||
ERR.get_or_init(|| unsafe {
|
||||
use std::env;
|
||||
|
@ -447,58 +448,58 @@ pub fn load() -> Result<(), glib::BoolError> {
|
|||
}
|
||||
|
||||
pub unsafe fn NDIlib_initialize() -> bool {
|
||||
(FFI.get_unchecked().initialize)()
|
||||
(FFI.get().unwrap_unchecked().initialize)()
|
||||
}
|
||||
|
||||
pub unsafe fn NDIlib_destroy() {
|
||||
(FFI.get_unchecked().destroy)()
|
||||
(FFI.get().unwrap_unchecked().destroy)()
|
||||
}
|
||||
|
||||
pub unsafe fn NDIlib_find_create_v2(
|
||||
p_create_settings: *const NDIlib_find_create_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) {
|
||||
(FFI.get_unchecked().find_destroy)(p_instance)
|
||||
(FFI.get().unwrap_unchecked().find_destroy)(p_instance)
|
||||
}
|
||||
|
||||
pub unsafe fn NDIlib_find_wait_for_sources(
|
||||
p_instance: NDIlib_find_instance_t,
|
||||
timeout_in_ms: u32,
|
||||
) -> 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(
|
||||
p_instance: NDIlib_find_instance_t,
|
||||
p_no_sources: *mut u32,
|
||||
) -> *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(
|
||||
p_create_settings: *const NDIlib_recv_create_v3_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) {
|
||||
(FFI.get_unchecked().recv_destroy)(p_instance)
|
||||
(FFI.get().unwrap_unchecked().recv_destroy)(p_instance)
|
||||
}
|
||||
|
||||
pub unsafe fn NDIlib_recv_set_tally(
|
||||
p_instance: NDIlib_recv_instance_t,
|
||||
p_tally: *const NDIlib_tally_t,
|
||||
) -> 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(
|
||||
p_instance: NDIlib_recv_instance_t,
|
||||
p_metadata: *const NDIlib_metadata_frame_t,
|
||||
) -> 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(
|
||||
|
@ -508,7 +509,7 @@ pub unsafe fn NDIlib_recv_capture_v3(
|
|||
p_metadata: *mut NDIlib_metadata_frame_t,
|
||||
timeout_in_ms: u32,
|
||||
) -> NDIlib_frame_type_e {
|
||||
(FFI.get_unchecked().recv_capture_v3)(
|
||||
(FFI.get().unwrap_unchecked().recv_capture_v3)(
|
||||
p_instance,
|
||||
p_video_data,
|
||||
p_audio_data,
|
||||
|
@ -521,57 +522,57 @@ pub unsafe fn NDIlib_recv_free_video_v2(
|
|||
p_instance: NDIlib_recv_instance_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(
|
||||
p_instance: NDIlib_recv_instance_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(
|
||||
p_instance: NDIlib_recv_instance_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(
|
||||
p_instance: NDIlib_recv_instance_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(
|
||||
p_create_settings: *const NDIlib_send_create_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) {
|
||||
(FFI.get_unchecked().send_destroy)(p_instance)
|
||||
(FFI.get().unwrap_unchecked().send_destroy)(p_instance)
|
||||
}
|
||||
|
||||
pub unsafe fn NDIlib_send_send_video_v2(
|
||||
p_instance: NDIlib_send_instance_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(
|
||||
p_instance: NDIlib_send_instance_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(
|
||||
p_instance: NDIlib_send_instance_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)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ cairo-rs.workspace = true
|
|||
pango.workspace = true
|
||||
pangocairo.workspace = true
|
||||
xmltree = "0.10"
|
||||
once_cell.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "gstrsonvif"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* Since: plugins-rs-0.9.0
|
||||
*/
|
||||
use gst::glib;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
mod onvifmetadatacombiner;
|
||||
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)
|
||||
pub(crate) const PRIME_EPOCH_OFFSET: gst::ClockTime = gst::ClockTime::from_seconds(2_208_988_800);
|
||||
|
||||
pub(crate) static NTP_CAPS: Lazy<gst::Caps> =
|
||||
Lazy::new(|| gst::Caps::builder("timestamp/x-ntp").build());
|
||||
pub(crate) static UNIX_CAPS: Lazy<gst::Caps> =
|
||||
Lazy::new(|| gst::Caps::builder("timestamp/x-unix").build());
|
||||
pub(crate) static NTP_CAPS: LazyLock<gst::Caps> =
|
||||
LazyLock::new(|| gst::Caps::builder("timestamp/x-ntp").build());
|
||||
pub(crate) static UNIX_CAPS: LazyLock<gst::Caps> =
|
||||
LazyLock::new(|| gst::Caps::builder("timestamp/x-unix").build());
|
||||
|
||||
pub(crate) fn lookup_reference_timestamp(buffer: &gst::Buffer) -> Option<gst::ClockTime> {
|
||||
for meta in buffer.iter_meta::<gst::ReferenceTimestampMeta>() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue