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

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-11-22 18:43:59 +0300
committerSebastian Dröge <sebastian@centricular.com>2020-11-23 11:28:33 +0300
commit3c9f1c0d1db7b5e7a2574103b7e489e2b4ae61d9 (patch)
treec094ae6ddf812e6be376658f30b88e07ace390ec /net
parent1c9c22df0c6a6aeb7071f52efbba03d8f1d9a2cd (diff)
net: Update to 2018 edition
Diffstat (limited to 'net')
-rw-r--r--net/reqwest/Cargo.toml6
-rw-r--r--net/reqwest/src/lib.rs10
-rw-r--r--net/reqwest/src/reqwesthttpsrc/imp.rs22
-rw-r--r--net/reqwest/src/reqwesthttpsrc/mod.rs2
-rw-r--r--net/reqwest/tests/reqwesthttpsrc.rs1
-rw-r--r--net/rusoto/Cargo.toml5
-rw-r--r--net/rusoto/src/aws_transcriber/imp.rs6
-rw-r--r--net/rusoto/src/aws_transcriber/mod.rs2
-rw-r--r--net/rusoto/src/lib.rs10
-rw-r--r--net/rusoto/src/s3sink/imp.rs13
-rw-r--r--net/rusoto/src/s3sink/mod.rs2
-rw-r--r--net/rusoto/src/s3src/imp.rs12
-rw-r--r--net/rusoto/src/s3src/mod.rs2
-rw-r--r--net/rusoto/src/s3utils.rs9
14 files changed, 50 insertions, 52 deletions
diff --git a/net/reqwest/Cargo.toml b/net/reqwest/Cargo.toml
index cc9a6b6e..7dc52731 100644
--- a/net/reqwest/Cargo.toml
+++ b/net/reqwest/Cargo.toml
@@ -14,10 +14,10 @@ reqwest = { version = "0.10", features = ["cookies", "gzip"] }
futures = "0.3"
hyperx = "1.0"
mime = "0.3"
-gstreamer = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_10"] }
-gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
+gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_10"] }
+gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
tokio = { version = "0.2", features = ["time", "rt-threaded"] }
-lazy_static = "1.0"
+once_cell = "1.0"
[dev-dependencies]
hyper = "0.13"
diff --git a/net/reqwest/src/lib.rs b/net/reqwest/src/lib.rs
index f7bc6ce6..8fa429f8 100644
--- a/net/reqwest/src/lib.rs
+++ b/net/reqwest/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_base as gst_base;
-#[macro_use]
-extern crate lazy_static;
-
mod reqwesthttpsrc;
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
reqwesthttpsrc::register(plugin)
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
reqwest,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs
index b3a47a68..746a2ab2 100644
--- a/net/reqwest/src/reqwesthttpsrc/imp.rs
+++ b/net/reqwest/src/reqwesthttpsrc/imp.rs
@@ -15,10 +15,13 @@ use reqwest::{Client, Response, StatusCode};
use tokio::runtime;
use url::Url;
+use once_cell::sync::Lazy;
+
use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_error, gst_error_msg, gst_trace, gst_warning};
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
@@ -172,7 +175,7 @@ static PROPERTIES: [subclass::Property; 11] = [
const REQWEST_CLIENT_CONTEXT: &str = "gst.reqwest.client";
-#[derive(Clone, Debug, GBoxed)]
+#[derive(Clone, Debug, glib::GBoxed)]
#[gboxed(type_name = "ReqwestClientContext")]
struct ClientContext(Arc<ClientContextInner>);
@@ -213,19 +216,22 @@ pub struct ReqwestHttpSrc {
canceller: Mutex<Option<future::AbortHandle>>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"reqwesthttpsrc",
gst::DebugColorFlags::empty(),
Some("Rust HTTP source"),
- );
- static ref RUNTIME: runtime::Runtime = runtime::Builder::new()
+ )
+});
+
+static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
+ runtime::Builder::new()
.threaded_scheduler()
.enable_all()
.core_threads(1)
.build()
- .unwrap();
-}
+ .unwrap()
+});
impl ReqwestHttpSrc {
fn set_location(
@@ -1095,7 +1101,7 @@ impl ObjectSubclass for ReqwestHttpSrc {
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/net/reqwest/src/reqwesthttpsrc/mod.rs b/net/reqwest/src/reqwesthttpsrc/mod.rs
index 701f97a6..8d8d07c7 100644
--- a/net/reqwest/src/reqwesthttpsrc/mod.rs
+++ b/net/reqwest/src/reqwesthttpsrc/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct ReqwestHttpSrc(ObjectSubclass<imp::ReqwestHttpSrc>) @extends gst_base::PushSrc, gst_base::BaseSrc, gst::Element, gst::Object, @implements gst::URIHandler;
}
diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs
index 661a3c32..713aaf97 100644
--- a/net/reqwest/tests/reqwesthttpsrc.rs
+++ b/net/reqwest/tests/reqwesthttpsrc.rs
@@ -7,7 +7,6 @@
// except according to those terms.
use gst::prelude::*;
-use gstreamer as gst;
use std::sync::mpsc;
diff --git a/net/rusoto/Cargo.toml b/net/rusoto/Cargo.toml
index aecee5e9..a9d5bf40 100644
--- a/net/rusoto/Cargo.toml
+++ b/net/rusoto/Cargo.toml
@@ -13,8 +13,8 @@ edition = "2018"
bytes = "0.5"
futures = "0.3"
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"] }
+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"] }
rusoto_core = "0.45"
rusoto_s3 = "0.45"
rusoto_credential = "0.45"
@@ -22,7 +22,6 @@ rusoto_signature = "0.45"
url = "2"
percent-encoding = "2"
tokio = { version = "0.2", features = [ "rt-threaded" ] }
-lazy_static = "1.0"
async-tungstenite = { version = "0.9", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
nom = "5.1.1"
crc = "1.8.1"
diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs
index 4c85580f..5378acb6 100644
--- a/net/rusoto/src/aws_transcriber/imp.rs
+++ b/net/rusoto/src/aws_transcriber/imp.rs
@@ -20,6 +20,10 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{
+ gst_debug, gst_element_error, gst_error, gst_error_msg, gst_info, gst_log, gst_loggable_error,
+ gst_warning,
+};
use std::default::Default;
@@ -997,7 +1001,7 @@ impl ObjectSubclass for Transcriber {
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/net/rusoto/src/aws_transcriber/mod.rs b/net/rusoto/src/aws_transcriber/mod.rs
index f28f8644..5e2260c0 100644
--- a/net/rusoto/src/aws_transcriber/mod.rs
+++ b/net/rusoto/src/aws_transcriber/mod.rs
@@ -20,7 +20,7 @@ use glib::prelude::*;
mod imp;
mod packet;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Transcriber(ObjectSubclass<imp::Transcriber>) @extends gst::Element, gst::Object;
}
diff --git a/net/rusoto/src/lib.rs b/net/rusoto/src/lib.rs
index 359ef1f6..cee007cc 100644
--- a/net/rusoto/src/lib.rs
+++ b/net/rusoto/src/lib.rs
@@ -6,14 +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 aws_transcriber;
mod s3sink;
mod s3src;
@@ -28,7 +20,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
Ok(())
}
-gst_plugin_define!(
+gst::gst_plugin_define!(
rusoto,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/net/rusoto/src/s3sink/imp.rs b/net/rusoto/src/s3sink/imp.rs
index 44fe1da8..acc1be21 100644
--- a/net/rusoto/src/s3sink/imp.rs
+++ b/net/rusoto/src/s3sink/imp.rs
@@ -12,6 +12,7 @@ use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_element_error, gst_error, gst_error_msg, gst_info, gst_trace};
use gst_base::subclass::prelude::*;
@@ -22,6 +23,8 @@ use rusoto_s3::{
CreateMultipartUploadRequest, S3Client, UploadPartRequest, S3,
};
+use once_cell::sync::Lazy;
+
use std::convert::From;
use std::str::FromStr;
use std::sync::Mutex;
@@ -93,13 +96,13 @@ pub struct S3Sink {
canceller: Mutex<Option<future::AbortHandle>>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"rusotos3sink",
gst::DebugColorFlags::empty(),
Some("Amazon S3 Sink"),
- );
-}
+ )
+});
impl Default for Settings {
fn default() -> Self {
@@ -386,7 +389,7 @@ impl ObjectSubclass for S3Sink {
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/net/rusoto/src/s3sink/mod.rs b/net/rusoto/src/s3sink/mod.rs
index 40b6cd93..60bd3f71 100644
--- a/net/rusoto/src/s3sink/mod.rs
+++ b/net/rusoto/src/s3sink/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct S3Sink(ObjectSubclass<imp::S3Sink>) @extends gst_base::BaseSink, gst::Element, gst::Object;
}
diff --git a/net/rusoto/src/s3src/imp.rs b/net/rusoto/src/s3src/imp.rs
index 70cfee7a..5cc324c0 100644
--- a/net/rusoto/src/s3src/imp.rs
+++ b/net/rusoto/src/s3src/imp.rs
@@ -10,6 +10,7 @@ use std::sync::Mutex;
use bytes::Bytes;
use futures::future;
+use once_cell::sync::Lazy;
use rusoto_s3::*;
use glib::prelude::*;
@@ -17,6 +18,7 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_error, gst_error_msg, gst_info};
use gst_base::prelude::*;
use gst_base::subclass::base_src::CreateSuccess;
@@ -41,13 +43,13 @@ pub struct S3Src {
canceller: Mutex<Option<future::AbortHandle>>,
}
-lazy_static! {
- static ref CAT: gst::DebugCategory = gst::DebugCategory::new(
+static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"rusotos3src",
gst::DebugColorFlags::empty(),
Some("Amazon S3 Source"),
- );
-}
+ )
+});
static PROPERTIES: [subclass::Property; 1] = [subclass::Property("uri", |name| {
glib::ParamSpec::string(
@@ -211,7 +213,7 @@ impl ObjectSubclass for S3Src {
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/net/rusoto/src/s3src/mod.rs b/net/rusoto/src/s3src/mod.rs
index 04968fea..d05cd54a 100644
--- a/net/rusoto/src/s3src/mod.rs
+++ b/net/rusoto/src/s3src/mod.rs
@@ -10,7 +10,7 @@ use glib::prelude::*;
mod imp;
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct S3Src(ObjectSubclass<imp::S3Src>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
}
diff --git a/net/rusoto/src/s3utils.rs b/net/rusoto/src/s3utils.rs
index 43c4af42..6614c505 100644
--- a/net/rusoto/src/s3utils.rs
+++ b/net/rusoto/src/s3utils.rs
@@ -9,19 +9,20 @@
use bytes::{buf::BufMut, Bytes, BytesMut};
use futures::stream::TryStreamExt;
use futures::{future, Future};
+use once_cell::sync::Lazy;
use rusoto_core::ByteStream;
use std::sync::Mutex;
use tokio::runtime;
-lazy_static! {
- static ref RUNTIME: runtime::Runtime = runtime::Builder::new()
+static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
+ runtime::Builder::new()
.threaded_scheduler()
.enable_all()
.core_threads(2)
.thread_name("gst-rusoto-runtime")
.build()
- .unwrap();
-}
+ .unwrap()
+});
pub enum WaitError<E> {
Cancelled,