diff options
author | Bilal Elmoussaoui <belmouss@redhat.com> | 2023-07-06 16:43:37 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-07-06 17:50:49 +0300 |
commit | dd2d7d9215494cdaac4a361b9fea8fdf01742153 (patch) | |
tree | ee335254ac492f376dbc71abb5d267b5c8f16ac6 /tutorial | |
parent | 2cc98bf410f687a1779edb86dd259f377cca1c7b (diff) |
Use re-exported once_cell
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
Diffstat (limited to 'tutorial')
-rw-r--r-- | tutorial/Cargo.toml | 1 | ||||
-rw-r--r-- | tutorial/src/identity/imp.rs | 2 | ||||
-rw-r--r-- | tutorial/src/progressbin/imp.rs | 2 | ||||
-rw-r--r-- | tutorial/src/rgb2gray/imp.rs | 2 | ||||
-rw-r--r-- | tutorial/src/sinesrc/imp.rs | 2 | ||||
-rw-r--r-- | tutorial/tutorial-1.md | 3 | ||||
-rw-r--r-- | tutorial/tutorial-2.md | 2 |
7 files changed, 6 insertions, 8 deletions
diff --git a/tutorial/Cargo.toml b/tutorial/Cargo.toml index 4c74cb9c9..b24ced20d 100644 --- a/tutorial/Cargo.toml +++ b/tutorial/Cargo.toml @@ -15,7 +15,6 @@ gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } byte-slice-cast = "1.0" num-traits = "0.2" -once_cell = "1.0" [lib] name = "gstrstutorial" diff --git a/tutorial/src/identity/imp.rs b/tutorial/src/identity/imp.rs index 7b26806cf..e5599bb36 100644 --- a/tutorial/src/identity/imp.rs +++ b/tutorial/src/identity/imp.rs @@ -12,7 +12,7 @@ use gst::glib; use gst::prelude::*; use gst::subclass::prelude::*; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; // This module contains the private implementation details of our element diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs index eee52691a..72bdd5285 100644 --- a/tutorial/src/progressbin/imp.rs +++ b/tutorial/src/progressbin/imp.rs @@ -13,7 +13,7 @@ use gst::prelude::*; use gst::subclass::prelude::*; use std::sync::Mutex; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; use super::ProgressBinOutput; diff --git a/tutorial/src/rgb2gray/imp.rs b/tutorial/src/rgb2gray/imp.rs index 63201fc81..e11fe37bc 100644 --- a/tutorial/src/rgb2gray/imp.rs +++ b/tutorial/src/rgb2gray/imp.rs @@ -16,7 +16,7 @@ use gst_video::subclass::prelude::*; use std::sync::Mutex; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; // This module contains the private implementation details of our element // diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 8e70e9ef5..d2e98c3df 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -24,7 +24,7 @@ use std::u32; use num_traits::cast::NumCast; use num_traits::float::Float; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; // This module contains the private implementation details of our element diff --git a/tutorial/tutorial-1.md b/tutorial/tutorial-1.md index e2ad35433..faa45621e 100644 --- a/tutorial/tutorial-1.md +++ b/tutorial/tutorial-1.md @@ -43,7 +43,6 @@ description = "Rust Tutorial Plugin" gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -once_cell = "1.0" [lib] name = "gstrstutorial" @@ -151,7 +150,7 @@ use gst_base::subclass::prelude::*; use std::i32; use std::sync::Mutex; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; ``` GStreamer is based on the GLib object system ([GObject](https://developer.gnome.org/gobject/stable/)). C (just like Rust) does not have built-in support for object orientated programming, inheritance, virtual methods and related concepts, and GObject makes these features available in C as a library. Without language support this is a quite verbose endeavour in C, and the `glib` crate tries to expose all this in a (as much as possible) Rust-style API while hiding all the details that do not really matter. diff --git a/tutorial/tutorial-2.md b/tutorial/tutorial-2.md index 9b341e14b..73bae762b 100644 --- a/tutorial/tutorial-2.md +++ b/tutorial/tutorial-2.md @@ -37,7 +37,7 @@ use std::{i32, u32}; use num_traits::cast::NumCast; use num_traits::float::Float; -use once_cell::sync::Lazy; +use gst::glib::once_cell::sync::Lazy; static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { gst::DebugCategory::new( |