Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GStreamer
gstreamer-rs
Commits
5ad45cef
Commit
5ad45cef
authored
Oct 10, 2020
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: Rename crates in Cargo.toml and get rid of `extern crate`
parent
ad1d78b5
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
42 additions
and
122 deletions
+42
-122
examples/Cargo.toml
examples/Cargo.toml
+23
-25
examples/build.rs
examples/build.rs
+0
-3
examples/src/bin/appsink.rs
examples/src/bin/appsink.rs
+0
-3
examples/src/bin/appsrc.rs
examples/src/bin/appsrc.rs
+0
-3
examples/src/bin/custom_events.rs
examples/src/bin/custom_events.rs
+0
-1
examples/src/bin/custom_meta.rs
examples/src/bin/custom_meta.rs
+1
-4
examples/src/bin/debug_ringbuffer.rs
examples/src/bin/debug_ringbuffer.rs
+0
-1
examples/src/bin/decodebin.rs
examples/src/bin/decodebin.rs
+0
-1
examples/src/bin/discoverer.rs
examples/src/bin/discoverer.rs
+4
-7
examples/src/bin/encodebin.rs
examples/src/bin/encodebin.rs
+0
-2
examples/src/bin/events.rs
examples/src/bin/events.rs
+0
-1
examples/src/bin/futures.rs
examples/src/bin/futures.rs
+0
-1
examples/src/bin/ges.rs
examples/src/bin/ges.rs
+0
-2
examples/src/bin/glib-futures.rs
examples/src/bin/glib-futures.rs
+0
-1
examples/src/bin/glupload.rs
examples/src/bin/glupload.rs
+0
-4
examples/src/bin/gtksink.rs
examples/src/bin/gtksink.rs
+0
-1
examples/src/bin/gtkvideooverlay.rs
examples/src/bin/gtkvideooverlay.rs
+0
-4
examples/src/bin/iterator.rs
examples/src/bin/iterator.rs
+0
-1
examples/src/bin/launch.rs
examples/src/bin/launch.rs
+0
-1
examples/src/bin/launch_glib_main.rs
examples/src/bin/launch_glib_main.rs
+0
-1
examples/src/bin/overlay-composition.rs
examples/src/bin/overlay-composition.rs
+0
-2
examples/src/bin/pad_probes.rs
examples/src/bin/pad_probes.rs
+0
-2
examples/src/bin/pango-cairo.rs
examples/src/bin/pango-cairo.rs
+0
-2
examples/src/bin/playbin.rs
examples/src/bin/playbin.rs
+0
-1
examples/src/bin/player.rs
examples/src/bin/player.rs
+0
-3
examples/src/bin/queries.rs
examples/src/bin/queries.rs
+0
-1
examples/src/bin/rtpfecclient.rs
examples/src/bin/rtpfecclient.rs
+0
-1
examples/src/bin/rtpfecserver.rs
examples/src/bin/rtpfecserver.rs
+0
-1
examples/src/bin/rtsp-server-record.rs
examples/src/bin/rtsp-server-record.rs
+14
-16
examples/src/bin/rtsp-server-subclass.rs
examples/src/bin/rtsp-server-subclass.rs
+0
-9
examples/src/bin/rtsp-server.rs
examples/src/bin/rtsp-server.rs
+0
-3
examples/src/bin/subclass.rs
examples/src/bin/subclass.rs
+0
-4
examples/src/bin/tagsetter.rs
examples/src/bin/tagsetter.rs
+0
-1
examples/src/bin/thumbnail.rs
examples/src/bin/thumbnail.rs
+0
-5
examples/src/bin/toc.rs
examples/src/bin/toc.rs
+0
-1
examples/src/bin/transmux.rs
examples/src/bin/transmux.rs
+0
-1
examples/src/bin/video_converter.rs
examples/src/bin/video_converter.rs
+0
-2
No files found.
examples/Cargo.toml
View file @
5ad45cef
...
...
@@ -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
=
[
"gst
reamer
-rtsp-server"
,
"gst
reamer
-rtsp"
,
"gst
reamer
-sdp"
]
gst-
rtsp-server-record
=
[
"gst
reamer
-rtsp-server-sys"
,
"gst
reamer
-rtsp-server"
,
"gst
reamer
-rtsp"
,
"gio"
]
v1_10
=
["gst
reamer
/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
=
[
"gst
reamer
-gl"
,
"gl_generator"
,
"glutin"
]
gl-egl
=
["gst
reamer
-gl/egl"]
gl-x11
=
["gst
reamer
-gl/x11"]
gl-wayland
=
["gst
reamer
-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"
...
...
examples/build.rs
View file @
5ad45cef
#[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
());
...
...
examples/src/bin/appsink.rs
View file @
5ad45cef
...
...
@@ -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
::
*
;
...
...
examples/src/bin/appsrc.rs
View file @
5ad45cef
...
...
@@ -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
};
...
...
examples/src/bin/custom_events.rs
View file @
5ad45cef
...
...
@@ -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"
]
...
...
examples/src/bin/custom_meta.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/debug_ringbuffer.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/decodebin.rs
View file @
5ad45cef
...
...
@@ -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
::
*
;
...
...
examples/src/bin/discoverer.rs
View file @
5ad45cef
...
...
@@ -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
(())
...
...
examples/src/bin/encodebin.rs
View file @
5ad45cef
...
...
@@ -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"
)]
...
...
examples/src/bin/events.rs
View file @
5ad45cef
...
...
@@ -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"
]
...
...
examples/src/bin/futures.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/ges.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/glib-futures.rs
View file @
5ad45cef
extern
crate
gstreamer
as
gst
;
use
gst
::
prelude
::
*
;
use
futures
::
prelude
::
*
;
...
...
examples/src/bin/glupload.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/gtksink.rs
View file @
5ad45cef
...
...
@@ -10,7 +10,6 @@
// (|)
// {videotestsrc} - {glsinkbin}
extern
crate
gstreamer
as
gst
;
use
gst
::
prelude
::
*
;
use
gio
::
prelude
::
*
;
...
...
examples/src/bin/gtkvideooverlay.rs
View file @
5ad45cef
...
...
@@ -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
::
*
;
...
...
examples/src/bin/iterator.rs
View file @
5ad45cef
...
...
@@ -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"
]
...
...
examples/src/bin/launch.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/launch_glib_main.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/overlay-composition.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/pad_probes.rs
View file @
5ad45cef
...
...
@@ -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
::
*
;
...
...
examples/src/bin/pango-cairo.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/playbin.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/player.rs
View file @
5ad45cef
...
...
@@ -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
};
...
...
examples/src/bin/queries.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/rtpfecclient.rs
View file @
5ad45cef
extern
crate
gstreamer
as
gst
;
use
gst
::
gst_element_error
;
use
gst
::
prelude
::
*
;
...
...
examples/src/bin/rtpfecserver.rs
View file @
5ad45cef
extern
crate
gstreamer
as
gst
;
use
gst
::
gst_element_error
;
use
gst
::
prelude
::
*
;
...
...
examples/src/bin/rtsp-server-record.rs
View file @
5ad45cef
...
...
@@ -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
,
<
bool
as
StaticType
>
::
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
,
<
bool
as
StaticType
>
::
static_type
()
.to_glib
()
as
*
const
u8
,
true
.to_glib
()
as
*
const
u8
,
ptr
::
null_mut
::
<
u8
>
(),
...
...
@@ -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
...
...
examples/src/bin/rtsp-server-subclass.rs
View file @
5ad45cef
...
...
@@ -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
...
...
examples/src/bin/rtsp-server.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/subclass.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/tagsetter.rs
View file @
5ad45cef
...
...
@@ -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
;
...
...
examples/src/bin/thumbnail.rs
View file @
5ad45cef
...
...
@@ -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
};
...
...
examples/src/bin/toc.rs
View file @
5ad45cef
...
...
@@ -9,7 +9,6 @@
// {filesrc} - {decodebin} - {queue} - {fakesink}
// \- ...
extern
crate
gstreamer
as
gst
;
use
gst
::
prelude
::
*
;
use
std
::
env
;
...
...
examples/src/bin/transmux.rs
View file @
5ad45cef
...
...
@@ -17,7 +17,6 @@
// {src} - {typefind} - {demuxer} -| {multiqueue} - {matroskamux} - {filesink}
// \-[video]-/
extern
crate
gstreamer
as
gst
;
use
gst
::
gst_element_error
;
use
gst
::
prelude
::
*
;
...
...
examples/src/bin/video_converter.rs
View file @
5ad45cef
...
...
@@ -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"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment