mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 04:51:09 +00:00
examples: Rename crates in Cargo.toml and get rid of extern crate
This commit is contained in:
parent
ad1d78b599
commit
5ad45cef42
37 changed files with 42 additions and 122 deletions
|
@ -7,19 +7,19 @@ edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glib = { git = "https://github.com/gtk-rs/glib" }
|
glib = { git = "https://github.com/gtk-rs/glib" }
|
||||||
gstreamer = { path = "../gstreamer" }
|
gst = { package = "gstreamer", path = "../gstreamer" }
|
||||||
gstreamer-gl = { path = "../gstreamer-gl", optional = true }
|
gst-gl = { package = "gstreamer-gl", path = "../gstreamer-gl", optional = true }
|
||||||
gstreamer-app = { path = "../gstreamer-app" }
|
gst-app = { package = "gstreamer-app", path = "../gstreamer-app" }
|
||||||
gstreamer-audio = { path = "../gstreamer-audio" }
|
gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio" }
|
||||||
gstreamer-base = { path = "../gstreamer-base" }
|
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" }
|
||||||
gstreamer-video = { path = "../gstreamer-video" }
|
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" }
|
||||||
gstreamer-pbutils = { path = "../gstreamer-pbutils" }
|
gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils" }
|
||||||
gstreamer-player = { path = "../gstreamer-player", optional = true }
|
gst-player = { package = "gstreamer-player", path = "../gstreamer-player", optional = true }
|
||||||
gstreamer-editing-services = { path = "../gstreamer-editing-services", optional = true }
|
ges = { package = "gstreamer-editing-services", path = "../gstreamer-editing-services", optional = true }
|
||||||
gstreamer-sdp = { path = "../gstreamer-sdp", optional = true }
|
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", optional = true }
|
||||||
gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true }
|
gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", optional = true }
|
||||||
gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true }
|
gst-rtsp-server = { package = "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-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 }
|
gtk = { git = "https://github.com/gtk-rs/gtk", optional = true }
|
||||||
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
|
gdk = { git = "https://github.com/gtk-rs/gdk", optional = true }
|
||||||
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
|
gio = { git = "https://github.com/gtk-rs/gio", optional = true }
|
||||||
|
@ -41,21 +41,19 @@ gl_generator = { version = "0.14", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
gst-player = ["gstreamer-player"]
|
|
||||||
ges = ["gstreamer-editing-services"]
|
|
||||||
gtksink = ["gtk", "gio"]
|
gtksink = ["gtk", "gio"]
|
||||||
gtkvideooverlay = ["gtk", "gdk", "gio"]
|
gtkvideooverlay = ["gtk", "gdk", "gio"]
|
||||||
gtkvideooverlay-x11 = ["gtkvideooverlay"]
|
gtkvideooverlay-x11 = ["gtkvideooverlay"]
|
||||||
gtkvideooverlay-quartz = ["gtkvideooverlay"]
|
gtkvideooverlay-quartz = ["gtkvideooverlay"]
|
||||||
gst-rtsp-server = ["gstreamer-rtsp-server", "gstreamer-rtsp", "gstreamer-sdp"]
|
rtsp-server = ["gst-rtsp-server", "gst-rtsp", "gst-sdp"]
|
||||||
gst-rtsp-server-record = ["gstreamer-rtsp-server-sys", "gstreamer-rtsp-server", "gstreamer-rtsp", "gio"]
|
rtsp-server-record = ["gst-rtsp-server-sys", "gst-rtsp-server", "gst-rtsp", "gio"]
|
||||||
v1_10 = ["gstreamer/v1_10"]
|
v1_10 = ["gst/v1_10"]
|
||||||
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
|
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
|
||||||
overlay-composition = ["pango", "pangocairo", "cairo-rs", "cairo-sys-rs" ]
|
overlay-composition = ["pango", "pangocairo", "cairo-rs", "cairo-sys-rs" ]
|
||||||
gl = ["gstreamer-gl", "gl_generator", "glutin"]
|
gl = ["gst-gl", "gl_generator", "glutin"]
|
||||||
gl-egl = ["gstreamer-gl/egl"]
|
gl-egl = ["gst-gl/egl"]
|
||||||
gl-x11 = ["gstreamer-gl/x11"]
|
gl-x11 = ["gst-gl/x11"]
|
||||||
gl-wayland = ["gstreamer-gl/wayland"]
|
gl-wayland = ["gst-gl/wayland"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "appsink"
|
name = "appsink"
|
||||||
|
@ -124,11 +122,11 @@ name = "rtpfecserver"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rtsp-server"
|
name = "rtsp-server"
|
||||||
required-features = ["gst-rtsp-server"]
|
required-features = ["rtsp-server"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rtsp-server-subclass"
|
name = "rtsp-server-subclass"
|
||||||
required-features = ["gst-rtsp-server"]
|
required-features = ["rtsp-server"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "tagsetter"
|
name = "tagsetter"
|
||||||
|
@ -144,7 +142,7 @@ name = "glib-futures"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rtsp-server-record"
|
name = "rtsp-server-record"
|
||||||
required-features = ["gst-rtsp-server-record"]
|
required-features = ["rtsp-server-record"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "discoverer"
|
name = "discoverer"
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#[cfg(feature = "gl")]
|
|
||||||
extern crate gl_generator;
|
|
||||||
|
|
||||||
#[cfg(feature = "gl")]
|
#[cfg(feature = "gl")]
|
||||||
fn generate_gl_bindings() {
|
fn generate_gl_bindings() {
|
||||||
let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap());
|
let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap());
|
||||||
|
|
|
@ -10,11 +10,8 @@
|
||||||
// This is the format we request:
|
// This is the format we request:
|
||||||
// Audio / Signed 16bit / 1 channel / arbitrary sample rate
|
// Audio / Signed 16bit / 1 channel / arbitrary sample rate
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
extern crate gstreamer_app as gst_app;
|
|
||||||
extern crate gstreamer_audio as gst_audio;
|
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,7 @@
|
||||||
// The application provides data of the following format:
|
// The application provides data of the following format:
|
||||||
// Video / BGRx (4 bytes) / 2 fps
|
// Video / BGRx (4 bytes) / 2 fps
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
extern crate gstreamer_app as gst_app;
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use derive_more::{Display, Error};
|
use derive_more::{Display, Error};
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
// is sent on the sink pad, we expect to see it emerge on the other side when
|
// 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.
|
// the data in front of it has exited.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
#[path = "../examples-common.rs"]
|
#[path = "../examples-common.rs"]
|
||||||
|
|
|
@ -3,12 +3,9 @@
|
||||||
// It simply attaches a GstMeta with a Rust String to buffers that are passed into
|
// It simply attaches a GstMeta with a Rust String to buffers that are passed into
|
||||||
// an appsrc and retrieves them again from an appsink.
|
// an appsrc and retrieves them again from an appsink.
|
||||||
|
|
||||||
#[macro_use]
|
use gst::gst_element_error;
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_app as gst_app;
|
|
||||||
|
|
||||||
#[path = "../examples-common.rs"]
|
#[path = "../examples-common.rs"]
|
||||||
mod examples_common;
|
mod examples_common;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
//
|
//
|
||||||
// It's possible to dump the logs at any time in an application,
|
// It's possible to dump the logs at any time in an application,
|
||||||
// not just on exit like is done here.
|
// not just on exit like is done here.
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
// Especially Windows APIs tend to be quite picky about samplerate and sample-format.
|
// Especially Windows APIs tend to be quite picky about samplerate and sample-format.
|
||||||
// The same applies to videostreams.
|
// The same applies to videostreams.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::gst_element_warning;
|
use gst::gst_element_warning;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
|
@ -8,13 +8,10 @@
|
||||||
// Discovered information could for example contain the stream's duration or whether it is
|
// Discovered information could for example contain the stream's duration or whether it is
|
||||||
// seekable (filesystem) or not (some http servers).
|
// seekable (filesystem) or not (some http servers).
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
use gst_pbutils::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_pbutils as pbutils;
|
use gst_pbutils::DiscovererInfo;
|
||||||
use crate::pbutils::prelude::*;
|
use gst_pbutils::DiscovererStreamInfo;
|
||||||
|
|
||||||
use crate::pbutils::DiscovererInfo;
|
|
||||||
use crate::pbutils::DiscovererStreamInfo;
|
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use derive_more::{Display, 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 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)?;
|
let info = discoverer.discover_uri(uri)?;
|
||||||
print_discoverer_info(&info)?;
|
print_discoverer_info(&info)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
// {uridecodebin} -| {encodebin}-{filesink}
|
// {uridecodebin} -| {encodebin}-{filesink}
|
||||||
// \-{queue}-{videoconvert}-{videoscale}----/
|
// \-{queue}-{videoconvert}-{videoscale}----/
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::gst_element_warning;
|
use gst::gst_element_warning;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_pbutils as gst_pbutils;
|
|
||||||
use gst_pbutils::prelude::*;
|
use gst_pbutils::prelude::*;
|
||||||
|
|
||||||
#[cfg(feature = "v1_10")]
|
#[cfg(feature = "v1_10")]
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
// This makes it possible, e.g., to schedule an arbitrary piece of code
|
// This makes it possible, e.g., to schedule an arbitrary piece of code
|
||||||
// to run in the main loop thread - avoiding potential threading issues.
|
// to run in the main loop thread - avoiding potential threading issues.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
#[path = "../examples-common.rs"]
|
#[path = "../examples-common.rs"]
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// or for an EOS message. When a message notifying about either of both
|
// or for an EOS message. When a message notifying about either of both
|
||||||
// is received, the future is resolved.
|
// is received, the future is resolved.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use futures::executor::LocalPool;
|
use futures::executor::LocalPool;
|
||||||
|
|
|
@ -35,10 +35,8 @@
|
||||||
// those with lowers (higher number). Thus, Layers with higher priority are "in the front".
|
// 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.
|
// - The timeline is the enclosing element, grouping all layers and providing a timeframe.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_editing_services as ges;
|
|
||||||
use ges::prelude::*;
|
use ges::prelude::*;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
|
|
|
@ -4,14 +4,10 @@
|
||||||
|
|
||||||
// {videotestsrc} - { glsinkbin }
|
// {videotestsrc} - { glsinkbin }
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_app as gst_app;
|
|
||||||
extern crate gstreamer_gl as gst_gl;
|
|
||||||
use gst_gl::prelude::*;
|
use gst_gl::prelude::*;
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
|
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
// (|)
|
// (|)
|
||||||
// {videotestsrc} - {glsinkbin}
|
// {videotestsrc} - {glsinkbin}
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
|
|
|
@ -17,14 +17,10 @@
|
||||||
// {videotestsrc} - {xvimagesink(on linux)}
|
// {videotestsrc} - {xvimagesink(on linux)}
|
||||||
// {videotestsrc} - {glimagesink(on mac)}
|
// {videotestsrc} - {glimagesink(on mac)}
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
use gst_video::prelude::*;
|
use gst_video::prelude::*;
|
||||||
|
|
||||||
use glib::object::ObjectType;
|
|
||||||
|
|
||||||
use gio::prelude::*;
|
use gio::prelude::*;
|
||||||
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
// This is used at multiple occassions - for example to iterate an
|
// This is used at multiple occassions - for example to iterate an
|
||||||
// element's pads.
|
// element's pads.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
#[path = "../examples-common.rs"]
|
#[path = "../examples-common.rs"]
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// as launch syntax.
|
// as launch syntax.
|
||||||
// When the parsing succeeded, the pipeline is run until the stream ends or an error happens.
|
// 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 gst::prelude::*;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
// things from the main loop (timeouts, UI events, socket events, ...) instead
|
// things from the main loop (timeouts, UI events, socket events, ...) instead
|
||||||
// of just handling messages from GStreamer's bus.
|
// of just handling messages from GStreamer's bus.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -11,10 +11,8 @@
|
||||||
// There is a small amount of unsafe code that demonstrates how to work around
|
// There is a small amount of unsafe code that demonstrates how to work around
|
||||||
// Cairo's internal refcounting of the target buffer surface
|
// Cairo's internal refcounting of the target buffer surface
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
use pango::prelude::*;
|
use pango::prelude::*;
|
||||||
|
|
||||||
use std::ops;
|
use std::ops;
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
// /
|
// /
|
||||||
// {audiotestsrc} - {fakesink}
|
// {audiotestsrc} - {fakesink}
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
extern crate gstreamer_audio as gst_audio;
|
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,8 @@
|
||||||
// The capsfilter element allows us to dictate the video resolution we want for the
|
// The capsfilter element allows us to dictate the video resolution we want for the
|
||||||
// videotestsrc and the cairooverlay element.
|
// videotestsrc and the cairooverlay element.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
use pango::prelude::*;
|
use pango::prelude::*;
|
||||||
|
|
||||||
use std::ops;
|
use std::ops;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// Much of the playbin's behavior can be controlled by so-called flags, as well
|
// Much of the playbin's behavior can be controlled by so-called flags, as well
|
||||||
// as the playbin's properties and signals.
|
// as the playbin's properties and signals.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -5,11 +5,8 @@
|
||||||
// audio / subtitle streams or changing the volume) are all supported by simple
|
// audio / subtitle streams or changing the volume) are all supported by simple
|
||||||
// one-line function calls on the GstPlayer.
|
// one-line function calls on the GstPlayer.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_player as gst_player;
|
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
// For convenience, the API has a set of pre-defined queries, but also
|
// 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).
|
// allows custom queries (which can be defined and used by your own elements).
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
|
|
|
@ -4,18 +4,11 @@
|
||||||
// send to the server. For this, the launch syntax pipeline, that is passed
|
// 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.
|
// 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::env;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
use gst_rtsp::*;
|
|
||||||
use gst_rtsp_server::prelude::*;
|
use gst_rtsp_server::prelude::*;
|
||||||
use gst_rtsp_server::*;
|
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use derive_more::{Display, 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
|
// Mostly analog to the rtsp-server example, the server is created
|
||||||
// and the factory for our test mount is configured.
|
// and the factory for our test mount is configured.
|
||||||
let main_loop = glib::MainLoop::new(None, false);
|
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
|
// Much like HTTP servers, RTSP servers have multiple endpoints that
|
||||||
// provide or take different streams. Here, we ask our server to give
|
// 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
|
// 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.
|
// 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
|
// 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.
|
// 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
|
// Here we configure a method of authentication that we want the
|
||||||
// server to require from clients.
|
// server to require from clients.
|
||||||
let auth = RTSPAuth::new();
|
let auth = gst_rtsp_server::RTSPAuth::new();
|
||||||
let token = RTSPToken::new(&[(*RTSP_TOKEN_MEDIA_FACTORY_ROLE, &"user")]);
|
let token = gst_rtsp_server::RTSPToken::new(&[(
|
||||||
let basic = RTSPAuth::make_basic("user", "password");
|
*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
|
// For propery authentication, we want to use encryption. And there's no
|
||||||
// encryption without a certificate!
|
// encryption without a certificate!
|
||||||
let cert = gio::TlsCertificate::from_pem(
|
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(
|
gst_rtsp_server_sys::gst_rtsp_media_factory_add_role(
|
||||||
factory.to_glib_none().0,
|
factory.to_glib_none().0,
|
||||||
"user".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,
|
||||||
<bool as StaticType>::static_type().to_glib() as *const u8,
|
<bool as StaticType>::static_type().to_glib() as *const u8,
|
||||||
true.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,
|
||||||
<bool as StaticType>::static_type().to_glib() as *const u8,
|
<bool as StaticType>::static_type().to_glib() as *const u8,
|
||||||
true.to_glib() as *const u8,
|
true.to_glib() as *const u8,
|
||||||
ptr::null_mut::<u8>(),
|
ptr::null_mut::<u8>(),
|
||||||
|
@ -110,7 +108,7 @@ fn main_loop() -> Result<(), Error> {
|
||||||
factory.set_launch(args[1].as_str());
|
factory.set_launch(args[1].as_str());
|
||||||
// Tell the RTSP server that we want to work in RECORD mode (clients send)
|
// Tell the RTSP server that we want to work in RECORD mode (clients send)
|
||||||
// data to us.
|
// 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
|
// The RTSP protocol allows a couple of different profiles for the actually
|
||||||
// used protocol of data-transmission. With this, we can limit the selection
|
// used protocol of data-transmission. With this, we can limit the selection
|
||||||
// from which connecting clients have to choose.
|
// 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
|
// 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 :)
|
// feedback between sender and receiver). AV is just Audio/Video, P is Profile :)
|
||||||
// The default, old RTP profile is AVP
|
// 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
|
// 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
|
// we configured beforehand. This factory will take on the job of creating
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
// It also comes with a custom RTSP server/client subclass for hooking into
|
// It also comes with a custom RTSP server/client subclass for hooking into
|
||||||
// the client machinery and printing some status.
|
// 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 gst_rtsp_server::prelude::*;
|
||||||
|
|
||||||
use glib::glib_object_subclass;
|
use glib::glib_object_subclass;
|
||||||
|
@ -90,7 +85,6 @@ mod media_factory {
|
||||||
use glib::subclass::prelude::*;
|
use glib::subclass::prelude::*;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
|
||||||
use gst_rtsp_server::subclass::prelude::*;
|
use gst_rtsp_server::subclass::prelude::*;
|
||||||
|
|
||||||
// In the imp submodule we include the actual implementation
|
// In the imp submodule we include the actual implementation
|
||||||
|
@ -203,7 +197,6 @@ mod media {
|
||||||
use glib::subclass::prelude::*;
|
use glib::subclass::prelude::*;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
|
||||||
use gst_rtsp_server::subclass::prelude::*;
|
use gst_rtsp_server::subclass::prelude::*;
|
||||||
|
|
||||||
// In the imp submodule we include the actual implementation
|
// In the imp submodule we include the actual implementation
|
||||||
|
@ -282,7 +275,6 @@ mod server {
|
||||||
use glib::subclass::prelude::*;
|
use glib::subclass::prelude::*;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
|
||||||
use gst_rtsp_server::subclass::prelude::*;
|
use gst_rtsp_server::subclass::prelude::*;
|
||||||
|
|
||||||
// In the imp submodule we include the actual implementation
|
// In the imp submodule we include the actual implementation
|
||||||
|
@ -381,7 +373,6 @@ mod client {
|
||||||
use glib::subclass::prelude::*;
|
use glib::subclass::prelude::*;
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
|
||||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
|
||||||
use gst_rtsp_server::subclass::prelude::*;
|
use gst_rtsp_server::subclass::prelude::*;
|
||||||
|
|
||||||
// In the imp submodule we include the actual implementation
|
// In the imp submodule we include the actual implementation
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
|
|
||||||
extern crate gstreamer_rtsp_server as gst_rtsp_server;
|
|
||||||
use gst_rtsp_server::prelude::*;
|
use gst_rtsp_server::prelude::*;
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
use glib::glib_object_subclass;
|
use glib::glib_object_subclass;
|
||||||
use glib::glib_wrapper;
|
use glib::glib_wrapper;
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::gst_info;
|
use gst::gst_info;
|
||||||
use gst::gst_trace;
|
use gst::gst_trace;
|
||||||
|
@ -31,11 +30,8 @@ mod fir_filter {
|
||||||
|
|
||||||
use gst::subclass::prelude::*;
|
use gst::subclass::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_base as gst_base;
|
|
||||||
use gst_base::subclass::prelude::*;
|
use gst_base::subclass::prelude::*;
|
||||||
|
|
||||||
extern crate gstreamer_audio as gst_audio;
|
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
// (More modes of operation are possible, see: gst::TagMergeMode)
|
// (More modes of operation are possible, see: gst::TagMergeMode)
|
||||||
// This merge-mode can also be supplied to any method that adds new tags.
|
// This merge-mode can also be supplied to any method that adds new tags.
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
|
@ -6,13 +6,8 @@
|
||||||
// The appsink enforces RGBA so that the image crate can use it. The image crate also requires
|
// 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.
|
// 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::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
extern crate gstreamer_app as gst_app;
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
|
|
||||||
extern crate image;
|
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use derive_more::{Display, Error};
|
use derive_more::{Display, Error};
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// {filesrc} - {decodebin} - {queue} - {fakesink}
|
// {filesrc} - {decodebin} - {queue} - {fakesink}
|
||||||
// \- ...
|
// \- ...
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
// {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink}
|
// {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink}
|
||||||
// \-[video]-/
|
// \-[video]-/
|
||||||
|
|
||||||
extern crate gstreamer as gst;
|
|
||||||
use gst::gst_element_error;
|
use gst::gst_element_error;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
// API to configure the compositor element to do specific
|
// API to configure the compositor element to do specific
|
||||||
// formatting of an input video.
|
// formatting of an input video.
|
||||||
//
|
//
|
||||||
extern crate gstreamer as gst;
|
|
||||||
extern crate gstreamer_video as gst_video;
|
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
|
|
||||||
#[path = "../examples-common.rs"]
|
#[path = "../examples-common.rs"]
|
||||||
|
|
Loading…
Reference in a new issue