diff --git a/Cargo.toml b/Cargo.toml index f5cba5bf..a7d1565c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "gst-plugin", + "gst-plugin-simple", "gst-plugin-file", "gst-plugin-http", "gst-plugin-flv", diff --git a/gst-plugin-audiofx/Cargo.toml b/gst-plugin-audiofx/Cargo.toml index 62322c94..5b3f6056 100644 --- a/gst-plugin-audiofx/Cargo.toml +++ b/gst-plugin-audiofx/Cargo.toml @@ -2,7 +2,7 @@ name = "gst-plugin-audiofx" version = "0.1.0" authors = ["Sebastian Dröge "] -repository = "https://github.com/sdroege/rsplugin" +repository = "https://github.com/sdroege/gst-plugin-rs" license = "MIT/Apache-2.0" [dependencies] diff --git a/gst-plugin-file/Cargo.toml b/gst-plugin-file/Cargo.toml index 878aec85..7647292d 100644 --- a/gst-plugin-file/Cargo.toml +++ b/gst-plugin-file/Cargo.toml @@ -2,12 +2,13 @@ name = "gst-plugin-file" version = "0.1.0" authors = ["Sebastian Dröge "] -repository = "https://github.com/sdroege/rsplugin" +repository = "https://github.com/sdroege/gst-plugin-rs" license = "MIT/Apache-2.0" [dependencies] url = "1.1" gst-plugin = { path="../gst-plugin" } +gst-plugin-simple = { path="../gst-plugin-simple" } gstreamer = { git = "https://github.com/sdroege/gstreamer-rs", features = ["v1_10"] } [lib] diff --git a/gst-plugin-file/src/filesink.rs b/gst-plugin-file/src/filesink.rs index d9dc707d..bef05e3b 100644 --- a/gst-plugin-file/src/filesink.rs +++ b/gst-plugin-file/src/filesink.rs @@ -14,7 +14,8 @@ use std::io::Write; use std::convert::From; use gst_plugin::error::*; -use gst_plugin::sink::*; +use gst_plugin_simple::sink::*; +use gst_plugin_simple::UriValidator; use gst; use gst::prelude::*; diff --git a/gst-plugin-file/src/filesrc.rs b/gst-plugin-file/src/filesrc.rs index 27b4548f..a739b2c2 100644 --- a/gst-plugin-file/src/filesrc.rs +++ b/gst-plugin-file/src/filesrc.rs @@ -12,7 +12,8 @@ use std::fs::File; use url::Url; use gst_plugin::error::*; -use gst_plugin::source::*; +use gst_plugin_simple::source::*; +use gst_plugin_simple::UriValidator; use gst; use gst::prelude::*; diff --git a/gst-plugin-file/src/lib.rs b/gst-plugin-file/src/lib.rs index a91ec7cb..230ecc84 100644 --- a/gst-plugin-file/src/lib.rs +++ b/gst-plugin-file/src/lib.rs @@ -10,12 +10,13 @@ #[macro_use] extern crate gst_plugin; +extern crate gst_plugin_simple; #[macro_use] extern crate gstreamer as gst; extern crate url; -use gst_plugin::source::*; -use gst_plugin::sink::*; +use gst_plugin_simple::source::*; +use gst_plugin_simple::sink::*; mod filesrc; mod filesink; diff --git a/gst-plugin-flv/Cargo.toml b/gst-plugin-flv/Cargo.toml index cb8f7088..6cd7b889 100644 --- a/gst-plugin-flv/Cargo.toml +++ b/gst-plugin-flv/Cargo.toml @@ -2,12 +2,13 @@ name = "gst-plugin-flv" version = "0.1.0" authors = ["Sebastian Dröge "] -repository = "https://github.com/sdroege/rsplugin" +repository = "https://github.com/sdroege/gst-plugin-rs" license = "MIT/Apache-2.0" [dependencies] url = "1.1" gst-plugin = { path="../gst-plugin" } +gst-plugin-simple = { path="../gst-plugin-simple" } gstreamer = { git = "https://github.com/sdroege/gstreamer-rs", features = ["v1_10"] } num-rational = { version = "0.1", default-features = false, features = [] } nom = "3.0" diff --git a/gst-plugin-flv/src/flvdemux.rs b/gst-plugin-flv/src/flvdemux.rs index 61ba9437..948d8f00 100644 --- a/gst-plugin-flv/src/flvdemux.rs +++ b/gst-plugin-flv/src/flvdemux.rs @@ -15,9 +15,9 @@ use nom::IResult; use flavors::parser as flavors; use gst_plugin::error::*; -use gst_plugin::demuxer::*; use gst_plugin::adapter::*; use gst_plugin::bytes::*; +use gst_plugin_simple::demuxer::*; use muldiv::*; diff --git a/gst-plugin-flv/src/lib.rs b/gst-plugin-flv/src/lib.rs index 567ccc36..50132a6a 100644 --- a/gst-plugin-flv/src/lib.rs +++ b/gst-plugin-flv/src/lib.rs @@ -11,6 +11,7 @@ extern crate flavors; #[macro_use] extern crate gst_plugin; +extern crate gst_plugin_simple; #[macro_use] extern crate gstreamer as gst; extern crate muldiv; @@ -18,7 +19,7 @@ extern crate nom; extern crate num_rational; extern crate url; -use gst_plugin::demuxer::*; +use gst_plugin_simple::demuxer::*; use gst::prelude::*; mod flvdemux; diff --git a/gst-plugin-http/Cargo.toml b/gst-plugin-http/Cargo.toml index 0e340a55..a9182722 100644 --- a/gst-plugin-http/Cargo.toml +++ b/gst-plugin-http/Cargo.toml @@ -2,12 +2,13 @@ name = "gst-plugin-http" version = "0.1.0" authors = ["Sebastian Dröge "] -repository = "https://github.com/sdroege/rsplugin" +repository = "https://github.com/sdroege/gst-plugin-rs" license = "MIT/Apache-2.0" [dependencies] url = "1.1" gst-plugin = { path="../gst-plugin" } +gst-plugin-simple = { path="../gst-plugin-simple" } reqwest = "0.7" gstreamer = { git = "https://github.com/sdroege/gstreamer-rs", features = ["v1_10"] } diff --git a/gst-plugin-http/src/httpsrc.rs b/gst-plugin-http/src/httpsrc.rs index 8758036b..51dfdd01 100644 --- a/gst-plugin-http/src/httpsrc.rs +++ b/gst-plugin-http/src/httpsrc.rs @@ -14,7 +14,8 @@ use reqwest::header::{AcceptRanges, ByteRangeSpec, ContentLength, ContentRange, Range, RangeUnit}; use gst_plugin::error::*; -use gst_plugin::source::*; +use gst_plugin_simple::source::*; +use gst_plugin_simple::UriValidator; use gst; use gst::prelude::*; diff --git a/gst-plugin-http/src/lib.rs b/gst-plugin-http/src/lib.rs index 3ae9ca93..772b2f1e 100644 --- a/gst-plugin-http/src/lib.rs +++ b/gst-plugin-http/src/lib.rs @@ -10,12 +10,13 @@ #[macro_use] extern crate gst_plugin; +extern crate gst_plugin_simple; #[macro_use] extern crate gstreamer as gst; extern crate reqwest; extern crate url; -use gst_plugin::source::*; +use gst_plugin_simple::source::*; mod httpsrc; diff --git a/gst-plugin-simple/Cargo.toml b/gst-plugin-simple/Cargo.toml new file mode 100644 index 00000000..339bb355 --- /dev/null +++ b/gst-plugin-simple/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "gst-plugin-simple" +version = "0.1.0" +authors = ["Sebastian Dröge "] +repository = "https://github.com/sdroege/gst-plugin-rs" +license = "MIT/Apache-2.0" + +[dependencies] +url = "1.1" +glib = { git = "https://github.com/gtk-rs/glib" } +gst-plugin = { path="../gst-plugin" } +gstreamer = { git = "https://github.com/sdroege/gstreamer-rs", features = ["v1_10"] } +gstreamer-base = { git = "https://github.com/sdroege/gstreamer-rs", features = ["v1_10"] } + +[lib] +name = "gst_plugin_simple" +path = "src/lib.rs" diff --git a/gst-plugin/src/demuxer.rs b/gst-plugin-simple/src/demuxer.rs similarity index 99% rename from gst-plugin/src/demuxer.rs rename to gst-plugin-simple/src/demuxer.rs index ab6bb58b..1245685f 100644 --- a/gst-plugin/src/demuxer.rs +++ b/gst-plugin-simple/src/demuxer.rs @@ -12,11 +12,10 @@ use std::u32; use std::u64; use std::collections::BTreeMap; -use error::*; -use object::*; -use element::*; +use gst_plugin::error::*; +use gst_plugin::object::*; +use gst_plugin::element::*; -use glib; use gst; use gst::prelude::*; use gst_base; @@ -274,7 +273,7 @@ impl Demuxer { fn sink_activate(pad: &gst::Pad, _parent: &Option) -> bool { let mode = { - let mut query = gst::Query::new_scheduling(); + let query = gst::Query::new_scheduling(); if !pad.peer_query(query.get_mut().unwrap()) { return false; } @@ -352,7 +351,7 @@ impl Demuxer { let demuxer = element.get_impl().downcast_ref::().unwrap(); if active { - let mut query = gst::Query::new_duration(gst::Format::Bytes); + let query = gst::Query::new_duration(gst::Format::Bytes); let upstream_size = if demuxer.sinkpad.peer_query(query.get_mut().unwrap()) { use gst::QueryView; diff --git a/gst-plugin-simple/src/lib.rs b/gst-plugin-simple/src/lib.rs new file mode 100644 index 00000000..97d07609 --- /dev/null +++ b/gst-plugin-simple/src/lib.rs @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Sebastian Dröge +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate glib; +#[macro_use] +extern crate gstreamer as gst; +extern crate gstreamer_base as gst_base; +#[macro_use] +extern crate gst_plugin; + +extern crate url; + +pub mod source; +pub mod sink; +pub mod demuxer; + +pub type UriValidator = Fn(&url::Url) -> Result<(), gst_plugin::error::UriError> + Send + Sync + 'static; diff --git a/gst-plugin/src/sink.rs b/gst-plugin-simple/src/sink.rs similarity index 97% rename from gst-plugin/src/sink.rs rename to gst-plugin-simple/src/sink.rs index aa34ab76..dbceae3b 100644 --- a/gst-plugin/src/sink.rs +++ b/gst-plugin-simple/src/sink.rs @@ -10,20 +10,21 @@ use std::sync::Mutex; use url::Url; -use error::*; - use glib; use gst; use gst::prelude::*; use gst_base; use gst_base::prelude::*; -use object::*; -use element::*; -use base_sink::*; -use uri_handler::*; +use gst_plugin::object::*; +use gst_plugin::element::*; +use gst_plugin::base_sink::*; +use gst_plugin::uri_handler::*; +use gst_plugin::error::*; -pub use base_sink::RsBaseSink; +pub use gst_plugin::base_sink::RsBaseSink; + +use UriValidator; pub trait SinkImpl: Send + 'static { fn uri_validator(&self) -> Box; diff --git a/gst-plugin/src/source.rs b/gst-plugin-simple/src/source.rs similarity index 98% rename from gst-plugin/src/source.rs rename to gst-plugin-simple/src/source.rs index ef5b4f71..b253f83d 100644 --- a/gst-plugin/src/source.rs +++ b/gst-plugin-simple/src/source.rs @@ -12,20 +12,21 @@ use std::sync::Mutex; use url::Url; -use error::*; - use glib; use gst; use gst::prelude::*; use gst_base; use gst_base::prelude::*; -use object::*; -use element::*; -use base_src::*; -use uri_handler::*; +use gst_plugin::object::*; +use gst_plugin::element::*; +use gst_plugin::base_src::*; +use gst_plugin::uri_handler::*; +use gst_plugin::error::*; -pub use base_src::RsBaseSrc; +pub use gst_plugin::base_src::RsBaseSrc; + +use UriValidator; pub trait SourceImpl: Send + 'static { fn uri_validator(&self) -> Box; diff --git a/gst-plugin/Cargo.toml b/gst-plugin/Cargo.toml index 45577b3d..98bd13d1 100644 --- a/gst-plugin/Cargo.toml +++ b/gst-plugin/Cargo.toml @@ -2,12 +2,11 @@ name = "gst-plugin" version = "0.1.0" authors = ["Sebastian Dröge "] -repository = "https://github.com/sdroege/rsplugin/gst-plugin" +repository = "https://github.com/sdroege/gst-plugin-rs/gst-plugin" license = "MIT/Apache-2.0" [dependencies] libc = "0.2" -url = "1.1" lazy_static = "0.2" byteorder = "1.0" glib-sys = { git = "https://github.com/gtk-rs/sys" } diff --git a/gst-plugin/src/error.rs b/gst-plugin/src/error.rs index ef9a9b5d..e89a9086 100644 --- a/gst-plugin/src/error.rs +++ b/gst-plugin/src/error.rs @@ -11,8 +11,6 @@ use std::fmt::{Display, Formatter}; use std::fmt::Error as FmtError; use std::borrow::Cow; -use url::Url; - use glib_ffi; use gst_ffi; @@ -215,8 +213,6 @@ impl Error for UriError { } } -pub type UriValidator = Fn(&Url) -> Result<(), UriError> + Send + Sync + 'static; - #[macro_export] macro_rules! panic_to_error( ($element:expr, $panicked:expr, $ret:expr, $code:block) => {{ diff --git a/gst-plugin/src/lib.rs b/gst-plugin/src/lib.rs index ab8295bd..76ed1e68 100644 --- a/gst-plugin/src/lib.rs +++ b/gst-plugin/src/lib.rs @@ -12,7 +12,6 @@ extern crate gstreamer_base_sys as gst_base_ffi; #[macro_use] extern crate lazy_static; extern crate libc; -extern crate url; pub extern crate glib_sys as glib_ffi; pub extern crate gobject_sys as gobject_ffi; pub extern crate gstreamer_sys as gst_ffi; @@ -66,9 +65,6 @@ pub mod error; pub mod adapter; #[macro_use] pub mod plugin; -pub mod source; -pub mod sink; -pub mod demuxer; pub mod bytes; #[macro_use]