Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/cdg/Cargo.toml12
-rw-r--r--video/cdg/src/cdgdec/imp.rs11
-rw-r--r--video/cdg/src/cdgdec/mod.rs2
-rw-r--r--video/cdg/src/cdgparse/imp.rs14
-rw-r--r--video/cdg/src/cdgparse/mod.rs2
-rw-r--r--video/cdg/src/lib.rs11
-rw-r--r--video/cdg/tests/cdgdec.rs3
-rw-r--r--video/closedcaption/Cargo.toml3
-rw-r--r--video/closedcaption/src/ccdetect/imp.rs13
-rw-r--r--video/closedcaption/src/ccdetect/mod.rs2
-rw-r--r--video/closedcaption/src/cea608overlay/imp.rs23
-rw-r--r--video/closedcaption/src/cea608overlay/mod.rs2
-rw-r--r--video/closedcaption/src/cea608tott/imp.rs13
-rw-r--r--video/closedcaption/src/cea608tott/mod.rs2
-rw-r--r--video/closedcaption/src/lib.rs13
-rw-r--r--video/closedcaption/src/mcc_enc/imp.rs13
-rw-r--r--video/closedcaption/src/mcc_enc/mod.rs2
-rw-r--r--video/closedcaption/src/mcc_parse/imp.rs24
-rw-r--r--video/closedcaption/src/mcc_parse/mod.rs2
-rw-r--r--video/closedcaption/src/scc_enc/imp.rs21
-rw-r--r--video/closedcaption/src/scc_enc/mod.rs2
-rw-r--r--video/closedcaption/src/scc_parse/imp.rs21
-rw-r--r--video/closedcaption/src/scc_parse/mod.rs2
-rw-r--r--video/closedcaption/src/tttocea608/imp.rs16
-rw-r--r--video/closedcaption/src/tttocea608/mod.rs5
-rw-r--r--video/closedcaption/tests/ccdetect.rs5
-rw-r--r--video/closedcaption/tests/cea608tott.rs5
-rw-r--r--video/closedcaption/tests/mcc_enc.rs5
-rw-r--r--video/closedcaption/tests/mcc_parse.rs4
-rw-r--r--video/closedcaption/tests/scc_enc.rs3
-rw-r--r--video/closedcaption/tests/scc_parse.rs4
-rw-r--r--video/closedcaption/tests/tttocea608.rs3
-rw-r--r--video/dav1d/Cargo.toml8
-rw-r--r--video/dav1d/src/dav1ddec/imp.rs13
-rw-r--r--video/dav1d/src/dav1ddec/mod.rs2
-rw-r--r--video/dav1d/src/lib.rs12
-rw-r--r--video/flavors/Cargo.toml6
-rw-r--r--video/flavors/src/flvdemux/imp.rs29
-rw-r--r--video/flavors/src/flvdemux/mod.rs2
-rw-r--r--video/flavors/src/lib.rs11
-rw-r--r--video/gif/Cargo.toml8
-rw-r--r--video/gif/examples/testvideosrc2gif.rs1
-rw-r--r--video/gif/src/gifenc/imp.rs3
-rw-r--r--video/gif/src/gifenc/mod.rs2
-rw-r--r--video/gif/src/lib.rs8
-rw-r--r--video/gif/tests/gifenc.rs7
-rw-r--r--video/rav1e/Cargo.toml10
-rw-r--r--video/rav1e/src/lib.rs10
-rw-r--r--video/rav1e/src/rav1enc/imp.rs12
-rw-r--r--video/rav1e/src/rav1enc/mod.rs2
-rw-r--r--video/rav1e/tests/rav1enc.rs6
-rw-r--r--video/rspng/Cargo.toml4
52 files changed, 189 insertions, 230 deletions
diff --git a/video/cdg/Cargo.toml b/video/cdg/Cargo.toml
index 604a5b03f..e5c73207c 100644
--- a/video/cdg/Cargo.toml
+++ b/video/cdg/Cargo.toml
@@ -9,15 +9,17 @@ edition = "2018"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
-gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
-gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
-gstreamer-app = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
+gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
+gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
cdg = "0.1"
cdg_renderer = "0.6"
image = { version = "0.23", default-features = false }
muldiv = "1.0"
-lazy_static = "1.0"
+once_cell = "1.0"
+
+[dev-dependencies]
+gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
[lib]
name = "gstcdg"
diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs
index 2a2365d1c..da43e502a 100644
--- a/video/cdg/src/cdgdec/imp.rs
+++ b/video/cdg/src/cdgdec/imp.rs
@@ -9,18 +9,19 @@
use glib::subclass;
use glib::subclass::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error};
use gst_video::prelude::VideoDecoderExtManual;
use gst_video::prelude::*;
use gst_video::subclass::prelude::*;
use image::GenericImageView;
+use once_cell::sync::Lazy;
use std::sync::Mutex;
use crate::constants::{CDG_HEIGHT, CDG_WIDTH};
-lazy_static! {
- static ref CAT: gst::DebugCategory =
- gst::DebugCategory::new("cdgdec", gst::DebugColorFlags::empty(), Some("CDG decoder"),);
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new("cdgdec", gst::DebugColorFlags::empty(), Some("CDG decoder"))
+});
pub struct CdgDec {
cdg_inter: Mutex<Box<cdg_renderer::CdgInterpreter>>,
@@ -34,7 +35,7 @@ impl ObjectSubclass for CdgDec {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self {
diff --git a/video/cdg/src/cdgdec/mod.rs b/video/cdg/src/cdgdec/mod.rs
index daf17cb42..54ad3ed72 100644
--- a/video/cdg/src/cdgdec/mod.rs
+++ b/video/cdg/src/cdgdec/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct CdgDec(ObjectSubclass<imp::CdgDec>) @extends gst_video::VideoDecoder, gst::Element, gst::Object;
}
diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs
index 7b564a5a1..f49286384 100644
--- a/video/cdg/src/cdgparse/imp.rs
+++ b/video/cdg/src/cdgparse/imp.rs
@@ -8,11 +8,13 @@
use glib::subclass;
use glib::subclass::prelude::*;
+use gst::format::Bytes;
use gst::subclass::prelude::*;
use gst::SECOND_VAL;
+use gst::{gst_debug, gst_element_error};
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
-use gstreamer::format::Bytes;
+use once_cell::sync::Lazy;
use std::convert::TryInto;
use crate::constants::{
@@ -25,13 +27,13 @@ const CDG_CMD_MEMORY_LOAD_COLOR_TABLE_2: u8 = 31;
pub struct CdgParse;
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"cdgparse",
gst::DebugColorFlags::empty(),
Some("CDG parser"),
- );
-}
+ )
+});
impl ObjectSubclass for CdgParse {
const NAME: &'static str = "CdgParse";
@@ -40,7 +42,7 @@ impl ObjectSubclass for CdgParse {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self
diff --git a/video/cdg/src/cdgparse/mod.rs b/video/cdg/src/cdgparse/mod.rs
index 10cac351f..b5e594d97 100644
--- a/video/cdg/src/cdgparse/mod.rs
+++ b/video/cdg/src/cdgparse/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct CdgParse(ObjectSubclass<imp::CdgParse>) @extends gst_base::BaseParse, gst::Element, gst::Object;
}
diff --git a/video/cdg/src/lib.rs b/video/cdg/src/lib.rs
index c5e5bb513..59b2a5106 100644
--- a/video/cdg/src/lib.rs
+++ b/video/cdg/src/lib.rs
@@ -6,15 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate gstreamer_base as gst_base;
-extern crate gstreamer_video as gst_video;
-#[macro_use]
-extern crate lazy_static;
-
mod cdgdec;
mod cdgparse;
mod constants;
@@ -27,7 +18,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(())
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
cdg,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/cdg/tests/cdgdec.rs b/video/cdg/tests/cdgdec.rs
index c43ffa4fd..9dd8b1a2e 100644
--- a/video/cdg/tests/cdgdec.rs
+++ b/video/cdg/tests/cdgdec.rs
@@ -6,9 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-extern crate gstreamer as gst;
-extern crate gstreamer_app as gst_app;
-
use gst::prelude::*;
use std::path::PathBuf;
diff --git a/video/closedcaption/Cargo.toml b/video/closedcaption/Cargo.toml
index 20ca30a14..edd3dad19 100644
--- a/video/closedcaption/Cargo.toml
+++ b/video/closedcaption/Cargo.toml
@@ -13,10 +13,9 @@ nom = "6.0"
either = "1"
uuid = { version = "0.8", features = ["v4"] }
chrono = "0.4"
-lazy_static = "1.2"
+once_cell = "1.0"
atomic_refcell = "0.1"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs", features=["use_glib"] }
-cairo-sys-rs = { git = "https://github.com/gtk-rs/gtk-rs" }
pango = { git = "https://github.com/gtk-rs/gtk-rs" }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs" }
byteorder = "1"
diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs
index 3f38998cf..5ac43309d 100644
--- a/video/closedcaption/src/ccdetect/imp.rs
+++ b/video/closedcaption/src/ccdetect/imp.rs
@@ -19,21 +19,24 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_element_error, gst_element_warning, gst_loggable_error, gst_trace, gst_warning};
use gst_base::subclass::prelude::*;
use byteorder::{BigEndian, ByteOrder};
+use once_cell::sync::Lazy;
+
use std::fmt;
use std::sync::Mutex;
use std::u64;
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"ccdetect",
gst::DebugColorFlags::empty(),
Some("Closed Caption Detection"),
- );
-}
+ )
+});
const DEFAULT_WINDOW: u64 = 10 * gst::SECOND_VAL;
const DEFAULT_CC608: bool = false;
@@ -387,7 +390,7 @@ impl ObjectSubclass for CCDetect {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self {
diff --git a/video/closedcaption/src/ccdetect/mod.rs b/video/closedcaption/src/ccdetect/mod.rs
index 11a82b86b..681ec6ff5 100644
--- a/video/closedcaption/src/ccdetect/mod.rs
+++ b/video/closedcaption/src/ccdetect/mod.rs
@@ -19,7 +19,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct CCDetect(ObjectSubclass<imp::CCDetect>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs
index e55c16c8c..61f6a9899 100644
--- a/video/closedcaption/src/cea608overlay/imp.rs
+++ b/video/closedcaption/src/cea608overlay/imp.rs
@@ -19,23 +19,24 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_element_error, gst_error, gst_log, gst_trace};
use gst_video::prelude::*;
+use once_cell::sync::Lazy;
+
use std::sync::Mutex;
use pango::prelude::*;
use crate::caption_frame::{CaptionFrame, Status};
-lazy_static! {
- static ref CAT: gst::DebugCategory = {
- gst::DebugCategory::new(
- "cea608overlay",
- gst::DebugColorFlags::empty(),
- Some("CEA 608 overlay element"),
- )
- };
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
+ "cea608overlay",
+ gst::DebugColorFlags::empty(),
+ Some("CEA 608 overlay element"),
+ )
+});
struct State {
video_info: Option<gst_video::VideoInfo>,
@@ -209,7 +210,7 @@ impl Cea608Overlay {
// anymore mutably.
unsafe {
assert_eq!(
- cairo_sys::cairo_surface_get_reference_count(surface.to_raw_none()),
+ cairo::ffi::cairo_surface_get_reference_count(surface.to_raw_none()),
1
);
let buffer = glib::translate::from_glib_none(buffer_ptr);
@@ -391,7 +392,7 @@ impl ObjectSubclass for Cea608Overlay {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/cea608overlay/mod.rs b/video/closedcaption/src/cea608overlay/mod.rs
index 54669bf3e..ca84bdd44 100644
--- a/video/closedcaption/src/cea608overlay/mod.rs
+++ b/video/closedcaption/src/cea608overlay/mod.rs
@@ -25,7 +25,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Cea608Overlay(ObjectSubclass<imp::Cea608Overlay>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs
index 6dbc36ace..68aee6c0b 100644
--- a/video/closedcaption/src/cea608tott/imp.rs
+++ b/video/closedcaption/src/cea608tott/imp.rs
@@ -10,10 +10,13 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_error, gst_log, gst_trace};
use crate::caption_frame::{CaptionFrame, Status};
use atomic_refcell::AtomicRefCell;
+use once_cell::sync::Lazy;
+
#[derive(Copy, Clone, Debug)]
enum Format {
Srt,
@@ -48,13 +51,13 @@ pub struct Cea608ToTt {
state: AtomicRefCell<State>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"cea608tott",
gst::DebugColorFlags::empty(),
Some("CEA-608 to TT Element"),
- );
-}
+ )
+});
impl Cea608ToTt {
fn sink_chain(
@@ -375,7 +378,7 @@ impl ObjectSubclass for Cea608ToTt {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/cea608tott/mod.rs b/video/closedcaption/src/cea608tott/mod.rs
index 51b23dc8a..8690033fa 100644
--- a/video/closedcaption/src/cea608tott/mod.rs
+++ b/video/closedcaption/src/cea608tott/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Cea608ToTt(ObjectSubclass<imp::Cea608ToTt>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/lib.rs b/video/closedcaption/src/lib.rs
index e372d6591..3c6f971c3 100644
--- a/video/closedcaption/src/lib.rs
+++ b/video/closedcaption/src/lib.rs
@@ -17,17 +17,6 @@
#![recursion_limit = "128"]
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gst;
-#[macro_use]
-extern crate lazy_static;
-
-#[cfg(test)]
-#[macro_use]
-extern crate pretty_assertions;
-
#[allow(non_camel_case_types, non_upper_case_globals, unused)]
#[allow(clippy::redundant_static_lifetimes, clippy::unreadable_literal)]
#[allow(clippy::useless_transmute, clippy::trivially_copy_pass_by_ref)]
@@ -57,7 +46,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(())
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rsclosedcaption,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs
index 243a0796e..786d52c02 100644
--- a/video/closedcaption/src/mcc_enc/imp.rs
+++ b/video/closedcaption/src/mcc_enc/imp.rs
@@ -21,10 +21,13 @@ use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::structure;
use gst::subclass::prelude::*;
+use gst::{gst_element_error, gst_error, gst_log, gst_trace};
use chrono::prelude::*;
use uuid::Uuid;
+use once_cell::sync::Lazy;
+
use std::io::Write;
use std::sync::Mutex;
@@ -94,13 +97,13 @@ pub struct MccEnc {
settings: Mutex<Settings>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"mccenc",
gst::DebugColorFlags::empty(),
Some("Mcc Encoder Element"),
- );
-}
+ )
+});
impl MccEnc {
#[allow(clippy::write_with_newline)]
@@ -470,7 +473,7 @@ impl ObjectSubclass for MccEnc {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/mcc_enc/mod.rs b/video/closedcaption/src/mcc_enc/mod.rs
index f3c1f0d30..6bb606eab 100644
--- a/video/closedcaption/src/mcc_enc/mod.rs
+++ b/video/closedcaption/src/mcc_enc/mod.rs
@@ -20,7 +20,7 @@ use glib::prelude::*;
mod headers;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct MccEnc(ObjectSubclass<imp::MccEnc>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs
index 953b70f3c..945461e89 100644
--- a/video/closedcaption/src/mcc_parse/imp.rs
+++ b/video/closedcaption/src/mcc_parse/imp.rs
@@ -20,25 +20,29 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{
+ gst_debug, gst_element_error, gst_error, gst_fixme, gst_info, gst_log, gst_loggable_error,
+ gst_trace, gst_warning,
+};
use gst_video::ValidVideoTimeCode;
use std::cmp;
use std::convert::TryInto;
use std::sync::{Mutex, MutexGuard};
+use once_cell::sync::Lazy;
+
use super::parser::{MccLine, MccParser};
use crate::line_reader::LineReader;
use crate::parser_utils::TimeCode;
-lazy_static! {
- static ref CAT: gst::DebugCategory = {
- gst::DebugCategory::new(
- "mccparse",
- gst::DebugColorFlags::empty(),
- Some("Mcc Parser Element"),
- )
- };
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
+ "mccparse",
+ gst::DebugColorFlags::empty(),
+ Some("Mcc Parser Element"),
+ )
+});
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Format {
@@ -1133,7 +1137,7 @@ impl ObjectSubclass for MccParse {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/mcc_parse/mod.rs b/video/closedcaption/src/mcc_parse/mod.rs
index d3ee283e0..7bf4d45b9 100644
--- a/video/closedcaption/src/mcc_parse/mod.rs
+++ b/video/closedcaption/src/mcc_parse/mod.rs
@@ -20,7 +20,7 @@ use glib::prelude::*;
mod imp;
mod parser;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct MccParse(ObjectSubclass<imp::MccParse>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs
index c9c473931..20c86c9b4 100644
--- a/video/closedcaption/src/scc_enc/imp.rs
+++ b/video/closedcaption/src/scc_enc/imp.rs
@@ -21,20 +21,21 @@ use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::structure;
use gst::subclass::prelude::*;
+use gst::{gst_element_error, gst_error, gst_log, gst_trace};
use gst_video::{self, ValidVideoTimeCode};
+use once_cell::sync::Lazy;
+
use std::io::Write;
use std::sync::Mutex;
-lazy_static! {
- static ref CAT: gst::DebugCategory = {
- gst::DebugCategory::new(
- "sccenc",
- gst::DebugColorFlags::empty(),
- Some("Scc Encoder Element"),
- )
- };
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
+ "sccenc",
+ gst::DebugColorFlags::empty(),
+ Some("Scc Encoder Element"),
+ )
+});
#[derive(Debug)]
struct State {
@@ -339,7 +340,7 @@ impl ObjectSubclass for SccEnc {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/scc_enc/mod.rs b/video/closedcaption/src/scc_enc/mod.rs
index 46998d753..ac2154567 100644
--- a/video/closedcaption/src/scc_enc/mod.rs
+++ b/video/closedcaption/src/scc_enc/mod.rs
@@ -20,7 +20,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct SccEnc(ObjectSubclass<imp::SccEnc>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs
index 22a2b4770..a7835dd78 100644
--- a/video/closedcaption/src/scc_parse/imp.rs
+++ b/video/closedcaption/src/scc_parse/imp.rs
@@ -20,22 +20,23 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_error, gst_fixme, gst_log, gst_trace, gst_warning};
use std::sync::{Mutex, MutexGuard};
+use once_cell::sync::Lazy;
+
use super::parser::{SccLine, SccParser};
use crate::line_reader::LineReader;
use crate::parser_utils::TimeCode;
-lazy_static! {
- static ref CAT: gst::DebugCategory = {
- gst::DebugCategory::new(
- "sccparse",
- gst::DebugColorFlags::empty(),
- Some("Scc Parser Element"),
- )
- };
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
+ "sccparse",
+ gst::DebugColorFlags::empty(),
+ Some("Scc Parser Element"),
+ )
+});
#[derive(Debug)]
struct State {
@@ -430,7 +431,7 @@ impl ObjectSubclass for SccParse {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/scc_parse/mod.rs b/video/closedcaption/src/scc_parse/mod.rs
index 19cf93f87..05067d6e9 100644
--- a/video/closedcaption/src/scc_parse/mod.rs
+++ b/video/closedcaption/src/scc_parse/mod.rs
@@ -21,7 +21,7 @@ use glib::prelude::*;
mod imp;
mod parser;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct SccParse(ObjectSubclass<imp::SccParse>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs
index 8b2bbc148..e99e2c0e7 100644
--- a/video/closedcaption/src/tttocea608/imp.rs
+++ b/video/closedcaption/src/tttocea608/imp.rs
@@ -20,6 +20,9 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_error, gst_log, gst_trace, gst_warning};
+
+use once_cell::sync::Lazy;
use crate::ffi;
use std::sync::Mutex;
@@ -263,14 +266,15 @@ pub struct TtToCea608 {
settings: Mutex<Settings>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"tttocea608",
gst::DebugColorFlags::empty(),
Some("TT CEA 608 Element"),
- );
- static ref SPACE: u16 = eia608_from_utf8_1(&[0x20, 0, 0, 0, 0]);
-}
+ )
+});
+
+static SPACE: Lazy<u16> = Lazy::new(|| eia608_from_utf8_1(&[0x20, 0, 0, 0, 0]));
impl TtToCea608 {
fn push_gap(&self, last_frame_no: u64, new_frame_no: u64) {
@@ -786,7 +790,7 @@ impl ObjectSubclass for TtToCea608 {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
diff --git a/video/closedcaption/src/tttocea608/mod.rs b/video/closedcaption/src/tttocea608/mod.rs
index 790e71511..e9004fea1 100644
--- a/video/closedcaption/src/tttocea608/mod.rs
+++ b/video/closedcaption/src/tttocea608/mod.rs
@@ -16,11 +16,10 @@
// Boston, MA 02110-1335, USA.
use glib::prelude::*;
-use glib::GEnum;
mod imp;
-#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, GEnum)]
+#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
#[repr(u32)]
#[genum(type_name = "GstTtToCea608Mode")]
enum Mode {
@@ -30,7 +29,7 @@ enum Mode {
RollUp4,
}
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct TtToCea608(ObjectSubclass<imp::TtToCea608>) @extends gst::Element, gst::Object;
}
diff --git a/video/closedcaption/tests/ccdetect.rs b/video/closedcaption/tests/ccdetect.rs
index 0123a4dd9..97c215c4a 100644
--- a/video/closedcaption/tests/ccdetect.rs
+++ b/video/closedcaption/tests/ccdetect.rs
@@ -15,13 +15,12 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
-
use gst::prelude::*;
use std::sync::{Arc, Mutex};
+use pretty_assertions::assert_eq;
+
fn init() {
use std::sync::Once;
static INIT: Once = Once::new();
diff --git a/video/closedcaption/tests/cea608tott.rs b/video/closedcaption/tests/cea608tott.rs
index 4489d6ac6..dc8916669 100644
--- a/video/closedcaption/tests/cea608tott.rs
+++ b/video/closedcaption/tests/cea608tott.rs
@@ -15,11 +15,10 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
-
use gst::prelude::*;
+use pretty_assertions::assert_eq;
+
fn init() {
use std::sync::Once;
static INIT: Once = Once::new();
diff --git a/video/closedcaption/tests/mcc_enc.rs b/video/closedcaption/tests/mcc_enc.rs
index 1fbfe89fd..e0e4d4073 100644
--- a/video/closedcaption/tests/mcc_enc.rs
+++ b/video/closedcaption/tests/mcc_enc.rs
@@ -15,11 +15,10 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
-
use glib::prelude::*;
+use pretty_assertions::assert_eq;
+
fn init() {
use std::sync::Once;
static INIT: Once = Once::new();
diff --git a/video/closedcaption/tests/mcc_parse.rs b/video/closedcaption/tests/mcc_parse.rs
index 0ad06ee92..81cad9227 100644
--- a/video/closedcaption/tests/mcc_parse.rs
+++ b/video/closedcaption/tests/mcc_parse.rs
@@ -15,11 +15,9 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
-
use gst::prelude::*;
use gst::EventView;
+use pretty_assertions::assert_eq;
use rand::{Rng, SeedableRng};
use std::path::PathBuf;
diff --git a/video/closedcaption/tests/scc_enc.rs b/video/closedcaption/tests/scc_enc.rs
index 2115156c4..e5d00c90b 100644
--- a/video/closedcaption/tests/scc_enc.rs
+++ b/video/closedcaption/tests/scc_enc.rs
@@ -16,8 +16,7 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
+use pretty_assertions::assert_eq;
fn init() {
use std::sync::Once;
diff --git a/video/closedcaption/tests/scc_parse.rs b/video/closedcaption/tests/scc_parse.rs
index cbabccdb0..3e0a449f8 100644
--- a/video/closedcaption/tests/scc_parse.rs
+++ b/video/closedcaption/tests/scc_parse.rs
@@ -16,11 +16,9 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
-
use gst::prelude::*;
use gst_video::{ValidVideoTimeCode, VideoTimeCode};
+use pretty_assertions::assert_eq;
use rand::{Rng, SeedableRng};
use std::collections::VecDeque;
diff --git a/video/closedcaption/tests/tttocea608.rs b/video/closedcaption/tests/tttocea608.rs
index 8153a246d..24d91e964 100644
--- a/video/closedcaption/tests/tttocea608.rs
+++ b/video/closedcaption/tests/tttocea608.rs
@@ -15,9 +15,8 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-#[macro_use]
-extern crate pretty_assertions;
use gst::EventView;
+use pretty_assertions::assert_eq;
fn init() {
use std::sync::Once;
diff --git a/video/dav1d/Cargo.toml b/video/dav1d/Cargo.toml
index df6582ab0..476fab14a 100644
--- a/video/dav1d/Cargo.toml
+++ b/video/dav1d/Cargo.toml
@@ -10,10 +10,10 @@ description = "Dav1d Plugin"
[dependencies]
dav1d = "0.5"
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
-lazy_static = "1.0"
+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", features = ["v1_12"] }
+once_cell = "1.0"
[lib]
name = "gstrsdav1d"
diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs
index 3e4983bec..0e43ab2f2 100644
--- a/video/dav1d/src/dav1ddec/imp.rs
+++ b/video/dav1d/src/dav1ddec/imp.rs
@@ -10,9 +10,12 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_error, gst_info, gst_trace, gst_warning};
use gst_video::prelude::*;
use gst_video::subclass::prelude::*;
+use once_cell::sync::Lazy;
+
use std::convert::TryInto;
use std::i32;
use std::str::FromStr;
@@ -30,13 +33,13 @@ pub struct Dav1dDec {
negotiation_infos: Mutex<NegotiationInfos>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"dav1ddec",
gst::DebugColorFlags::empty(),
Some("Dav1d AV1 decoder"),
- );
-}
+ )
+});
impl Dav1dDec {
pub fn gst_video_format_from_dav1d_picture(
@@ -349,7 +352,7 @@ impl ObjectSubclass for Dav1dDec {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self {
diff --git a/video/dav1d/src/dav1ddec/mod.rs b/video/dav1d/src/dav1ddec/mod.rs
index 276fd0893..2576c2378 100644
--- a/video/dav1d/src/dav1ddec/mod.rs
+++ b/video/dav1d/src/dav1ddec/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Dav1dDec(ObjectSubclass<imp::Dav1dDec>) @extends gst_video::VideoDecoder, gst::Element, gst::Object;
}
diff --git a/video/dav1d/src/lib.rs b/video/dav1d/src/lib.rs
index 2567134b7..3f7b9c892 100644
--- a/video/dav1d/src/lib.rs
+++ b/video/dav1d/src/lib.rs
@@ -6,16 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate dav1d;
-extern crate gstreamer_base as gst_base;
-extern crate gstreamer_video as gst_video;
-#[macro_use]
-extern crate lazy_static;
-
mod dav1ddec;
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
@@ -23,7 +13,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(())
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rsdav1d,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/flavors/Cargo.toml b/video/flavors/Cargo.toml
index bb5573ce1..aa2c6ddb4 100644
--- a/video/flavors/Cargo.toml
+++ b/video/flavors/Cargo.toml
@@ -9,14 +9,14 @@ description = "Rust FLV Plugin"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
num-rational = { version = "0.3", default-features = false, features = [] }
nom = "6"
flavors = { git = "https://github.com/rust-av/flavors" }
muldiv = "1.0"
byteorder = "1.0"
-lazy_static = "1.0"
+once_cell = "1.0"
smallvec = "1.0"
[lib]
diff --git a/video/flavors/src/flvdemux/imp.rs b/video/flavors/src/flvdemux/imp.rs
index a4e541178..a907440f1 100644
--- a/video/flavors/src/flvdemux/imp.rs
+++ b/video/flavors/src/flvdemux/imp.rs
@@ -16,20 +16,23 @@ use ::flavors::parser as flavors;
use glib::subclass;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{
+ gst_debug, gst_error, gst_error_msg, gst_log, gst_loggable_error, gst_trace, gst_warning,
+};
use num_rational::Rational32;
+use once_cell::sync::Lazy;
+
use smallvec::SmallVec;
-lazy_static! {
- static ref CAT: gst::DebugCategory = {
- gst::DebugCategory::new(
- "rsflvdemux",
- gst::DebugColorFlags::empty(),
- Some("Rust FLV demuxer"),
- )
- };
-}
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
+ "rsflvdemux",
+ gst::DebugColorFlags::empty(),
+ Some("Rust FLV demuxer"),
+ )
+});
pub struct FlvDemux {
sinkpad: gst::Pad,
@@ -126,7 +129,7 @@ impl ObjectSubclass for FlvDemux {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.get_pad_template("sink").unwrap();
@@ -374,7 +377,7 @@ impl FlvDemux {
}
fn sink_event(&self, pad: &gst::Pad, element: &super::FlvDemux, event: gst::Event) -> bool {
- use crate::gst::EventView;
+ use gst::EventView;
gst_log!(CAT, obj: pad, "Handling event {:?}", event);
match event.view() {
@@ -404,7 +407,7 @@ impl FlvDemux {
element: &super::FlvDemux,
query: &mut gst::QueryRef,
) -> bool {
- use crate::gst::QueryView;
+ use gst::QueryView;
match query.view_mut() {
QueryView::Position(ref mut q) => {
@@ -452,7 +455,7 @@ impl FlvDemux {
}
fn src_event(&self, pad: &gst::Pad, element: &super::FlvDemux, event: gst::Event) -> bool {
- use crate::gst::EventView;
+ use gst::EventView;
match event.view() {
EventView::Seek(..) => {
diff --git a/video/flavors/src/flvdemux/mod.rs b/video/flavors/src/flvdemux/mod.rs
index aca2b41a4..dc1e341d4 100644
--- a/video/flavors/src/flvdemux/mod.rs
+++ b/video/flavors/src/flvdemux/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct FlvDemux(ObjectSubclass<imp::FlvDemux>) @extends gst::Element, gst::Object;
}
diff --git a/video/flavors/src/lib.rs b/video/flavors/src/lib.rs
index 479716ed4..af01fceed 100644
--- a/video/flavors/src/lib.rs
+++ b/video/flavors/src/lib.rs
@@ -6,15 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate gstreamer_base as gst_base;
-
-#[macro_use]
-extern crate lazy_static;
-
mod bytes;
mod flvdemux;
@@ -22,7 +13,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
flvdemux::register(plugin)
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rsflv,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/gif/Cargo.toml b/video/gif/Cargo.toml
index 07995281b..f25283fe3 100644
--- a/video/gif/Cargo.toml
+++ b/video/gif/Cargo.toml
@@ -9,13 +9,15 @@ description = "GStreamer GIF plugin"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-check = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gif = "0.11"
atomic_refcell = "0.1"
once_cell = "1"
+[dev-dependencies]
+gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+
[lib]
name = "gstgif"
crate-type = ["cdylib", "rlib", "staticlib"]
diff --git a/video/gif/examples/testvideosrc2gif.rs b/video/gif/examples/testvideosrc2gif.rs
index 510831448..7f4ef5300 100644
--- a/video/gif/examples/testvideosrc2gif.rs
+++ b/video/gif/examples/testvideosrc2gif.rs
@@ -15,7 +15,6 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
-extern crate gstreamer as gst;
use gst::prelude::*;
const ENCODE_PIPELINE: &str = "videotestsrc is-live=false num-buffers=100 ! videoconvert ! gifenc ! filesink location=test.gif";
diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs
index 962d11560..e6b4598ee 100644
--- a/video/gif/src/gifenc/imp.rs
+++ b/video/gif/src/gifenc/imp.rs
@@ -10,6 +10,7 @@ use atomic_refcell::AtomicRefCell;
use glib::subclass;
use glib::subclass::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_loggable_error};
use gst_video::prelude::*;
use gst_video::subclass::prelude::*;
use once_cell::sync::Lazy;
@@ -148,7 +149,7 @@ impl ObjectSubclass for GifEnc {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self {
diff --git a/video/gif/src/gifenc/mod.rs b/video/gif/src/gifenc/mod.rs
index 40543d41d..e53d2b1cc 100644
--- a/video/gif/src/gifenc/mod.rs
+++ b/video/gif/src/gifenc/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct GifEnc(ObjectSubclass<imp::GifEnc>) @extends gst_video::VideoEncoder, gst::Element, gst::Object;
}
diff --git a/video/gif/src/lib.rs b/video/gif/src/lib.rs
index 7b14fbd0c..7e0903389 100644
--- a/video/gif/src/lib.rs
+++ b/video/gif/src/lib.rs
@@ -6,19 +6,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate gstreamer_video as gst_video;
-
mod gifenc;
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gifenc::register(plugin)
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
gifenc,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/gif/tests/gifenc.rs b/video/gif/tests/gifenc.rs
index 11a6975d7..65d4d1704 100644
--- a/video/gif/tests/gifenc.rs
+++ b/video/gif/tests/gifenc.rs
@@ -6,13 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-extern crate glib;
-extern crate gstreamer as gst;
-extern crate gstreamer_check as gst_check;
-extern crate gstreamer_video as gst_video;
-
-extern crate gstgif;
-
fn init() {
use std::sync::Once;
static INIT: Once = Once::new();
diff --git a/video/rav1e/Cargo.toml b/video/rav1e/Cargo.toml
index 5ed1db609..8e0d2f30f 100644
--- a/video/rav1e/Cargo.toml
+++ b/video/rav1e/Cargo.toml
@@ -9,12 +9,14 @@ edition = "2018"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gstreamer-video = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
-gstreamer-check = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_12"] }
rav1e = { version = "0.3", default-features = false }
atomic_refcell = "0.1"
-lazy_static = "1.0"
+once_cell = "1.0"
+
+[dev-dependencies]
+gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
[lib]
name = "gstrav1e"
diff --git a/video/rav1e/src/lib.rs b/video/rav1e/src/lib.rs
index 452ee2f2c..0dcb12f3c 100644
--- a/video/rav1e/src/lib.rs
+++ b/video/rav1e/src/lib.rs
@@ -6,21 +6,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate gstreamer_video as gst_video;
-#[macro_use]
-extern crate lazy_static;
-
mod rav1enc;
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
rav1enc::register(plugin)
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rav1e,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs
index 0a46eacb8..f28bd99e2 100644
--- a/video/rav1e/src/rav1enc/imp.rs
+++ b/video/rav1e/src/rav1enc/imp.rs
@@ -10,8 +10,10 @@ use atomic_refcell::AtomicRefCell;
use glib::subclass;
use glib::subclass::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_loggable_error};
use gst_video::prelude::*;
use gst_video::subclass::prelude::*;
+use once_cell::sync::Lazy;
use rav1e::color;
use rav1e::config;
use rav1e::data;
@@ -286,13 +288,13 @@ pub struct Rav1Enc {
settings: Mutex<Settings>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"rav1enc",
gst::DebugColorFlags::empty(),
Some("rav1e AV1 encoder"),
- );
-}
+ )
+});
impl ObjectSubclass for Rav1Enc {
const NAME: &'static str = "Rav1Enc";
@@ -301,7 +303,7 @@ impl ObjectSubclass for Rav1Enc {
type Instance = gst::subclass::ElementInstanceStruct<Self>;
type Class = subclass::simple::ClassStruct<Self>;
- glib_object_subclass!();
+ glib::glib_object_subclass!();
fn new() -> Self {
Self {
diff --git a/video/rav1e/src/rav1enc/mod.rs b/video/rav1e/src/rav1enc/mod.rs
index b953bf9f5..a4cc40896 100644
--- a/video/rav1e/src/rav1enc/mod.rs
+++ b/video/rav1e/src/rav1enc/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Rav1Enc(ObjectSubclass<imp::Rav1Enc>) @extends gst_video::VideoEncoder, gst::Element, gst::Object;
}
diff --git a/video/rav1e/tests/rav1enc.rs b/video/rav1e/tests/rav1enc.rs
index ec2591430..40e456ad7 100644
--- a/video/rav1e/tests/rav1enc.rs
+++ b/video/rav1e/tests/rav1enc.rs
@@ -6,13 +6,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-extern crate glib;
use glib::prelude::*;
-extern crate gstreamer as gst;
-extern crate gstreamer_check as gst_check;
-extern crate gstreamer_video as gst_video;
-
-extern crate gstrav1e;
fn init() {
use std::sync::Once;
diff --git a/video/rspng/Cargo.toml b/video/rspng/Cargo.toml
index b7d524469..87a7c4051 100644
--- a/video/rspng/Cargo.toml
+++ b/video/rspng/Cargo.toml
@@ -11,12 +11,14 @@ description = "An PNG encoder/decoder written in pure Rust"
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
-gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
png = "0.16.3"
once_cell = "1"
parking_lot = "0.11"
atomic_refcell = "0.1"
+[dev-dependencies]
+gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+
[lib]
name = "gstrspng"
crate-type = ["cdylib", "rlib", "staticlib"]