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
diff options
context:
space:
mode:
Diffstat (limited to 'generic/file')
-rw-r--r--generic/file/Cargo.toml7
-rw-r--r--generic/file/src/file_location.rs2
-rw-r--r--generic/file/src/filesink/imp.rs15
-rw-r--r--generic/file/src/filesink/mod.rs2
-rw-r--r--generic/file/src/filesrc/imp.rs15
-rw-r--r--generic/file/src/filesrc/mod.rs2
-rw-r--r--generic/file/src/lib.rs11
7 files changed, 21 insertions, 33 deletions
diff --git a/generic/file/Cargo.toml b/generic/file/Cargo.toml
index 9493baf6c..60431ecc5 100644
--- a/generic/file/Cargo.toml
+++ b/generic/file/Cargo.toml
@@ -5,13 +5,14 @@ authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
description = "Rust File Plugin"
+edition = "2018"
[dependencies]
url = "2"
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" }
-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" }
+once_cell = "1.0"
[lib]
name = "gstrsfile"
diff --git a/generic/file/src/file_location.rs b/generic/file/src/file_location.rs
index eca8e579f..22d4c4071 100644
--- a/generic/file/src/file_location.rs
+++ b/generic/file/src/file_location.rs
@@ -1,5 +1,3 @@
-use glib;
-use gst;
use url::Url;
use std::convert::AsRef;
diff --git a/generic/file/src/filesink/imp.rs b/generic/file/src/filesink/imp.rs
index 4a53f5288..2521de95c 100644
--- a/generic/file/src/filesink/imp.rs
+++ b/generic/file/src/filesink/imp.rs
@@ -8,13 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use glib;
use glib::subclass;
use glib::subclass::prelude::*;
-use gst;
use gst::prelude::*;
use gst::subclass::prelude::*;
-use gst_base;
+use gst::{gst_debug, gst_element_error, gst_error, gst_error_msg, gst_info, gst_trace};
use gst_base::subclass::prelude::*;
use std::fs::File;
@@ -66,13 +64,14 @@ pub struct FileSink {
state: Mutex<State>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+use once_cell::sync::Lazy;
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"rsfilesink",
gst::DebugColorFlags::empty(),
Some("File Sink"),
- );
-}
+ )
+});
impl FileSink {
fn set_location(
@@ -124,7 +123,7 @@ impl ObjectSubclass for FileSink {
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/generic/file/src/filesink/mod.rs b/generic/file/src/filesink/mod.rs
index 8ad677156..ac80bd849 100644
--- a/generic/file/src/filesink/mod.rs
+++ b/generic/file/src/filesink/mod.rs
@@ -12,7 +12,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct FileSink(ObjectSubclass<imp::FileSink>) @extends gst_base::BaseSink, gst::Element, gst::Object, @implements gst::URIHandler;
}
diff --git a/generic/file/src/filesrc/imp.rs b/generic/file/src/filesrc/imp.rs
index cc7969aa1..0eb0aa2e6 100644
--- a/generic/file/src/filesrc/imp.rs
+++ b/generic/file/src/filesrc/imp.rs
@@ -7,13 +7,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use glib;
use glib::subclass;
use glib::subclass::prelude::*;
-use gst;
use gst::prelude::*;
use gst::subclass::prelude::*;
-use gst_base;
+use gst::{gst_debug, gst_element_error, gst_error, gst_error_msg, gst_info};
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
@@ -66,13 +64,14 @@ pub struct FileSrc {
state: Mutex<State>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+use once_cell::sync::Lazy;
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"rsfilesrc",
gst::DebugColorFlags::empty(),
Some("File Source"),
- );
-}
+ )
+});
impl FileSrc {
fn set_location(
@@ -138,7 +137,7 @@ impl ObjectSubclass for FileSrc {
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/generic/file/src/filesrc/mod.rs b/generic/file/src/filesrc/mod.rs
index 70ed45de7..5fc15a28f 100644
--- a/generic/file/src/filesrc/mod.rs
+++ b/generic/file/src/filesrc/mod.rs
@@ -11,7 +11,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct FileSrc(ObjectSubclass<imp::FileSrc>) @extends gst_base::BaseSrc, gst::Element, gst::Object, @implements gst::URIHandler;
}
diff --git a/generic/file/src/lib.rs b/generic/file/src/lib.rs
index 2acde3b9d..a3f3e20b2 100644
--- a/generic/file/src/lib.rs
+++ b/generic/file/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 url;
-#[macro_use]
-extern crate lazy_static;
-
mod file_location;
mod filesink;
mod filesrc;
@@ -25,7 +16,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(())
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rsfile,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,