From 5ad45cef42ab99caa5c801b881223627105c6da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 10 Oct 2020 11:10:20 +0300 Subject: [PATCH] examples: Rename crates in Cargo.toml and get rid of `extern crate` --- examples/Cargo.toml | 48 ++++++++++++------------ examples/build.rs | 3 -- examples/src/bin/appsink.rs | 3 -- examples/src/bin/appsrc.rs | 3 -- examples/src/bin/custom_events.rs | 1 - examples/src/bin/custom_meta.rs | 5 +-- examples/src/bin/debug_ringbuffer.rs | 1 - examples/src/bin/decodebin.rs | 1 - examples/src/bin/discoverer.rs | 11 ++---- examples/src/bin/encodebin.rs | 2 - examples/src/bin/events.rs | 1 - examples/src/bin/futures.rs | 1 - examples/src/bin/ges.rs | 2 - examples/src/bin/glib-futures.rs | 1 - examples/src/bin/glupload.rs | 4 -- examples/src/bin/gtksink.rs | 1 - examples/src/bin/gtkvideooverlay.rs | 4 -- examples/src/bin/iterator.rs | 1 - examples/src/bin/launch.rs | 1 - examples/src/bin/launch_glib_main.rs | 1 - examples/src/bin/overlay-composition.rs | 2 - examples/src/bin/pad_probes.rs | 2 - examples/src/bin/pango-cairo.rs | 2 - examples/src/bin/playbin.rs | 1 - examples/src/bin/player.rs | 3 -- examples/src/bin/queries.rs | 1 - examples/src/bin/rtpfecclient.rs | 1 - examples/src/bin/rtpfecserver.rs | 1 - examples/src/bin/rtsp-server-record.rs | 30 +++++++-------- examples/src/bin/rtsp-server-subclass.rs | 9 ----- examples/src/bin/rtsp-server.rs | 3 -- examples/src/bin/subclass.rs | 4 -- examples/src/bin/tagsetter.rs | 1 - examples/src/bin/thumbnail.rs | 5 --- examples/src/bin/toc.rs | 1 - examples/src/bin/transmux.rs | 1 - examples/src/bin/video_converter.rs | 2 - 37 files changed, 42 insertions(+), 122 deletions(-) diff --git a/examples/Cargo.toml b/examples/Cargo.toml index fe3f71207..59a25e80d 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -7,19 +7,19 @@ edition = "2018" [dependencies] glib = { git = "https://github.com/gtk-rs/glib" } -gstreamer = { path = "../gstreamer" } -gstreamer-gl = { path = "../gstreamer-gl", optional = true } -gstreamer-app = { path = "../gstreamer-app" } -gstreamer-audio = { path = "../gstreamer-audio" } -gstreamer-base = { path = "../gstreamer-base" } -gstreamer-video = { path = "../gstreamer-video" } -gstreamer-pbutils = { path = "../gstreamer-pbutils" } -gstreamer-player = { path = "../gstreamer-player", optional = true } -gstreamer-editing-services = { path = "../gstreamer-editing-services", optional = true } -gstreamer-sdp = { path = "../gstreamer-sdp", optional = true } -gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true } -gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true } -gstreamer-rtsp-server-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"], optional = true } +gst = { package = "gstreamer", path = "../gstreamer" } +gst-gl = { package = "gstreamer-gl", path = "../gstreamer-gl", optional = true } +gst-app = { package = "gstreamer-app", path = "../gstreamer-app" } +gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio" } +gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } +gst-video = { package = "gstreamer-video", path = "../gstreamer-video" } +gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils" } +gst-player = { package = "gstreamer-player", path = "../gstreamer-player", optional = true } +ges = { package = "gstreamer-editing-services", path = "../gstreamer-editing-services", optional = true } +gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", optional = true } +gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", optional = true } +gst-rtsp-server = { package = "gstreamer-rtsp-server", path = "../gstreamer-rtsp-server", optional = true } +gst-rtsp-server-sys = { package = "gstreamer-rtsp-server-sys", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"], optional = true } gtk = { git = "https://github.com/gtk-rs/gtk", optional = true } gdk = { git = "https://github.com/gtk-rs/gdk", optional = true } gio = { git = "https://github.com/gtk-rs/gio", optional = true } @@ -41,21 +41,19 @@ gl_generator = { version = "0.14", optional = true } [features] default = [] -gst-player = ["gstreamer-player"] -ges = ["gstreamer-editing-services"] gtksink = ["gtk", "gio"] gtkvideooverlay = ["gtk", "gdk", "gio"] gtkvideooverlay-x11 = ["gtkvideooverlay"] gtkvideooverlay-quartz = ["gtkvideooverlay"] -gst-rtsp-server = ["gstreamer-rtsp-server", "gstreamer-rtsp", "gstreamer-sdp"] -gst-rtsp-server-record = ["gstreamer-rtsp-server-sys", "gstreamer-rtsp-server", "gstreamer-rtsp", "gio"] -v1_10 = ["gstreamer/v1_10"] +rtsp-server = ["gst-rtsp-server", "gst-rtsp", "gst-sdp"] +rtsp-server-record = ["gst-rtsp-server-sys", "gst-rtsp-server", "gst-rtsp", "gio"] +v1_10 = ["gst/v1_10"] pango-cairo = ["pango", "pangocairo", "cairo-rs"] overlay-composition = ["pango", "pangocairo", "cairo-rs", "cairo-sys-rs" ] -gl = ["gstreamer-gl", "gl_generator", "glutin"] -gl-egl = ["gstreamer-gl/egl"] -gl-x11 = ["gstreamer-gl/x11"] -gl-wayland = ["gstreamer-gl/wayland"] +gl = ["gst-gl", "gl_generator", "glutin"] +gl-egl = ["gst-gl/egl"] +gl-x11 = ["gst-gl/x11"] +gl-wayland = ["gst-gl/wayland"] [[bin]] name = "appsink" @@ -124,11 +122,11 @@ name = "rtpfecserver" [[bin]] name = "rtsp-server" -required-features = ["gst-rtsp-server"] +required-features = ["rtsp-server"] [[bin]] name = "rtsp-server-subclass" -required-features = ["gst-rtsp-server"] +required-features = ["rtsp-server"] [[bin]] name = "tagsetter" @@ -144,7 +142,7 @@ name = "glib-futures" [[bin]] name = "rtsp-server-record" -required-features = ["gst-rtsp-server-record"] +required-features = ["rtsp-server-record"] [[bin]] name = "discoverer" diff --git a/examples/build.rs b/examples/build.rs index ed27949a7..b6fa6e49c 100644 --- a/examples/build.rs +++ b/examples/build.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "gl")] -extern crate gl_generator; - #[cfg(feature = "gl")] fn generate_gl_bindings() { let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap()); diff --git a/examples/src/bin/appsink.rs b/examples/src/bin/appsink.rs index 8c9547ba5..dedf5e1a1 100644 --- a/examples/src/bin/appsink.rs +++ b/examples/src/bin/appsink.rs @@ -10,11 +10,8 @@ // This is the format we request: // Audio / Signed 16bit / 1 channel / arbitrary sample rate -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; -extern crate gstreamer_app as gst_app; -extern crate gstreamer_audio as gst_audio; use byte_slice_cast::*; diff --git a/examples/src/bin/appsrc.rs b/examples/src/bin/appsrc.rs index a39fa6add..45569018c 100644 --- a/examples/src/bin/appsrc.rs +++ b/examples/src/bin/appsrc.rs @@ -10,10 +10,7 @@ // The application provides data of the following format: // Video / BGRx (4 bytes) / 2 fps -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_app as gst_app; -extern crate gstreamer_video as gst_video; use anyhow::Error; use derive_more::{Display, Error}; diff --git a/examples/src/bin/custom_events.rs b/examples/src/bin/custom_events.rs index afaaee0e6..5ea28e496 100644 --- a/examples/src/bin/custom_events.rs +++ b/examples/src/bin/custom_events.rs @@ -5,7 +5,6 @@ // is sent on the sink pad, we expect to see it emerge on the other side when // the data in front of it has exited. -extern crate gstreamer as gst; use gst::prelude::*; #[path = "../examples-common.rs"] diff --git a/examples/src/bin/custom_meta.rs b/examples/src/bin/custom_meta.rs index 7894868b5..904a83cd0 100644 --- a/examples/src/bin/custom_meta.rs +++ b/examples/src/bin/custom_meta.rs @@ -3,12 +3,9 @@ // It simply attaches a GstMeta with a Rust String to buffers that are passed into // an appsrc and retrieves them again from an appsink. -#[macro_use] -extern crate gstreamer as gst; +use gst::gst_element_error; use gst::prelude::*; -extern crate gstreamer_app as gst_app; - #[path = "../examples-common.rs"] mod examples_common; diff --git a/examples/src/bin/debug_ringbuffer.rs b/examples/src/bin/debug_ringbuffer.rs index f13038698..28c83f4b6 100644 --- a/examples/src/bin/debug_ringbuffer.rs +++ b/examples/src/bin/debug_ringbuffer.rs @@ -5,7 +5,6 @@ // // It's possible to dump the logs at any time in an application, // not just on exit like is done here. -extern crate gstreamer as gst; use gst::prelude::*; use std::process; diff --git a/examples/src/bin/decodebin.rs b/examples/src/bin/decodebin.rs index c156b6377..8d3b45681 100644 --- a/examples/src/bin/decodebin.rs +++ b/examples/src/bin/decodebin.rs @@ -29,7 +29,6 @@ // Especially Windows APIs tend to be quite picky about samplerate and sample-format. // The same applies to videostreams. -extern crate gstreamer as gst; use gst::gst_element_error; use gst::gst_element_warning; use gst::prelude::*; diff --git a/examples/src/bin/discoverer.rs b/examples/src/bin/discoverer.rs index 8460c5841..1304a0b8a 100644 --- a/examples/src/bin/discoverer.rs +++ b/examples/src/bin/discoverer.rs @@ -8,13 +8,10 @@ // Discovered information could for example contain the stream's duration or whether it is // seekable (filesystem) or not (some http servers). -extern crate gstreamer as gst; +use gst_pbutils::prelude::*; -extern crate gstreamer_pbutils as pbutils; -use crate::pbutils::prelude::*; - -use crate::pbutils::DiscovererInfo; -use crate::pbutils::DiscovererStreamInfo; +use gst_pbutils::DiscovererInfo; +use gst_pbutils::DiscovererStreamInfo; use anyhow::Error; use derive_more::{Display, Error}; @@ -88,7 +85,7 @@ fn run_discoverer() -> Result<(), Error> { }; let timeout: gst::ClockTime = gst::ClockTime::from_seconds(15); - let discoverer = pbutils::Discoverer::new(timeout)?; + let discoverer = gst_pbutils::Discoverer::new(timeout)?; let info = discoverer.discover_uri(uri)?; print_discoverer_info(&info)?; Ok(()) diff --git a/examples/src/bin/encodebin.rs b/examples/src/bin/encodebin.rs index ec62dd193..f5a873460 100644 --- a/examples/src/bin/encodebin.rs +++ b/examples/src/bin/encodebin.rs @@ -12,12 +12,10 @@ // {uridecodebin} -| {encodebin}-{filesink} // \-{queue}-{videoconvert}-{videoscale}----/ -extern crate gstreamer as gst; use gst::gst_element_error; use gst::gst_element_warning; use gst::prelude::*; -extern crate gstreamer_pbutils as gst_pbutils; use gst_pbutils::prelude::*; #[cfg(feature = "v1_10")] diff --git a/examples/src/bin/events.rs b/examples/src/bin/events.rs index 47b35528f..9d901e097 100644 --- a/examples/src/bin/events.rs +++ b/examples/src/bin/events.rs @@ -19,7 +19,6 @@ // This makes it possible, e.g., to schedule an arbitrary piece of code // to run in the main loop thread - avoiding potential threading issues. -extern crate gstreamer as gst; use gst::prelude::*; #[path = "../examples-common.rs"] diff --git a/examples/src/bin/futures.rs b/examples/src/bin/futures.rs index e1774b590..e2cf31c21 100644 --- a/examples/src/bin/futures.rs +++ b/examples/src/bin/futures.rs @@ -3,7 +3,6 @@ // or for an EOS message. When a message notifying about either of both // is received, the future is resolved. -extern crate gstreamer as gst; use gst::prelude::*; use futures::executor::LocalPool; diff --git a/examples/src/bin/ges.rs b/examples/src/bin/ges.rs index 11dd68049..fc7a128ca 100644 --- a/examples/src/bin/ges.rs +++ b/examples/src/bin/ges.rs @@ -35,10 +35,8 @@ // those with lowers (higher number). Thus, Layers with higher priority are "in the front". // - The timeline is the enclosing element, grouping all layers and providing a timeframe. -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_editing_services as ges; use ges::prelude::*; use std::env; diff --git a/examples/src/bin/glib-futures.rs b/examples/src/bin/glib-futures.rs index 118dde09f..8df2d1096 100644 --- a/examples/src/bin/glib-futures.rs +++ b/examples/src/bin/glib-futures.rs @@ -1,4 +1,3 @@ -extern crate gstreamer as gst; use gst::prelude::*; use futures::prelude::*; diff --git a/examples/src/bin/glupload.rs b/examples/src/bin/glupload.rs index a62ffbcbb..6a80b4fda 100644 --- a/examples/src/bin/glupload.rs +++ b/examples/src/bin/glupload.rs @@ -4,14 +4,10 @@ // {videotestsrc} - { glsinkbin } -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; -extern crate gstreamer_app as gst_app; -extern crate gstreamer_gl as gst_gl; use gst_gl::prelude::*; -extern crate gstreamer_video as gst_video; use std::ffi::CStr; use std::mem; diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs index 5d6122fca..13e3cab2a 100644 --- a/examples/src/bin/gtksink.rs +++ b/examples/src/bin/gtksink.rs @@ -10,7 +10,6 @@ // (|) // {videotestsrc} - {glsinkbin} -extern crate gstreamer as gst; use gst::prelude::*; use gio::prelude::*; diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index 999a2e6c3..a69b78f60 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -17,14 +17,10 @@ // {videotestsrc} - {xvimagesink(on linux)} // {videotestsrc} - {glimagesink(on mac)} -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_video as gst_video; use gst_video::prelude::*; -use glib::object::ObjectType; - use gio::prelude::*; use gtk::prelude::*; diff --git a/examples/src/bin/iterator.rs b/examples/src/bin/iterator.rs index 41fa86ee6..f754a6e8d 100644 --- a/examples/src/bin/iterator.rs +++ b/examples/src/bin/iterator.rs @@ -2,7 +2,6 @@ // This is used at multiple occassions - for example to iterate an // element's pads. -extern crate gstreamer as gst; use gst::prelude::*; #[path = "../examples-common.rs"] diff --git a/examples/src/bin/launch.rs b/examples/src/bin/launch.rs index 497367fd2..a3edb5a73 100644 --- a/examples/src/bin/launch.rs +++ b/examples/src/bin/launch.rs @@ -3,7 +3,6 @@ // as launch syntax. // When the parsing succeeded, the pipeline is run until the stream ends or an error happens. -extern crate gstreamer as gst; use gst::prelude::*; use std::env; diff --git a/examples/src/bin/launch_glib_main.rs b/examples/src/bin/launch_glib_main.rs index 4cab9c91a..149333b4f 100644 --- a/examples/src/bin/launch_glib_main.rs +++ b/examples/src/bin/launch_glib_main.rs @@ -7,7 +7,6 @@ // things from the main loop (timeouts, UI events, socket events, ...) instead // of just handling messages from GStreamer's bus. -extern crate gstreamer as gst; use gst::prelude::*; use std::env; diff --git a/examples/src/bin/overlay-composition.rs b/examples/src/bin/overlay-composition.rs index 2e3d33f65..85b1779f5 100644 --- a/examples/src/bin/overlay-composition.rs +++ b/examples/src/bin/overlay-composition.rs @@ -11,10 +11,8 @@ // There is a small amount of unsafe code that demonstrates how to work around // Cairo's internal refcounting of the target buffer surface -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_video as gst_video; use pango::prelude::*; use std::ops; diff --git a/examples/src/bin/pad_probes.rs b/examples/src/bin/pad_probes.rs index 63a433a4d..fccd04b31 100644 --- a/examples/src/bin/pad_probes.rs +++ b/examples/src/bin/pad_probes.rs @@ -7,9 +7,7 @@ // / // {audiotestsrc} - {fakesink} -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_audio as gst_audio; use byte_slice_cast::*; diff --git a/examples/src/bin/pango-cairo.rs b/examples/src/bin/pango-cairo.rs index 4a3b9ef26..6f5a252b8 100644 --- a/examples/src/bin/pango-cairo.rs +++ b/examples/src/bin/pango-cairo.rs @@ -11,10 +11,8 @@ // The capsfilter element allows us to dictate the video resolution we want for the // videotestsrc and the cairooverlay element. -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_video as gst_video; use pango::prelude::*; use std::ops; diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index a59efac68..fd0437601 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -9,7 +9,6 @@ // Much of the playbin's behavior can be controlled by so-called flags, as well // as the playbin's properties and signals. -extern crate gstreamer as gst; use gst::prelude::*; use std::env; diff --git a/examples/src/bin/player.rs b/examples/src/bin/player.rs index 322396f74..6a7cce9b2 100644 --- a/examples/src/bin/player.rs +++ b/examples/src/bin/player.rs @@ -5,11 +5,8 @@ // audio / subtitle streams or changing the volume) are all supported by simple // one-line function calls on the GstPlayer. -extern crate gstreamer as gst; use gst::prelude::*; -extern crate gstreamer_player as gst_player; - use std::env; use std::sync::{Arc, Mutex}; diff --git a/examples/src/bin/queries.rs b/examples/src/bin/queries.rs index 2e6525634..24308167c 100644 --- a/examples/src/bin/queries.rs +++ b/examples/src/bin/queries.rs @@ -12,7 +12,6 @@ // For convenience, the API has a set of pre-defined queries, but also // allows custom queries (which can be defined and used by your own elements). -extern crate gstreamer as gst; use gst::prelude::*; use std::convert::TryInto; diff --git a/examples/src/bin/rtpfecclient.rs b/examples/src/bin/rtpfecclient.rs index 759d3e5b6..e107489d4 100644 --- a/examples/src/bin/rtpfecclient.rs +++ b/examples/src/bin/rtpfecclient.rs @@ -1,4 +1,3 @@ -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; diff --git a/examples/src/bin/rtpfecserver.rs b/examples/src/bin/rtpfecserver.rs index 5b4cff560..a74f1a862 100644 --- a/examples/src/bin/rtpfecserver.rs +++ b/examples/src/bin/rtpfecserver.rs @@ -1,4 +1,3 @@ -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; diff --git a/examples/src/bin/rtsp-server-record.rs b/examples/src/bin/rtsp-server-record.rs index 066046118..d3ccedf7e 100644 --- a/examples/src/bin/rtsp-server-record.rs +++ b/examples/src/bin/rtsp-server-record.rs @@ -4,18 +4,11 @@ // send to the server. For this, the launch syntax pipeline, that is passed // to this example's cli is spawned and the client's media is streamed into it. -extern crate gstreamer as gst; -extern crate gstreamer_rtsp as gst_rtsp; -extern crate gstreamer_rtsp_server as gst_rtsp_server; -extern crate gstreamer_rtsp_server_sys as gst_rtsp_server_sys; - use std::env; use std::ptr; use glib::translate::*; -use gst_rtsp::*; use gst_rtsp_server::prelude::*; -use gst_rtsp_server::*; use anyhow::Error; use derive_more::{Display, Error}; @@ -41,7 +34,7 @@ fn main_loop() -> Result<(), Error> { // Mostly analog to the rtsp-server example, the server is created // and the factory for our test mount is configured. let main_loop = glib::MainLoop::new(None, false); - let server = RTSPServer::new(); + let server = gst_rtsp_server::RTSPServer::new(); // Much like HTTP servers, RTSP servers have multiple endpoints that // provide or take different streams. Here, we ask our server to give // us a reference to its list of endpoints, so we can add our @@ -50,12 +43,15 @@ fn main_loop() -> Result<(), Error> { // Next, we create a factory for the endpoint we want to create. // The job of the factory is to create a new pipeline for each client that // connects, or (if configured to do so) to reuse an existing pipeline. - let factory = RTSPMediaFactory::new(); + let factory = gst_rtsp_server::RTSPMediaFactory::new(); // Here we configure a method of authentication that we want the // server to require from clients. - let auth = RTSPAuth::new(); - let token = RTSPToken::new(&[(*RTSP_TOKEN_MEDIA_FACTORY_ROLE, &"user")]); - let basic = RTSPAuth::make_basic("user", "password"); + let auth = gst_rtsp_server::RTSPAuth::new(); + let token = gst_rtsp_server::RTSPToken::new(&[( + *gst_rtsp_server::RTSP_TOKEN_MEDIA_FACTORY_ROLE, + &"user", + )]); + let basic = gst_rtsp_server::RTSPAuth::make_basic("user", "password"); // For propery authentication, we want to use encryption. And there's no // encryption without a certificate! let cert = gio::TlsCertificate::from_pem( @@ -91,10 +87,12 @@ fn main_loop() -> Result<(), Error> { gst_rtsp_server_sys::gst_rtsp_media_factory_add_role( factory.to_glib_none().0, "user".to_glib_none().0, - RTSP_PERM_MEDIA_FACTORY_ACCESS.to_glib_none().0, + gst_rtsp_server::RTSP_PERM_MEDIA_FACTORY_ACCESS + .to_glib_none() + .0, ::static_type().to_glib() as *const u8, true.to_glib() as *const u8, - RTSP_PERM_MEDIA_FACTORY_CONSTRUCT.as_ptr() as *const u8, + gst_rtsp_server::RTSP_PERM_MEDIA_FACTORY_CONSTRUCT.as_ptr() as *const u8, ::static_type().to_glib() as *const u8, true.to_glib() as *const u8, ptr::null_mut::(), @@ -110,7 +108,7 @@ fn main_loop() -> Result<(), Error> { factory.set_launch(args[1].as_str()); // Tell the RTSP server that we want to work in RECORD mode (clients send) // data to us. - factory.set_transport_mode(RTSPTransportMode::RECORD); + factory.set_transport_mode(gst_rtsp_server::RTSPTransportMode::RECORD); // The RTSP protocol allows a couple of different profiles for the actually // used protocol of data-transmission. With this, we can limit the selection // from which connecting clients have to choose. @@ -118,7 +116,7 @@ fn main_loop() -> Result<(), Error> { // The F in the end is for feedback (an extension that allows more bidirectional // feedback between sender and receiver). AV is just Audio/Video, P is Profile :) // The default, old RTP profile is AVP - factory.set_profiles(RTSPProfile::SAVP | RTSPProfile::SAVPF); + factory.set_profiles(gst_rtsp::RTSPProfile::SAVP | gst_rtsp::RTSPProfile::SAVPF); // Now we add a new mount-point and tell the RTSP server to use the factory // we configured beforehand. This factory will take on the job of creating diff --git a/examples/src/bin/rtsp-server-subclass.rs b/examples/src/bin/rtsp-server-subclass.rs index 7bf899a81..011741da9 100644 --- a/examples/src/bin/rtsp-server-subclass.rs +++ b/examples/src/bin/rtsp-server-subclass.rs @@ -7,11 +7,6 @@ // It also comes with a custom RTSP server/client subclass for hooking into // the client machinery and printing some status. -extern crate gstreamer as gst; -extern crate gstreamer_rtsp as gst_rtsp; -extern crate gstreamer_rtsp_server as gst_rtsp_server; -extern crate gstreamer_sdp as gst_sdp; - use gst_rtsp_server::prelude::*; use glib::glib_object_subclass; @@ -90,7 +85,6 @@ mod media_factory { use glib::subclass::prelude::*; use glib::translate::*; - extern crate gstreamer_rtsp_server as gst_rtsp_server; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -203,7 +197,6 @@ mod media { use glib::subclass::prelude::*; use glib::translate::*; - extern crate gstreamer_rtsp_server as gst_rtsp_server; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -282,7 +275,6 @@ mod server { use glib::subclass::prelude::*; use glib::translate::*; - extern crate gstreamer_rtsp_server as gst_rtsp_server; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -381,7 +373,6 @@ mod client { use glib::subclass::prelude::*; use glib::translate::*; - extern crate gstreamer_rtsp_server as gst_rtsp_server; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation diff --git a/examples/src/bin/rtsp-server.rs b/examples/src/bin/rtsp-server.rs index a8c6790a6..317ff9388 100644 --- a/examples/src/bin/rtsp-server.rs +++ b/examples/src/bin/rtsp-server.rs @@ -5,9 +5,6 @@ use std::env; -extern crate gstreamer as gst; - -extern crate gstreamer_rtsp_server as gst_rtsp_server; use gst_rtsp_server::prelude::*; use anyhow::Error; diff --git a/examples/src/bin/subclass.rs b/examples/src/bin/subclass.rs index aa5f05653..1c5119fd2 100644 --- a/examples/src/bin/subclass.rs +++ b/examples/src/bin/subclass.rs @@ -9,7 +9,6 @@ use glib::glib_object_subclass; use glib::glib_wrapper; -extern crate gstreamer as gst; use gst::gst_element_error; use gst::gst_info; use gst::gst_trace; @@ -31,11 +30,8 @@ mod fir_filter { use gst::subclass::prelude::*; - extern crate gstreamer_base as gst_base; use gst_base::subclass::prelude::*; - extern crate gstreamer_audio as gst_audio; - use byte_slice_cast::*; use once_cell::sync::Lazy; diff --git a/examples/src/bin/tagsetter.rs b/examples/src/bin/tagsetter.rs index 9cb2138c2..b52563436 100644 --- a/examples/src/bin/tagsetter.rs +++ b/examples/src/bin/tagsetter.rs @@ -18,7 +18,6 @@ // (More modes of operation are possible, see: gst::TagMergeMode) // This merge-mode can also be supplied to any method that adds new tags. -extern crate gstreamer as gst; use gst::prelude::*; use anyhow::anyhow; diff --git a/examples/src/bin/thumbnail.rs b/examples/src/bin/thumbnail.rs index fa3c03b90..480683391 100644 --- a/examples/src/bin/thumbnail.rs +++ b/examples/src/bin/thumbnail.rs @@ -6,13 +6,8 @@ // The appsink enforces RGBA so that the image crate can use it. The image crate also requires // tightly packed pixels, which is the case for RGBA by default in GStreamer. -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; -extern crate gstreamer_app as gst_app; -extern crate gstreamer_video as gst_video; - -extern crate image; use anyhow::Error; use derive_more::{Display, Error}; diff --git a/examples/src/bin/toc.rs b/examples/src/bin/toc.rs index 2aa763aaf..382824423 100644 --- a/examples/src/bin/toc.rs +++ b/examples/src/bin/toc.rs @@ -9,7 +9,6 @@ // {filesrc} - {decodebin} - {queue} - {fakesink} // \- ... -extern crate gstreamer as gst; use gst::prelude::*; use std::env; diff --git a/examples/src/bin/transmux.rs b/examples/src/bin/transmux.rs index 687611c09..103019e16 100644 --- a/examples/src/bin/transmux.rs +++ b/examples/src/bin/transmux.rs @@ -17,7 +17,6 @@ // {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink} // \-[video]-/ -extern crate gstreamer as gst; use gst::gst_element_error; use gst::prelude::*; diff --git a/examples/src/bin/video_converter.rs b/examples/src/bin/video_converter.rs index b7a55d0c3..603dc9609 100644 --- a/examples/src/bin/video_converter.rs +++ b/examples/src/bin/video_converter.rs @@ -2,8 +2,6 @@ // API to configure the compositor element to do specific // formatting of an input video. // -extern crate gstreamer as gst; -extern crate gstreamer_video as gst_video; use gst::prelude::*; #[path = "../examples-common.rs"]