mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-03 10:23:48 +00:00
Remove once_cell dependency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1567>
This commit is contained in:
parent
38aeec4ec5
commit
048f3e1be5
21 changed files with 60 additions and 71 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -539,7 +539,6 @@ dependencies = [
|
||||||
"memfd",
|
"memfd",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"objc",
|
"objc",
|
||||||
"once_cell",
|
|
||||||
"pango",
|
"pango",
|
||||||
"pangocairo",
|
"pangocairo",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
|
@ -890,7 +889,6 @@ dependencies = [
|
||||||
"muldiv",
|
"muldiv",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-rational",
|
"num-rational",
|
||||||
"once_cell",
|
|
||||||
"option-operations",
|
"option-operations",
|
||||||
"paste",
|
"paste",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
@ -911,7 +909,6 @@ dependencies = [
|
||||||
"gstreamer",
|
"gstreamer",
|
||||||
"gstreamer-allocators-sys",
|
"gstreamer-allocators-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -991,7 +988,6 @@ dependencies = [
|
||||||
"gstreamer-base",
|
"gstreamer-base",
|
||||||
"itertools",
|
"itertools",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
@ -1126,7 +1122,6 @@ dependencies = [
|
||||||
"gstreamer-gl-sys",
|
"gstreamer-gl-sys",
|
||||||
"gstreamer-video",
|
"gstreamer-video",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
@ -1502,7 +1497,6 @@ dependencies = [
|
||||||
"gstreamer",
|
"gstreamer",
|
||||||
"gstreamer-app",
|
"gstreamer-app",
|
||||||
"gstreamer-video",
|
"gstreamer-video",
|
||||||
"once_cell",
|
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1546,7 +1540,6 @@ dependencies = [
|
||||||
"gstreamer-video-sys",
|
"gstreamer-video-sys",
|
||||||
"itertools",
|
"itertools",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
|
@ -43,7 +43,6 @@ uds = { version = "0.4", optional = true }
|
||||||
winit = { version = "0.29", optional = true, default-features = false, features = ["rwh_05"] }
|
winit = { version = "0.29", optional = true, default-features = false, features = ["rwh_05"] }
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
data-encoding = "2.0"
|
data-encoding = "2.0"
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
windows = { version = "0.58", features=["Win32_Graphics_Direct3D11",
|
windows = { version = "0.58", features=["Win32_Graphics_Direct3D11",
|
||||||
|
|
|
@ -365,9 +365,9 @@ mod video_filter {
|
||||||
use gst_app::gst_base::subclass::BaseTransformMode;
|
use gst_app::gst_base::subclass::BaseTransformMode;
|
||||||
use gst_video::{prelude::*, subclass::prelude::*, VideoFrameRef};
|
use gst_video::{prelude::*, subclass::prelude::*, VideoFrameRef};
|
||||||
use memmap2::MmapMut;
|
use memmap2::MmapMut;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"fdmemoryfilter",
|
"fdmemoryfilter",
|
||||||
gst::DebugColorFlags::empty(),
|
gst::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -38,11 +38,11 @@ mod mirror {
|
||||||
subclass::{prelude::*, GLFilterMode},
|
subclass::{prelude::*, GLFilterMode},
|
||||||
*,
|
*,
|
||||||
};
|
};
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use super::{gl, FRAGMENT_SHADER};
|
use super::{gl, FRAGMENT_SHADER};
|
||||||
|
|
||||||
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"rsglmirrorfilter",
|
"rsglmirrorfilter",
|
||||||
gst::DebugColorFlags::empty(),
|
gst::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -18,10 +18,10 @@ mod examples_common;
|
||||||
mod fir_filter {
|
mod fir_filter {
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
use gst_base::subclass::prelude::*;
|
use gst_base::subclass::prelude::*;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
// The debug category we use below for our filter
|
// The debug category we use below for our filter
|
||||||
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"rsfirfilter",
|
"rsfirfilter",
|
||||||
gst::DebugColorFlags::empty(),
|
gst::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -4,14 +4,14 @@ use std::{collections::VecDeque, sync::Mutex};
|
||||||
|
|
||||||
use glib::prelude::*;
|
use glib::prelude::*;
|
||||||
use gst_audio::subclass::prelude::*;
|
use gst_audio::subclass::prelude::*;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
use atomic_refcell::AtomicRefCell;
|
use atomic_refcell::AtomicRefCell;
|
||||||
|
|
||||||
// The debug category we use below for our filter
|
// The debug category we use below for our filter
|
||||||
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
pub static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"rsiirfilter",
|
"rsiirfilter",
|
||||||
gst::DebugColorFlags::empty(),
|
gst::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -18,7 +18,6 @@ libc = "0.2"
|
||||||
gstreamer-allocators-sys.workspace = true
|
gstreamer-allocators-sys.workspace = true
|
||||||
glib.workspace = true
|
glib.workspace = true
|
||||||
gst.workspace = true
|
gst.workspace = true
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gir-format-check = "0.1"
|
gir-format-check = "0.1"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Take a look at the license at the top of the repository in the LICENSE file.
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||||
|
|
||||||
use gst::CapsFeatures;
|
use gst::CapsFeatures;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
pub static CAPS_FEATURES_MEMORY_DMABUF: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_MEMORY_DMABUF: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([crate::CAPS_FEATURE_MEMORY_DMABUF]));
|
LazyLock::new(|| CapsFeatures::new([crate::CAPS_FEATURE_MEMORY_DMABUF]));
|
||||||
|
|
|
@ -22,7 +22,6 @@ gst.workspace = true
|
||||||
gst-base.workspace = true
|
gst-base.workspace = true
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
smallvec = "1.0"
|
smallvec = "1.0"
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
itertools = "0.13"
|
itertools = "0.13"
|
||||||
|
|
|
@ -4,10 +4,10 @@ use std::str;
|
||||||
|
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use glib::translate::{from_glib, IntoGlib};
|
use glib::translate::{from_glib, IntoGlib};
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
#[cfg(feature = "v1_18")]
|
#[cfg(feature = "v1_18")]
|
||||||
pub static AUDIO_FORMATS_ALL: Lazy<Box<[crate::AudioFormat]>> = Lazy::new(|| unsafe {
|
pub static AUDIO_FORMATS_ALL: LazyLock<Box<[crate::AudioFormat]>> = LazyLock::new(|| unsafe {
|
||||||
let mut len: u32 = 0;
|
let mut len: u32 = 0;
|
||||||
let mut res = Vec::with_capacity(len as usize);
|
let mut res = Vec::with_capacity(len as usize);
|
||||||
let formats = ffi::gst_audio_formats_raw(&mut len);
|
let formats = ffi::gst_audio_formats_raw(&mut len);
|
||||||
|
@ -19,7 +19,7 @@ pub static AUDIO_FORMATS_ALL: Lazy<Box<[crate::AudioFormat]>> = Lazy::new(|| uns
|
||||||
});
|
});
|
||||||
|
|
||||||
#[cfg(not(feature = "v1_18"))]
|
#[cfg(not(feature = "v1_18"))]
|
||||||
pub static AUDIO_FORMATS_ALL: Lazy<Box<[crate::AudioFormat]>> = Lazy::new(|| {
|
pub static AUDIO_FORMATS_ALL: LazyLock<Box<[crate::AudioFormat]>> = LazyLock::new(|| {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
{
|
{
|
||||||
Box::new([
|
Box::new([
|
||||||
|
|
|
@ -24,7 +24,6 @@ gst.workspace = true
|
||||||
gst-base.workspace = true
|
gst-base.workspace = true
|
||||||
gst-video.workspace = true
|
gst-video.workspace = true
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gir-format-check = "0.1"
|
gir-format-check = "0.1"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Take a look at the license at the top of the repository in the LICENSE file.
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||||
|
|
||||||
use gst::CapsFeatures;
|
use gst::CapsFeatures;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
pub static CAPS_FEATURES_MEMORY_GL_MEMORY: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_MEMORY_GL_MEMORY: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([crate::CAPS_FEATURE_MEMORY_GL_MEMORY]));
|
LazyLock::new(|| CapsFeatures::new([crate::CAPS_FEATURE_MEMORY_GL_MEMORY]));
|
||||||
|
|
|
@ -19,7 +19,6 @@ rust-version.workspace = true
|
||||||
gst = { workspace = true, features = ["v1_20"] }
|
gst = { workspace = true, features = ["v1_20"] }
|
||||||
gst-app = { workspace = true, features = ["v1_20"] }
|
gst-app = { workspace = true, features = ["v1_20"] }
|
||||||
gst-video = { workspace = true, features = ["v1_20"] }
|
gst-video = { workspace = true, features = ["v1_20"] }
|
||||||
once_cell = "1"
|
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use gst::{glib, prelude::*};
|
use gst::{glib, prelude::*};
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
// Small wrapper around AtomicU64 and a Mutex, to allow it to run regular AtomicU64
|
// Small wrapper around AtomicU64 and a Mutex, to allow it to run regular AtomicU64
|
||||||
|
@ -59,7 +59,7 @@ impl WrappedAtomicU64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
static CAT: LazyLock<gst::DebugCategory> = LazyLock::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"utilsrs-stream-producer",
|
"utilsrs-stream-producer",
|
||||||
gst::DebugColorFlags::empty(),
|
gst::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -24,7 +24,6 @@ gst-base.workspace = true
|
||||||
futures-channel = "0.3"
|
futures-channel = "0.3"
|
||||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||||
thiserror = "1.0.49"
|
thiserror = "1.0.49"
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
itertools = "0.13"
|
itertools = "0.13"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use gst::CapsFeatures;
|
use gst::CapsFeatures;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
#[cfg(feature = "v1_16")]
|
#[cfg(feature = "v1_16")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
||||||
|
@ -10,34 +10,34 @@ pub static CAPS_FEATURE_FORMAT_INTERLACED: &glib::GStr =
|
||||||
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_FORMAT_INTERLACED) };
|
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_FORMAT_INTERLACED) };
|
||||||
#[cfg(feature = "v1_16")]
|
#[cfg(feature = "v1_16")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
||||||
pub static CAPS_FEATURES_FORMAT_INTERLACED: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_FORMAT_INTERLACED: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_FORMAT_INTERLACED]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_FORMAT_INTERLACED]));
|
||||||
|
|
||||||
pub static CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: &glib::GStr = unsafe {
|
pub static CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: &glib::GStr = unsafe {
|
||||||
glib::GStr::from_utf8_with_nul_unchecked(
|
glib::GStr::from_utf8_with_nul_unchecked(
|
||||||
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META,
|
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
pub static CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META]));
|
||||||
|
|
||||||
pub static CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: &glib::GStr = unsafe {
|
pub static CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: &glib::GStr = unsafe {
|
||||||
glib::GStr::from_utf8_with_nul_unchecked(
|
glib::GStr::from_utf8_with_nul_unchecked(
|
||||||
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
|
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
pub static CAPS_FEATURES_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META]));
|
||||||
|
|
||||||
pub static CAPS_FEATURE_META_GST_VIDEO_META: &glib::GStr =
|
pub static CAPS_FEATURE_META_GST_VIDEO_META: &glib::GStr =
|
||||||
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_META_GST_VIDEO_META) };
|
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_META_GST_VIDEO_META) };
|
||||||
pub static CAPS_FEATURES_META_GST_VIDEO_META: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_META_GST_VIDEO_META: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_META]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_META]));
|
||||||
|
|
||||||
pub static CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION: &glib::GStr = unsafe {
|
pub static CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION: &glib::GStr = unsafe {
|
||||||
glib::GStr::from_utf8_with_nul_unchecked(
|
glib::GStr::from_utf8_with_nul_unchecked(
|
||||||
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
ffi::GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
pub static CAPS_FEATURES_META_GST_VIDEO_OVERLAY_COMPOSITION: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_META_GST_VIDEO_OVERLAY_COMPOSITION: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION]));
|
||||||
|
|
|
@ -4,10 +4,10 @@ use std::str;
|
||||||
|
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use glib::translate::{from_glib, FromGlib, IntoGlib};
|
use glib::translate::{from_glib, FromGlib, IntoGlib};
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
#[cfg(feature = "v1_18")]
|
#[cfg(feature = "v1_18")]
|
||||||
pub static VIDEO_FORMATS_ALL: Lazy<Box<[crate::VideoFormat]>> = Lazy::new(|| unsafe {
|
pub static VIDEO_FORMATS_ALL: LazyLock<Box<[crate::VideoFormat]>> = LazyLock::new(|| unsafe {
|
||||||
let mut len: u32 = 0;
|
let mut len: u32 = 0;
|
||||||
let mut res = Vec::with_capacity(len as usize);
|
let mut res = Vec::with_capacity(len as usize);
|
||||||
let formats = ffi::gst_video_formats_raw(&mut len);
|
let formats = ffi::gst_video_formats_raw(&mut len);
|
||||||
|
@ -19,7 +19,7 @@ pub static VIDEO_FORMATS_ALL: Lazy<Box<[crate::VideoFormat]>> = Lazy::new(|| uns
|
||||||
});
|
});
|
||||||
|
|
||||||
#[cfg(not(feature = "v1_18"))]
|
#[cfg(not(feature = "v1_18"))]
|
||||||
pub static VIDEO_FORMATS_ALL: Lazy<Box<[crate::VideoFormat]>> = Lazy::new(|| {
|
pub static VIDEO_FORMATS_ALL: LazyLock<Box<[crate::VideoFormat]>> = LazyLock::new(|| {
|
||||||
#[cfg(target_endian = "little")]
|
#[cfg(target_endian = "little")]
|
||||||
{
|
{
|
||||||
Box::new([
|
Box::new([
|
||||||
|
@ -211,7 +211,7 @@ pub static VIDEO_FORMATS_ALL: Lazy<Box<[crate::VideoFormat]>> = Lazy::new(|| {
|
||||||
});
|
});
|
||||||
|
|
||||||
#[cfg(feature = "v1_24")]
|
#[cfg(feature = "v1_24")]
|
||||||
pub static VIDEO_FORMATS_ANY: Lazy<Box<[crate::VideoFormat]>> = Lazy::new(|| unsafe {
|
pub static VIDEO_FORMATS_ANY: LazyLock<Box<[crate::VideoFormat]>> = LazyLock::new(|| unsafe {
|
||||||
let mut len: u32 = 0;
|
let mut len: u32 = 0;
|
||||||
let mut res = Vec::with_capacity(len as usize);
|
let mut res = Vec::with_capacity(len as usize);
|
||||||
let formats = ffi::gst_video_formats_any(&mut len);
|
let formats = ffi::gst_video_formats_any(&mut len);
|
||||||
|
|
|
@ -33,7 +33,6 @@ thiserror = "1"
|
||||||
smallvec = { version = "1.0", features = ["write"] }
|
smallvec = { version = "1.0", features = ["write"] }
|
||||||
itertools = "0.13"
|
itertools = "0.13"
|
||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
once_cell = "1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
ron = "0.8"
|
ron = "0.8"
|
||||||
|
|
|
@ -11,7 +11,7 @@ use std::{
|
||||||
|
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use glib::{prelude::*, translate::*};
|
use glib::{prelude::*, translate::*};
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
#[doc(alias = "GstCapsFeatures")]
|
#[doc(alias = "GstCapsFeatures")]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
|
@ -860,8 +860,8 @@ unsafe impl Send for CapsFeaturesRef {}
|
||||||
|
|
||||||
pub static CAPS_FEATURE_MEMORY_SYSTEM_MEMORY: &glib::GStr =
|
pub static CAPS_FEATURE_MEMORY_SYSTEM_MEMORY: &glib::GStr =
|
||||||
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY) };
|
unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY) };
|
||||||
pub static CAPS_FEATURES_MEMORY_SYSTEM_MEMORY: Lazy<CapsFeatures> =
|
pub static CAPS_FEATURES_MEMORY_SYSTEM_MEMORY: LazyLock<CapsFeatures> =
|
||||||
Lazy::new(|| CapsFeatures::new([CAPS_FEATURE_MEMORY_SYSTEM_MEMORY]));
|
LazyLock::new(|| CapsFeatures::new([CAPS_FEATURE_MEMORY_SYSTEM_MEMORY]));
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use glib::{ffi::gpointer, prelude::*, translate::*};
|
||||||
use libc::c_char;
|
use libc::c_char;
|
||||||
#[cfg(feature = "log")]
|
#[cfg(feature = "log")]
|
||||||
use log;
|
use log;
|
||||||
use once_cell::sync::Lazy;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use crate::{ffi, DebugLevel};
|
use crate::{ffi, DebugLevel};
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ impl FromGlibPtrFull<*mut ffi::GstDebugCategory> for DebugCategory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static CAT_RUST: Lazy<DebugCategory> = Lazy::new(|| {
|
pub static CAT_RUST: LazyLock<DebugCategory> = LazyLock::new(|| {
|
||||||
DebugCategory::new(
|
DebugCategory::new(
|
||||||
"GST_RUST",
|
"GST_RUST",
|
||||||
crate::DebugColorFlags::UNDERLINE,
|
crate::DebugColorFlags::UNDERLINE,
|
||||||
|
@ -573,7 +573,7 @@ pub static CAT_RUST: Lazy<DebugCategory> = Lazy::new(|| {
|
||||||
|
|
||||||
macro_rules! declare_debug_category_from_name(
|
macro_rules! declare_debug_category_from_name(
|
||||||
($cat:ident, $cat_name:expr) => (
|
($cat:ident, $cat_name:expr) => (
|
||||||
pub static $cat: Lazy<DebugCategory> = Lazy::new(|| DebugCategory::get($cat_name)
|
pub static $cat: LazyLock<DebugCategory> = LazyLock::new(|| DebugCategory::get($cat_name)
|
||||||
.expect(&format!("Unable to find `DebugCategory` with name {}", $cat_name)));
|
.expect(&format!("Unable to find `DebugCategory` with name {}", $cat_name)));
|
||||||
);
|
);
|
||||||
);
|
);
|
||||||
|
@ -1365,7 +1365,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "log")]
|
#[cfg(feature = "log")]
|
||||||
static LOGGER: Lazy<DebugCategoryLogger> = Lazy::new(|| {
|
static LOGGER: LazyLock<DebugCategoryLogger> = LazyLock::new(|| {
|
||||||
DebugCategoryLogger::new(DebugCategory::new(
|
DebugCategoryLogger::new(DebugCategory::new(
|
||||||
"Log_trait",
|
"Log_trait",
|
||||||
crate::DebugColorFlags::empty(),
|
crate::DebugColorFlags::empty(),
|
||||||
|
|
|
@ -6,31 +6,34 @@ use std::{fmt, mem};
|
||||||
|
|
||||||
use glib::{prelude::*, Date};
|
use glib::{prelude::*, Date};
|
||||||
use num_rational::Rational32;
|
use num_rational::Rational32;
|
||||||
use once_cell::sync::Lazy;
|
|
||||||
use serde::{
|
use serde::{
|
||||||
de,
|
de,
|
||||||
de::{Deserialize, Deserializer, SeqAccess, Visitor},
|
de::{Deserialize, Deserializer, SeqAccess, Visitor},
|
||||||
ser,
|
ser,
|
||||||
ser::{Serialize, SerializeTuple, Serializer},
|
ser::{Serialize, SerializeTuple, Serializer},
|
||||||
};
|
};
|
||||||
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use crate::{date_time_serde, value::*, Buffer, DateTime, List, Sample, Structure};
|
use crate::{date_time_serde, value::*, Buffer, DateTime, List, Sample, Structure};
|
||||||
|
|
||||||
pub(crate) static ARRAY_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Array::static_type);
|
pub(crate) static ARRAY_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(Array::static_type);
|
||||||
pub(crate) static BITMASK_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Bitmask::static_type);
|
pub(crate) static BITMASK_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(Bitmask::static_type);
|
||||||
pub(crate) static DATE_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Date::static_type);
|
pub(crate) static DATE_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(Date::static_type);
|
||||||
pub(crate) static DATE_TIME_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(DateTime::static_type);
|
pub(crate) static DATE_TIME_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
pub(crate) static FRACTION_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Fraction::static_type);
|
LazyLock::new(DateTime::static_type);
|
||||||
pub(crate) static FRACTION_RANGE_OTHER_TYPE_ID: Lazy<glib::Type> =
|
pub(crate) static FRACTION_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
Lazy::new(FractionRange::static_type);
|
LazyLock::new(Fraction::static_type);
|
||||||
pub(crate) static INT_RANGE_I32_OTHER_TYPE_ID: Lazy<glib::Type> =
|
pub(crate) static FRACTION_RANGE_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
Lazy::new(IntRange::<i32>::static_type);
|
LazyLock::new(FractionRange::static_type);
|
||||||
pub(crate) static INT_RANGE_I64_OTHER_TYPE_ID: Lazy<glib::Type> =
|
pub(crate) static INT_RANGE_I32_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
Lazy::new(IntRange::<i64>::static_type);
|
LazyLock::new(IntRange::<i32>::static_type);
|
||||||
pub(crate) static LIST_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(List::static_type);
|
pub(crate) static INT_RANGE_I64_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
pub(crate) static SAMPLE_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Sample::static_type);
|
LazyLock::new(IntRange::<i64>::static_type);
|
||||||
pub(crate) static BUFFER_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Buffer::static_type);
|
pub(crate) static LIST_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(List::static_type);
|
||||||
pub(crate) static STRUCTURE_OTHER_TYPE_ID: Lazy<glib::Type> = Lazy::new(Structure::static_type);
|
pub(crate) static SAMPLE_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(Sample::static_type);
|
||||||
|
pub(crate) static BUFFER_OTHER_TYPE_ID: LazyLock<glib::Type> = LazyLock::new(Buffer::static_type);
|
||||||
|
pub(crate) static STRUCTURE_OTHER_TYPE_ID: LazyLock<glib::Type> =
|
||||||
|
LazyLock::new(Structure::static_type);
|
||||||
|
|
||||||
impl Serialize for Fraction {
|
impl Serialize for Fraction {
|
||||||
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||||
|
|
Loading…
Reference in a new issue