Compare commits

...

36 commits
main ... 0.10.3

Author SHA1 Message Date
Sebastian Dröge 4e4d226b71 Update Cargo.lock 2023-03-02 13:30:12 +02:00
Sebastian Dröge b903503a01 Update CHANGELOG.md for 0.10.3 2023-03-02 13:30:01 +02:00
Sebastian Dröge 20b18c23e6 Update versions to 0.10.3 2023-03-02 13:27:22 +02:00
Sebastian Dröge 160033cb5b Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Vivia Nikolaidou 3dde725560 ndisinkcombiner: Properly handle caps changes
We are caching one video buffer, so previously we were changing the src
caps one buffer too early.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Sebastian Dröge 1113e0aa51 deny: Update to allow socket2 0.4
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Sebastian Dröge 9b33184018 threadshare: Update to socket2 0.5
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Thibault Saunier 528f46a510 webrtcsink: Move RUNTIME to the crate so it can be reused
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Thibault Saunier 8b8f10691c webrtc: Enhance debug messages when using unknown peer ID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 11:00:23 +02:00
Guillaume Desmottes 6936bf65c4 tracers: queue_levels: add appsrc support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 10:50:19 +02:00
Sebastian Dröge b3cb41eae3 livesync: Correctly calculate fallback buffer duration from framerate
Numerator and denominator were switched.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 10:50:19 +02:00
Matthew Waters 84bae8b9cf webrtcsink: also support nvvidconv in lieu of nvvideoconvert
nvvideoconvert may not exist and nvvidconv might on some Jetson
platforms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1115>
2023-03-02 10:50:19 +02:00
Sebastian Dröge eb296a0e63 gtk4: Set sync point on the video frame after mapping it
Otherwise it is not always ready for use yet in GTK even after waiting
on the sync point, and a fully transparent texture is rendered instead.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/320

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1105>
2023-02-25 12:52:17 +02:00
Sebastian Dröge b64da48508 Update Cargo.lock 2023-02-23 10:16:33 +02:00
Sebastian Dröge 37877efc90 Update CHANGELOG.md for 0.10.2 2023-02-23 10:11:52 +02:00
Sebastian Dröge f22b3420b6 Update versions to 0.10.2 2023-02-23 10:07:43 +02:00
Jordan Petridis b17348b08d video/gtk4: Add a flatpak snippet example in the README
Close #155

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1102>
2023-02-23 09:41:07 +02:00
Sebastian Dröge bf0a23d560 gtk4: Attach channel receiver to the default main context from the main thread
It requires acquiring the main context for thread-safety reasons and
that is only possible from the main thread itself.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/319

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1100>
2023-02-22 14:22:08 +02:00
Sebastian Dröge 384a9d05f0 gtk4: Don't unnecessarily set the sink to READY to retrieve the context
That's not needed and will cause the GL context messages to be not
distributed inside the pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1100>
2023-02-22 14:22:06 +02:00
Sebastian Dröge eda0d9abe1 gtk4: Refactor and simplify GL context handling
Create a single, global GDK GL context and the corresponding GStreamer
GL display and wrapped GStreamer GL context when initializing the first
sink and continue using that for all further sinks.

Additionally, don't create a full GStreamer GL context inside the sink
but only distribute the wrapped GL context in the pipeline so that
elements that actually need a full GL context can create one that is
sharing with that one. The sink itself does not need a full GStreamer GL
context.

Then inside the sink check that any GL memory that arrives was created
by a GL context that can share with the wrapped GDK GL context and only
then use it.

And lastly, use the correct GL contexts for a) creating a sync point and
b) actually waiting on it.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/318

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1100>
2023-02-22 14:22:05 +02:00
Seungha Yang 3c4d22bc5c mp4mux: Ignore framerate update
like mp4mux in -good does already

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1097>
2023-02-21 16:16:31 +02:00
Seungha Yang 56a25af929 fmp4mux: Ignore framerate update
like mp4mux in -good does already

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1097>
2023-02-21 16:16:25 +02:00
Arun Raghavan 54adcb8482 hlssink3: Allow GIOStream signal handlers to return None
If creating a playlist or fragment stream fails (disk is full, the
directory is removed, ...), we will currently crash because the signal
handler expects a non-None GIOStream. The actual callback is allowed to
return None values and we handle this in the caller, so let's not have
this restriction on the signal handler.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1097>
2023-02-21 16:16:16 +02:00
Sebastian Dröge 46d7c177c2 Update Cargo.lock 2023-02-13 15:03:23 +02:00
Sebastian Dröge 2fc2357306 Add mp4 plugin to README.md 2023-02-13 11:56:50 +02:00
Sebastian Dröge 9cd68ffb5f Update CHANGELOG.md for 0.10.1 2023-02-13 11:53:31 +02:00
Sebastian Dröge 73a5703eeb Update versions to 0.10.1 2023-02-13 11:52:37 +02:00
Sebastian Dröge 7d7f73768b Add CHANGELOG.md for 0.10.0 release
This is the first one and only lists changes from 0.9.0 to 0.10.0
2023-02-12 13:16:21 +02:00
Sebastian Dröge 510cda303a Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1091>
2023-02-11 20:37:29 +02:00
Sebastian Dröge d2cd2ef5ac ci: Don't run cargo update on the stable branch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1091>
2023-02-11 20:15:03 +02:00
Seungha Yang a505dba3a2 rtpav1pay: Fix Leb128Bytes size parsing
There are multiple ways of encoding the value, and don't assume
that bitstream used the way used in this plugin. Instead, count
the number of used bytes.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/312
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1091>
2023-02-11 19:44:08 +02:00
Sebastian Dröge a4d5a35403 Update to async-tungstenite 0.20
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1091>
2023-02-11 19:44:01 +02:00
Sebastian Dröge 8a6895a73e Add Cargo.lock 2023-02-10 00:36:39 +02:00
Sebastian Dröge f3c1a91fb9 Add versions to local dependencies 2023-02-10 00:36:22 +02:00
Sebastian Dröge 6df679d69f Update to gtk-rs-core 0.17, gtk4-rs 0.6 and gstreamer-rs 0.20 branches 2023-02-10 00:33:25 +02:00
Sebastian Dröge 85bf8d6c63 Update versions to 0.10.0 2023-02-10 00:26:24 +02:00
69 changed files with 7196 additions and 782 deletions

View file

@ -72,13 +72,6 @@ trigger:
before_script:
- source ./ci/env.sh
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
# If cargo exists assume we probably will want to update
# the lockfile
- |
if command -v cargo; then
cargo generate-lockfile
cargo update
fi
.debian:11-stable:
extends: .debian:11

101
CHANGELOG.md Normal file
View file

@ -0,0 +1,101 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.10.3] - 2023-03-02
### Added
- tracers: `queue_levels` tracer now also supports printing the `appsrc` levels.
- webrtc: `webrtcsink` can use `nvvidconv` if `nvvideoconvert` does not exist
on an NVIDIA platform.
### Fixed
- gtk4: Set the sync point on the video frame after mapping it as otherwise
the frame might not be ready yet for further usage.
- livesync: Correctly calculate the fallback buffer duration from the video
framerate.
- ndi: Handle caps changes correctly in `ndisinkcombiner`.
### Changed
- webrtc: Minor cleanup.
## [0.10.2] - 2023-02-23
### Fixed
- hlssink3: Allow signal handlers to return `None`
- gtk4: Make GL context sharing more reliable in pipelines with multiple
`gtk4paintablesinks`
- gtk4: Attach channel receiver to the main context from the correct thread to
make it possible to start the sink from a different thread than the main
thread without having retrieved the paintable from the main thread before.
- fmp4mux/mp4mux: Ignore caps changes if only the framerate changes.
### Changed
- gtk4: Simplify and refactor GL context sharing. Apart from being more
reliable this reduces GL resource usage.
## [0.10.1] - 2023-02-13
### Fixed
- rtpav1pay: Fix calculation of Leb128 size size to work correctly with
streams from certain encoders.
## [0.10.0] - 2023-02-10
### Fixed
- audiornnoise: Use correct value range for the samples
- awss3sink: Treat stopping without EOS as an error for multipart upload
- awss3hlssink: Fix the name of the hlssink child element
- awss3hlssink: Fix deadlock on EOS
- dav1d: Various fixes to improve performance, to handle decoding errors more
gracefully and to make sure all frames are output in the end
- fmp4mux: Various fixes to fragment splitting behaviour, output formatting
and header generation
- gtk4: Various stability and rendering fixes
- meson: Various fixes and improvements to the meson-based build system
- ndi: provide non-Linux/macOS UNIX fallback for the soname
- ndisrc: Use default channel mask for audio output to allow >2 channels to
work better
- rav1e: Correctly enable threading support
- rtpav1: Various fixes to the payloader and depayloader to handle streams
more correctly and to handle errors more cleanly
- rtpav1depay: Set caps on the source pad
- spotify: fix "start a runtime from within a runtime" with static link
- textahead: fix previous buffers
- textwrap: Don't panic on empty buffers
- tttocea608: Don't fail if a GAP event contains no duration
- webrtchttp: whipsink: construct TURN URL correctly
- webrtcsink: fix panic on pre-bwe request error
- whipsink: Send ICE candidates together with the offer
- whipsink: Various cleanups and minor fixes
### Added
- audiornnoise: Add voice detection threshold property
- awss3hlssink: Add `stats` property
- awss3sink: Add properties to set Content-Type and Content-Disposition
- fmp4mux: add 'offset-to-zero' property
- fmp4mux/mp4mux: add support for muxing Opus, VP8, VP9 and AV1 streams
- fmp4mux/mp4mux: Make media/track timescales configurable
- fmp4mux: Add support for CMAF-style chunking, e.g. low-latency / LL HLS and DASH
- gtk4: Support for rendering GL textures on X11/EGL, X11/GLX, Wayland and macOS
- hlssink3: Allow generating i-frame-only playlist
- livesync: New element that alllows maintaining a contiguous live stream
without gaps from a potentially unstable source.
- mp4mux: New non-fragmented MP4 muxer element
- spotifyaudiosrc: Support configurable bitrate
- textahead: add settings to display previous buffers
- threadshare: Introduce new ts-audiotestsrc
- webrtcsink: Support nvv4l2vp9enc
- whepsource: Add a WebRTC WHEP source element
### Changed
- audiofx: Derive from AudioFilter where possible
- dav1ddec: Lower rank to primary to allow usage of hardware decoders with
higher ranks
- fmp4mux: Only push `fragment_offset` if `write-mfra` is true to reduce memory usage
- webrtcsink: Make the `turn-server` property a `turn-servers` list
- webrtcsink: Move from async-std to tokio
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/compare/0.10.2...HEAD
[0.10.2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/compare/0.10.1...0.10.2
[0.10.1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/compare/0.10.0...0.10.1
[0.10.0]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/compare/0.9.0...0.10.0

6208
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -110,6 +110,8 @@ You will find the following plugins in this repository:
- `fmp4`: A fragmented MP4/ISOBMFF/CMAF muxer for generating e.g. DASH/HLS media fragments.
- `mp4`: A non-fragmented MP4 muxer for generating MP4 files.
* `text`
- `ahead`: A plugin to display upcoming text buffers ahead.

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-audiofx"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,9 +9,9 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
anyhow = "1"
byte-slice-cast = "1.0"
num-traits = "0.2"
@ -29,11 +29,11 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-claxon"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Ruben Gonzalez <rgonzalez@fluendo.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,15 +9,15 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
claxon = { version = "0.4" }
byte-slice-cast = "1.0"
atomic_refcell = "0.1"
once_cell = "1"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstclaxon"
@ -25,7 +25,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-csound"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Natanael Mojica <neithanmo@gmail.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,15 +9,15 @@ rust-version = "1.63"
description = "GStreamer Audio Filter plugin based on Csound"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
csound = "0.1.8"
once_cell = "1.0"
byte-slice-cast = "1.0"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstcsound"
@ -29,7 +29,7 @@ name = "csound-effect"
path = "examples/effect_example.rs"
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-lewton"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,15 +9,15 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
lewton = { version = "0.10", default-features = false }
byte-slice-cast = "1.0"
atomic_refcell = "0.1"
once_cell = "1.0"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstlewton"
@ -25,7 +25,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-spotify"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Guillaume Desmottes <guillaume@desmottes.be>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,8 +9,8 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
librespot = { version = "0.4", default-features = false }
tokio = "1.0"
@ -24,7 +24,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -136,6 +136,11 @@ version = "0.13"
name = "windows-sys"
version = "0.42"
# Various crates depend on an older version of socket2
[[bans.skip]]
name = "socket2"
version = "0.4"
[sources]
unknown-registry = "deny"
unknown-git = "deny"

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-file"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -10,8 +10,8 @@ rust-version = "1.63"
[dependencies]
url = "2"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
[lib]
@ -20,7 +20,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-sodium"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Jordan Petridis <jordan@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
description = "GStreamer plugin for libsodium-based file encryption and decryption"
@ -9,8 +9,8 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package="gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package="gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
sodiumoxide = "0.2.1"
once_cell = "1.3.0"
hex = "0.4"
@ -27,10 +27,14 @@ rand = "0.8"
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[dev-dependencies.gst-app]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-app"
[lib]
@ -54,7 +58,7 @@ path = "examples/decrypt_example.rs"
required-features = ["serde", "serde_json", "clap"]
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-threadshare"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "LGPL-2.1-or-later"
description = "GStreamer Threadshare Plugin"
@ -14,17 +14,17 @@ concurrent-queue = "2"
flume = "0.10.13"
futures = "0.3.21"
libc = "0.2"
gio = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-net = { package = "gstreamer-net", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-net = { package = "gstreamer-net", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1"
pin-project-lite = "0.2.0"
polling = "2.2.0"
rand = "0.8"
slab = "0.4.7"
socket2 = {features = ["all"], version = "0.4"}
socket2 = {features = ["all"], version = "0.5"}
waker-fn = "1.1"
# Used by examples
@ -34,8 +34,8 @@ clap = { version = "4", features = ["derive"], optional = true }
winapi = { version = "0.3.9", features = ["winsock2", "processthreadsapi"] }
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstthreadshare"
@ -59,7 +59,7 @@ name = "ts-standalone"
path = "examples/standalone/main.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
cc = "1.0.38"
pkg-config = "0.3.15"

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-flavors"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,9 +9,9 @@ rust-version = "1.63"
description = "GStreamer Rust FLV Plugin"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
num-rational = { version = "0.4", default-features = false, features = [] }
nom = "7"
flavors = { git = "https://github.com/rust-av/flavors" }
@ -26,7 +26,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-fmp4"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "MPL-2.0"
description = "GStreamer Fragmented MP4 Plugin"
@ -10,11 +10,11 @@ rust-version = "1.63"
[dependencies]
anyhow = "1"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
once_cell = "1.0"
[lib]
@ -23,14 +23,14 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[dev-dependencies]
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
m3u8-rs = "5.0"
chrono = "0.4"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
default = []

View file

@ -2942,10 +2942,15 @@ impl AggregatorImpl for FMP4Mux {
match query.view_mut() {
QueryViewMut::Caps(q) => {
let allowed_caps = aggregator_pad
let mut allowed_caps = aggregator_pad
.current_caps()
.unwrap_or_else(|| aggregator_pad.pad_template_caps());
// Allow framerate change
for s in allowed_caps.make_mut().iter_mut() {
s.remove_field("framerate");
}
if let Some(filter_caps) = q.filter() {
let res = filter_caps
.intersect_with_mode(&allowed_caps, gst::CapsIntersectMode::First);

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-mp4"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "MPL-2.0"
description = "GStreamer Rust MP4 Plugin"
@ -10,11 +10,11 @@ rust-version = "1.63"
[dependencies]
anyhow = "1"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
once_cell = "1.0"
[lib]
@ -27,7 +27,7 @@ tempfile = "3"
url = "2"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
default = []

View file

@ -1097,10 +1097,15 @@ impl AggregatorImpl for MP4Mux {
match query.view_mut() {
QueryViewMut::Caps(q) => {
let allowed_caps = aggregator_pad
let mut allowed_caps = aggregator_pad
.current_caps()
.unwrap_or_else(|| aggregator_pad.pad_template_caps());
// Allow framerate change
for s in allowed_caps.make_mut().iter_mut() {
s.remove_field("framerate");
}
if let Some(filter_caps) = q.filter() {
let res = filter_caps
.intersect_with_mode(&allowed_caps, gst::CapsIntersectMode::First);

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-aws"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Arun Raghavan <arun@arunraghavan.net>",
"Jordan Petridis <jordan@centricular.com>",
"Mathieu Duponchelle <mathieu@centricular.com>"]
@ -13,9 +13,9 @@ rust-version = "1.63"
[dependencies]
bytes = "1.0"
futures = "0.3"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
aws-config = "0.54.0"
aws-sdk-s3 = "0.24.0"
aws-sdk-transcribe = "0.24.0"
@ -29,7 +29,7 @@ chrono = "0.4"
url = "2"
percent-encoding = "2"
tokio = { version = "1.0", features = [ "full" ] }
async-tungstenite = { version = "0.19", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
async-tungstenite = { version = "0.20", features = ["tokio", "tokio-runtime", "tokio-native-tls"] }
nom = "7"
crc = "3"
byteorder = "1.3.4"
@ -40,12 +40,12 @@ serde_json = "1"
atomic_refcell = "0.1"
base32 = "0.4"
backoff = { version = "0.4", features = [ "futures", "tokio" ] }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", package = "gio" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core.git", branch = "0.17", version = "0.17", package = "gio" }
[dev-dependencies]
chrono = { version = "0.4", features = [ "alloc" ] }
env_logger = "0.10"
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
rand = "0.8"
test-with = { version = "0.9", default-features = false }
@ -55,7 +55,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -2,27 +2,27 @@
name = "gst-plugin-hlssink3"
description = "GStreamer HLS (HTTP Live Streaming) Plugin"
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Rafael Caricio <rafael@caricio.com>"]
edition = "2021"
license = "MPL-2.0"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
once_cell = "1.7.2"
m3u8-rs = "5.0"
regex = "1"
[dev-dependencies]
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[lib]
name = "gsthlssink3"

View file

@ -417,7 +417,7 @@ impl BinImpl for HlsSink3 {
"splitmuxsink-fragment-closed" => {
let s = msg.structure().unwrap();
if let Ok(fragment_closed_at) = s.get::<gst::ClockTime>("running-time") {
self.write_playlist(Some(fragment_closed_at)).unwrap();
let _ = self.write_playlist(Some(fragment_closed_at));
}
}
_ => {}
@ -574,7 +574,7 @@ impl ObjectImpl for HlsSink3 {
vec![
glib::subclass::Signal::builder(SIGNAL_GET_PLAYLIST_STREAM)
.param_types([String::static_type()])
.return_type::<gio::OutputStream>()
.return_type::<Option<gio::OutputStream>>()
.class_handler(|_, args| {
let element = args[0]
.get::<super::HlsSink3>()
@ -583,12 +583,7 @@ impl ObjectImpl for HlsSink3 {
args[1].get::<String>().expect("playlist-stream signal arg");
let hlssink3 = element.imp();
Some(
hlssink3
.new_file_stream(&playlist_location)
.ok()?
.to_value(),
)
Some(hlssink3.new_file_stream(&playlist_location).ok().to_value())
})
.accumulator(|_hint, ret, value| {
// First signal handler wins
@ -598,7 +593,7 @@ impl ObjectImpl for HlsSink3 {
.build(),
glib::subclass::Signal::builder(SIGNAL_GET_FRAGMENT_STREAM)
.param_types([String::static_type()])
.return_type::<gio::OutputStream>()
.return_type::<Option<gio::OutputStream>>()
.class_handler(|_, args| {
let element = args[0]
.get::<super::HlsSink3>()
@ -607,12 +602,7 @@ impl ObjectImpl for HlsSink3 {
args[1].get::<String>().expect("fragment-stream signal arg");
let hlssink3 = element.imp();
Some(
hlssink3
.new_file_stream(&fragment_location)
.ok()?
.to_value(),
)
Some(hlssink3.new_file_stream(&fragment_location).ok().to_value())
})
.accumulator(|_hint, ret, value| {
// First signal handler wins
@ -767,7 +757,8 @@ impl ElementImpl for HlsSink3 {
};
if write_final {
self.write_final_playlist()?;
// Don't fail transitioning to READY if this fails
let _ = self.write_final_playlist();
}
}
gst::StateChange::ReadyToNull => {

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-ndi"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Ruben Gonzalez <rubenrua@teltek.es>", "Daniel Vilar <daniel.peiteado@teltek.es>", "Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,11 +9,11 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs-core"}
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17"}
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
byte-slice-cast = "1"
once_cell = "1.0"
byteorder = "1.0"
@ -21,7 +21,7 @@ atomic_refcell = "0.1"
libloading = "0.7"
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[features]
default = ["interlaced-fields", "sink"]

View file

@ -25,7 +25,16 @@ struct State {
// to the current_video_buffer below!
video_info: Option<gst_video::VideoInfo>,
audio_info: Option<gst_audio::AudioInfo>,
current_video_buffer: Option<(gst::Buffer, gst::ClockTime)>,
// These are only ever set when a change is pending mid-stream. They apply to the currently
// pending buffer on the pad and not to the current_video_buffer.
pending_caps: Option<gst::Caps>,
pending_segment: Option<gst::Segment>,
current_video_buffer: Option<(
gst::Buffer,
gst::ClockTime,
Option<gst::Caps>,
Option<gst::Segment>,
)>,
current_audio_buffers: Vec<(gst::Buffer, gst_audio::AudioInfo, i64)>,
}
@ -181,6 +190,8 @@ impl AggregatorImpl for NdiSinkCombiner {
*state_storage = Some(State {
audio_info: None,
video_info: None,
pending_caps: None,
pending_segment: None,
current_video_buffer: None,
current_audio_buffers: Vec::new(),
});
@ -373,75 +384,87 @@ impl AggregatorImpl for NdiSinkCombiner {
None => return Err(gst::FlowError::Flushing),
};
let (mut current_video_buffer, current_video_running_time_end, next_video_buffer) =
if let Some((video_buffer, video_segment)) = video_buffer_and_segment {
let video_running_time = video_segment.to_running_time(video_buffer.pts()).unwrap();
let (
mut current_video_buffer,
current_video_running_time_end,
pending_caps,
pending_segment,
next_video_buffer,
) = if let Some((video_buffer, video_segment)) = video_buffer_and_segment {
let video_running_time = video_segment.to_running_time(video_buffer.pts()).unwrap();
if let Some(pending_segment) = &state.pending_segment {
assert_eq!(video_segment.upcast_ref(), pending_segment);
}
match state.current_video_buffer {
None => {
gst::trace!(CAT, imp: self, "First video buffer, waiting for second");
state.current_video_buffer = Some((video_buffer, video_running_time));
drop(state_storage);
self.video_pad.drop_buffer();
return Err(gst_base::AGGREGATOR_FLOW_NEED_DATA);
}
Some((ref buffer, _)) => (
buffer.clone(),
Some(video_running_time),
Some((video_buffer, video_running_time)),
),
match &state.current_video_buffer {
None => {
gst::trace!(CAT, imp: self, "First video buffer, waiting for second");
state.current_video_buffer = Some((
video_buffer,
video_running_time,
state.pending_caps.take(),
state.pending_segment.take(),
));
drop(state_storage);
self.video_pad.drop_buffer();
return Err(gst_base::AGGREGATOR_FLOW_NEED_DATA);
}
} else {
match (&state.current_video_buffer, &audio_buffer_segment_and_pad) {
(None, None) => {
gst::trace!(
CAT,
imp: self,
"All pads are EOS and no buffers are queued, finishing"
);
return Err(gst::FlowError::Eos);
}
(None, Some((ref audio_buffer, ref audio_segment, _))) => {
// Create an empty dummy buffer for attaching the audio. This is going to
// be dropped by the sink later.
let audio_running_time =
audio_segment.to_running_time(audio_buffer.pts()).unwrap();
Some((ref buffer, _, pending_caps, pending_segment)) => (
buffer.clone(),
Some(video_running_time),
pending_caps.clone(),
pending_segment.clone(),
Some((video_buffer, video_running_time)),
),
}
} else {
match (&state.current_video_buffer, &audio_buffer_segment_and_pad) {
(None, None) => {
gst::trace!(
CAT,
imp: self,
"All pads are EOS and no buffers are queued, finishing"
);
return Err(gst::FlowError::Eos);
}
(None, Some((ref audio_buffer, ref audio_segment, _))) => {
// Create an empty dummy buffer for attaching the audio. This is going to
// be dropped by the sink later.
let audio_running_time =
audio_segment.to_running_time(audio_buffer.pts()).unwrap();
let video_segment = self.video_pad.segment();
let video_segment = match video_segment.downcast::<gst::ClockTime>() {
Ok(video_segment) => video_segment,
Err(video_segment) => {
gst::error!(
CAT,
imp: self,
"Video segment of wrong format {:?}",
video_segment.format()
);
return Err(gst::FlowError::Error);
}
};
let video_pts =
video_segment.position_from_running_time(audio_running_time);
if video_pts.is_none() {
gst::warning!(
let video_segment = self.video_pad.segment();
let video_segment = match video_segment.downcast::<gst::ClockTime>() {
Ok(video_segment) => video_segment,
Err(video_segment) => {
gst::error!(
CAT,
imp: self,
"Can't output more audio after video EOS"
"Video segment of wrong format {:?}",
video_segment.format()
);
return Err(gst::FlowError::Eos);
return Err(gst::FlowError::Error);
}
let mut buffer = gst::Buffer::new();
{
let buffer = buffer.get_mut().unwrap();
buffer.set_pts(video_pts);
}
(buffer, gst::ClockTime::NONE, None)
};
let video_pts = video_segment.position_from_running_time(audio_running_time);
if video_pts.is_none() {
gst::warning!(CAT, imp: self, "Can't output more audio after video EOS");
return Err(gst::FlowError::Eos);
}
(Some((ref buffer, _)), _) => (buffer.clone(), gst::ClockTime::NONE, None),
let mut buffer = gst::Buffer::new();
{
let buffer = buffer.get_mut().unwrap();
buffer.set_pts(video_pts);
}
(buffer, gst::ClockTime::NONE, None, None, None)
}
};
(Some((ref buffer, _, _, _)), _) => {
(buffer.clone(), gst::ClockTime::NONE, None, None, None)
}
}
};
if let Some((audio_buffer, audio_segment, audio_pad)) = audio_buffer_segment_and_pad {
let audio_info = match state.audio_info {
@ -508,7 +531,7 @@ impl AggregatorImpl for NdiSinkCombiner {
}
if let Some((video_buffer, video_running_time)) = next_video_buffer {
state.current_video_buffer = Some((video_buffer, video_running_time));
state.current_video_buffer = Some((video_buffer, video_running_time, None, None));
drop(state_storage);
self.video_pad.drop_buffer();
} else {
@ -522,7 +545,14 @@ impl AggregatorImpl for NdiSinkCombiner {
"Finishing video buffer {:?}",
current_video_buffer
);
self.obj().finish_buffer(current_video_buffer)
if let Some(caps) = pending_caps {
self.obj().set_src_caps(&caps);
}
if let Some(segment) = pending_segment {
self.obj().update_segment(&segment);
}
let ret = self.obj().finish_buffer(current_video_buffer);
ret
}
fn sink_event(&self, pad: &gst_base::AggregatorPad, event: gst::Event) -> bool {
@ -539,6 +569,7 @@ impl AggregatorImpl for NdiSinkCombiner {
};
if pad == &self.video_pad {
let mut send_caps_immediately = true;
let info = match gst_video::VideoInfo::from_caps(&caps) {
Ok(info) => info,
Err(_) => {
@ -559,13 +590,21 @@ impl AggregatorImpl for NdiSinkCombiner {
};
state.video_info = Some(info);
if state.current_video_buffer.is_some() {
state.pending_caps = Some(caps.clone());
send_caps_immediately = false;
} else {
state.pending_caps = None;
}
drop(state_storage);
self.obj().set_latency(latency, gst::ClockTime::NONE);
// The video caps are passed through as the audio is included only in a meta
self.obj().set_src_caps(&caps);
if send_caps_immediately {
self.obj().set_src_caps(&caps);
}
} else {
let info = match gst_audio::AudioInfo::from_caps(&caps) {
Ok(info) => info,
@ -582,7 +621,33 @@ impl AggregatorImpl for NdiSinkCombiner {
EventView::Segment(segment) if pad == &self.video_pad => {
let segment = segment.segment();
gst::debug!(CAT, obj: pad, "Updating segment {:?}", segment);
self.obj().update_segment(segment);
let mut state_storage = self.state.lock().unwrap();
let state = match &mut *state_storage {
Some(ref mut state) => state,
None => return false,
};
let mut send_segment_immediately = true;
if state.current_video_buffer.is_some() {
state.pending_segment = Some(segment.clone());
send_segment_immediately = false;
} else {
state.pending_caps = None;
}
drop(state_storage);
if send_segment_immediately {
self.obj().update_segment(segment);
}
}
EventView::FlushStop(_) if pad == &self.video_pad => {
let mut state_storage = self.state.lock().unwrap();
let state = match &mut *state_storage {
Some(ref mut state) => state,
None => return false,
};
state.pending_segment = None;
state.pending_caps = None;
}
_ => (),
}

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-onvif"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,16 +9,16 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
once_cell = "1.0"
xmlparser = "0.13"
chrono = { version = "0.4", default-features = false }
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"] }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core" }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core" }
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", features=["use_glib"] }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
xmltree = "0.10"
[lib]
@ -27,7 +27,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-raptorq"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Tomasz Andrzejak <andreiltd@gmail.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
description = "GStreamer RaptorQ FEC Plugin"
@ -9,14 +9,14 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
raptorq = "1.7"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
rand = "0.8"
[lib]
@ -25,7 +25,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-reqwest"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -14,14 +14,14 @@ reqwest = { version = "0.11", features = ["cookies", "gzip"] }
futures = "0.3"
headers = "0.3"
mime = "0.3"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
tokio = { version = "1.0", default-features = false, features = ["time", "rt-multi-thread"] }
once_cell = "1.0"
[dev-dependencies]
hyper = { version = "0.14", features = ["server"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstreqwest"
@ -29,7 +29,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-rtp"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Vivienne Watermeier <vwatermeier@igalia.com>", "Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -10,16 +10,16 @@ rust-version = "1.63"
[dependencies]
bitstream-io = "1.3"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"]}
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
gst-rtp = { package = "gstreamer-rtp", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"]}
once_cell = "1.0"
chrono = { version = "0.4", default-features = false }
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_20"] }
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[lib]
name = "gstrsrtp"

View file

@ -12,23 +12,25 @@
use bitstream_io::{BitRead, BitReader, BitWrite, BitWriter, Endianness};
use std::io::{self, Read, Seek, Write};
pub fn parse_leb128<R, E>(reader: &mut BitReader<R, E>) -> io::Result<u32>
pub fn parse_leb128<R, E>(reader: &mut BitReader<R, E>) -> io::Result<(u32, u32)>
where
R: Read + Seek,
E: Endianness,
{
let mut value = 0;
let mut num_bytes = 0;
for i in 0..8 {
let byte = reader.read::<u32>(8)?;
value |= (byte & 0x7f) << (i * 7);
num_bytes += 1;
if byte & 0x80 == 0 {
break;
}
}
reader.byte_align();
Ok(value)
Ok((value, num_bytes))
}
pub fn write_leb128<W, E>(writer: &mut BitWriter<W, E>, mut value: u32) -> io::Result<()>
@ -82,7 +84,10 @@ mod tests {
println!("testing: value={value}");
let mut reader = BitReader::endian(Cursor::new(&encoding), BigEndian);
assert_eq!(value, parse_leb128(&mut reader).unwrap());
assert_eq!(
(value, encoding.len() as u32),
parse_leb128(&mut reader).unwrap()
);
assert_eq!(
encoding.len() as u64 * 8,
reader.position_in_bits().unwrap()
@ -96,7 +101,10 @@ mod tests {
data.set_position(0);
let mut reader = BitReader::endian(data, BigEndian);
assert_eq!(value, parse_leb128(&mut reader).unwrap());
assert_eq!(
(value, encoding.len() as u32),
parse_leb128(&mut reader).unwrap()
);
}
}
}

View file

@ -7,7 +7,7 @@
//
// SPDX-License-Identifier: MPL-2.0
use crate::av1::common::{leb128_size, parse_leb128};
use crate::av1::common::parse_leb128;
use bitstream_io::{BitRead, BitReader, Endianness};
use std::io::{self, Read, Seek};
@ -165,8 +165,7 @@ impl SizedObu {
reader.byte_align();
let size = parse_leb128(reader)?;
let leb_size = leb128_size(size) as u32;
let (size, leb_size) = parse_leb128(reader)?;
Ok(Self {
obu_type,

View file

@ -393,24 +393,21 @@ impl RTPAv1Depay {
aggr_header: &AggregationHeader,
index: u32,
) -> Result<(u32, bool), gst::FlowError> {
let element_size: u32;
let is_last_obu: bool;
if let Some(count) = aggr_header.obu_count {
let element_size = if let Some(count) = aggr_header.obu_count {
is_last_obu = index + 1 == count as u32;
element_size = if is_last_obu {
if is_last_obu {
rtp.payload_size() - (reader.position() as u32)
} else {
let mut bitreader = BitReader::endian(reader, ENDIANNESS);
parse_leb128(&mut bitreader).map_err(err_flow!(self, leb_read))?
let (size, _) = parse_leb128(&mut bitreader).map_err(err_flow!(self, leb_read))?;
size
}
} else {
element_size = parse_leb128(&mut BitReader::endian(&mut *reader, ENDIANNESS))
let (size, _) = parse_leb128(&mut BitReader::endian(&mut *reader, ENDIANNESS))
.map_err(err_flow!(self, leb_read))?;
is_last_obu = match rtp
.payload_size()
.cmp(&(reader.position() as u32 + element_size))
{
is_last_obu = match rtp.payload_size().cmp(&(reader.position() as u32 + size)) {
Ordering::Greater => false,
Ordering::Equal => true,
Ordering::Less => {
@ -422,7 +419,8 @@ impl RTPAv1Depay {
return Err(gst::FlowError::Error);
}
};
}
size
};
Ok((element_size, is_last_obu))
}

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-webrtc"
version = "0.10.0-alpha.1"
version = "0.10.3"
edition = "2021"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Thibault Saunier <tsaunier@igalia.com>"]
license = "MPL-2.0"
@ -9,13 +9,13 @@ repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
rust-version = "1.63"
[dependencies]
gst = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer", features = ["v1_20", "serde"] }
gst-app = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-app", features = ["v1_20"] }
gst-video = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-video", features = ["v1_20", "serde"] }
gst-webrtc = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-webrtc", features = ["v1_20"] }
gst-sdp = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-sdp", features = ["v1_20"] }
gst-rtp = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-rtp", features = ["v1_20"] }
gst-utils = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", package = "gstreamer-utils" }
gst = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer", features = ["v1_20", "serde"] }
gst-app = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-app", features = ["v1_20"] }
gst-video = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-video", features = ["v1_20", "serde"] }
gst-webrtc = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-webrtc", features = ["v1_20"] }
gst-sdp = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-sdp", features = ["v1_20"] }
gst-rtp = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-rtp", features = ["v1_20"] }
gst-utils = { git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", package = "gstreamer-utils" }
once_cell = "1.0"
anyhow = "1"
thiserror = "1"
@ -23,11 +23,11 @@ futures = "0.3"
tokio = { version = "1", features = ["fs", "macros", "rt-multi-thread", "time"] }
tokio-native-tls = "0.3.0"
tokio-stream = "0.1.11"
async-tungstenite = { version = "0.19", features = ["tokio-runtime", "tokio-native-tls"] }
async-tungstenite = { version = "0.20", features = ["tokio-runtime", "tokio-native-tls"] }
serde = "1"
serde_json = "1"
fastrand = "1.0"
gst_plugin_webrtc_protocol = { path="protocol", package = "gst-plugin-webrtc-signalling-protocol" }
gst_plugin_webrtc_protocol = { path="protocol", version = "0.10", package = "gst-plugin-webrtc-signalling-protocol" }
human_bytes = "0.4"
[dev-dependencies]
@ -43,7 +43,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-webrtc-signalling-protocol"
version = "0.10.0-alpha.1"
version = "0.10.3"
edition = "2021"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-webrtc-signalling"
version = "0.10.0-alpha.1"
version = "0.10.3"
edition = "2021"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"
@ -13,7 +13,7 @@ once_cell = "1.0"
anyhow = "1"
tokio = { version = "1", features = ["fs", "io-util", "macros", "rt-multi-thread", "time"] }
tokio-native-tls = "0.3.0"
async-tungstenite = { version = "0.19", features = ["tokio-runtime", "tokio-native-tls"] }
async-tungstenite = { version = "0.20", features = ["tokio-runtime", "tokio-native-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
clap = { version = "4", features = ["derive"] }
@ -25,7 +25,7 @@ uuid = { version = "1", features = ["v4"] }
thiserror = "1"
test-log = { version = "0.2", features = ["trace"], default-features = false }
pin-project-lite = "0.2"
gst_plugin_webrtc_protocol = { path="../protocol", package = "gst-plugin-webrtc-signalling-protocol" }
gst_plugin_webrtc_protocol = { path="../protocol", version = "0.10", package = "gst-plugin-webrtc-signalling-protocol" }
[[bin]]
name = "gst-webrtc-signalling-server"

View file

@ -264,7 +264,7 @@ impl Handler {
#[instrument(level = "debug", skip(self))]
fn start_session(&mut self, producer_id: &str, consumer_id: &str) -> Result<(), Error> {
self.peers.get(producer_id).map_or_else(
|| Err(anyhow!("Peer '{producer_id}' hasn't been welcomed")),
|| Err(anyhow!("No producer with ID: '{producer_id}'")),
|peer| {
if !peer.producing() {
Err(anyhow!(
@ -277,10 +277,9 @@ impl Handler {
},
)?;
self.peers.get(consumer_id).map_or_else(
|| Err(anyhow!("Peer '{consumer_id}' hasn't been welcomed")),
Ok,
)?;
self.peers
.get(consumer_id)
.map_or_else(|| Err(anyhow!("No consumer with ID: '{consumer_id}'")), Ok)?;
let session_id = uuid::Uuid::new_v4().to_string();
self.sessions.insert(
@ -1083,7 +1082,7 @@ mod tests {
assert_eq!(
sent_message,
p::OutgoingMessage::Error {
details: "Peer 'producer' hasn't been welcomed".into()
details: "No producer with ID: 'producer'".into()
}
);
}
@ -1285,7 +1284,7 @@ mod tests {
assert_eq!(
sent_message,
p::OutgoingMessage::Error {
details: "Peer 'consumer' hasn't been welcomed".into()
details: "No consumer with ID: 'consumer'".into()
}
);
}

View file

@ -7,6 +7,8 @@
* Since: plugins-rs-0.9
*/
use gst::glib;
use once_cell::sync::Lazy;
use tokio::runtime;
mod signaller;
pub mod webrtcsink;
@ -28,3 +30,11 @@ gst::plugin_define!(
env!("CARGO_PKG_REPOSITORY"),
env!("BUILD_REL_DATE")
);
pub static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
runtime::Builder::new_multi_thread()
.enable_all()
.worker_threads(1)
.build()
.unwrap()
});

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use crate::webrtcsink::{WebRTCSink, RUNTIME};
use crate::{webrtcsink::WebRTCSink, RUNTIME};
use anyhow::{anyhow, Error};
use async_tungstenite::tungstenite::Message as WsMessage;
use futures::channel::mpsc;

View file

@ -20,7 +20,7 @@ use std::sync::Mutex;
use super::homegrown_cc::CongestionController;
use super::{WebRTCSinkCongestionControl, WebRTCSinkError, WebRTCSinkMitigationMode};
use crate::signaller::Signaller;
use crate::webrtcsink::RUNTIME;
use crate::RUNTIME;
use std::collections::BTreeMap;
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
@ -336,9 +336,13 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
(glupload, glscale)
} else if feature.contains(NVMM_MEMORY_FEATURE) {
let queue = make_element("queue", None)?;
let nvconvert = make_element("nvvideoconvert", None)?;
nvconvert.set_property("compute-hw", 0);
nvconvert.set_property("nvbuf-memory-type", 0);
let nvconvert = if let Ok(nvconvert) = make_element("nvvideoconvert", None) {
nvconvert.set_property("compute-hw", 0);
nvconvert.set_property("nvbuf-memory-type", 0);
nvconvert
} else {
make_element("nvvidconv", None)?
};
ret.add_many(&[&queue, &nvconvert])?;
gst::Element::link_many(&[&queue, &nvconvert])?;

View file

@ -9,9 +9,7 @@
use gst::glib;
use gst::prelude::*;
use gst::subclass::prelude::*;
use once_cell::sync::Lazy;
use std::error::Error;
use tokio::runtime;
mod homegrown_cc;
mod imp;
@ -167,11 +165,3 @@ pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
WebRTCSink::static_type(),
)
}
pub static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| {
runtime::Builder::new_multi_thread()
.enable_all()
.worker_threads(1)
.build()
.unwrap()
});

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-webrtchttp"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Taruntej Kanakamalla <taruntej@asymptotic.io"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -11,9 +11,9 @@ rust-version = "1.63"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-webrtc = { package = "gstreamer-webrtc", git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-sdp = { package = "gstreamer-sdp", git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-webrtc = { package = "gstreamer-webrtc", git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-sdp = { package = "gstreamer-sdp", git="https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
reqwest = { version = "0.11", features = ["default-tls"] }
once_cell = "1.0"
parse_link_header = {version = "0.3", features = ["url"]}
@ -28,7 +28,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-textahead"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Guillaume Desmottes <guillaume@desmottes.be>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,7 +9,7 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
[lib]
@ -18,7 +18,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-json"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"
edition = "2021"
@ -15,6 +15,8 @@ serde_json = { version = "1.0", features = ["raw_value"] }
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer"
features=["serde"]
@ -24,10 +26,12 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[features]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-regex"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"
edition = "2021"
@ -14,6 +14,8 @@ regex = "1.5"
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer"
[lib]
@ -22,10 +24,12 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[features]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-textwrap"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"
edition = "2021"
@ -15,6 +15,8 @@ hyphenation = "0.8"
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer"
[lib]
@ -23,10 +25,12 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[features]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-tutorial"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,10 +9,10 @@ rust-version = "1.63"
description = "GStreamer Rust Tutorial Plugin"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
byte-slice-cast = "1.0"
num-traits = "0.2"
once_cell = "1.0"

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-fallbackswitch"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>", "Jan Schmidt <jan@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,19 +9,19 @@ rust-version = "1.63"
description = "GStreamer Fallback Switcher and Source Plugin"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-plugin-gtk4 = { path = "../../video/gtk4", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-plugin-gtk4 = { path = "../../video/gtk4", version = "0.10", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", optional = true }
once_cell = "1.0"
parking_lot = "0.12"
[dev-dependencies]
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstfallbackswitch"
@ -35,7 +35,7 @@ required-features = ["gtk", "gio", "gst-plugin-gtk4"]
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
default = ["v1_20"]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-livesync"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>"]
license = "MPL-2.0"
description = "Livesync Plugin"
@ -9,18 +9,18 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-plugin-gtk4 = { path = "../../video/gtk4", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-plugin-gtk4 = { path = "../../video/gtk4", version = "0.10", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", optional = true }
muldiv = "1.0"
num-rational = { version = "0.4", default-features = false, features = [] }
once_cell = "1.0"
parking_lot = "0.12"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstlivesync"
@ -37,7 +37,7 @@ name = "livesync"
path = "tests/livesync.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -484,7 +484,7 @@ impl State {
.and_then(|s| s.get::<gst::Fraction>("framerate").ok())
.and_then(|framerate| {
gst::ClockTime::SECOND
.mul_div_round(framerate.numer() as u64, framerate.denom() as u64)
.mul_div_round(framerate.denom() as u64, framerate.numer() as u64)
})
.filter(|&dur| dur > 8.mseconds() && dur < 10.seconds())
// Otherwise, half the configured latency

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-togglerecord"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "MPL-2.0"
description = "GStreamer Toggle Record Plugin"
@ -9,12 +9,12 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-plugin-gtk4 = { path = "../../video/gtk4", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-plugin-gtk4 = { path = "../../video/gtk4", version = "0.10", optional = true }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", optional = true }
parking_lot = "0.12"
once_cell = "1.0"
@ -32,7 +32,7 @@ path = "examples/gtk_recording.rs"
required-features = ["gtk", "gio", "gst-plugin-gtk4"]
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-tracers"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Guillaume Desmottes <guillaume.desmottes@onestream.live>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,7 +9,7 @@ description = "GStreamer Rust tracers plugin"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
anyhow = "1"
regex = "1"
@ -23,7 +23,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -90,8 +90,17 @@ static MULTIQUEUE_TYPE: Lazy<glib::Type> = Lazy::new(|| {
}
});
static APPSRC_TYPE: Lazy<glib::Type> = Lazy::new(|| {
if let Some(queue) = gst::ElementFactory::find("appsrc").and_then(|f| f.load().ok()) {
queue.element_type()
} else {
gst::warning!(CAT, "Can't instantiate appsrc element");
glib::Type::INVALID
}
});
fn is_queue_type(type_: glib::Type) -> bool {
[*QUEUE_TYPE, *QUEUE2_TYPE, *MULTIQUEUE_TYPE].contains(&type_)
[*QUEUE_TYPE, *QUEUE2_TYPE, *MULTIQUEUE_TYPE, *APPSRC_TYPE].contains(&type_)
}
#[derive(Debug)]
@ -180,9 +189,9 @@ struct LogLine {
cur_level_bytes: u32,
cur_level_time: u64,
cur_level_buffers: u32,
max_size_bytes: u32,
max_size_bytes: u64,
max_size_time: u64,
max_size_buffers: u32,
max_size_buffers: u64,
}
#[derive(Default)]
@ -439,9 +448,19 @@ impl QueueLevels {
None => return,
};
let max_size_bytes = element.property::<u32>("max-size-bytes");
let max_size_time = element.property::<u64>("max-size-time");
let max_size_buffers = element.property::<u32>("max-size-buffers");
let (max_size_bytes, max_size_time, max_size_buffers) = if element.type_() == *APPSRC_TYPE {
(
element.property::<u64>("max-bytes"),
element.property::<u64>("max-time"),
element.property::<u64>("max-buffers"),
)
} else {
(
element.property::<u32>("max-size-bytes") as u64,
element.property::<u64>("max-size-time"),
element.property::<u32>("max-size-buffers") as u64,
)
};
if element.type_() == *MULTIQUEUE_TYPE {
let get_pad_idx = |pad: &gst::Pad| {
@ -497,9 +516,21 @@ impl QueueLevels {
}
}
} else {
let cur_level_bytes = element.property::<u32>("current-level-bytes");
let cur_level_time = element.property::<u64>("current-level-time");
let cur_level_buffers = element.property::<u32>("current-level-buffers");
let (cur_level_bytes, cur_level_time, cur_level_buffers) =
if element.type_() == *APPSRC_TYPE {
(
element.property::<u64>("current-level-bytes") as u32,
element.property::<u64>("current-level-time"),
element.property::<u64>("current-level-buffers") as u32,
)
} else {
(
element.property::<u32>("current-level-bytes"),
element.property::<u64>("current-level-time"),
element.property::<u32>("current-level-buffers"),
)
};
state.log.push(LogLine {
timestamp,
name,

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-uriplaylistbin"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Guillaume Desmottes <guillaume.desmottes@onestream.live>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,13 +9,13 @@ description = "GStreamer Playlist Playback Plugin"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
once_cell = "1.0"
anyhow = "1"
clap = { version = "4", optional = true, features = ["derive"] }
[dev-dependencies]
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
url = "2.2"
more-asserts = "0.3"
@ -30,7 +30,7 @@ path = "examples/playlist.rs"
required-features = ["clap"]
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-version-helper"
version = "0.10.0-alpha.1"
version = "0.7.5"
authors = ["Sajeer Ahamed <ahamedsajeer.15.15@cse.mrt.ac.lk>",
"Sebastian Dröge <sebastian@centricular.com>"]
categories = ["development-tools"]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-cdg"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Guillaume Desmottes <guillaume.desmottes@collabora.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,9 +9,9 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
cdg = "0.1"
cdg_renderer = "0.7"
image = { version = "0.24", default-features = false }
@ -19,7 +19,7 @@ muldiv = "1.0"
once_cell = "1.0"
[dev-dependencies]
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstcdg"
@ -27,7 +27,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-closedcaption"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>", "Jordan Petridis <jordan@centricular.com>", "Matthew Waters <matthew@centricular.com>"]
license = "MPL-2.0"
edition = "2021"
@ -16,25 +16,31 @@ uuid = { version = "1.0", features = ["v4"] }
chrono = "0.4.23"
once_cell = "1.0"
atomic_refcell = "0.1"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"] }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core" }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core" }
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", features=["use_glib"] }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
byteorder = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package="gstreamer"
[dependencies.gst-base]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package="gstreamer-base"
[dependencies.gst-video]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package="gstreamer-video"
@ -44,6 +50,8 @@ rand = { version = "0.8", features = ["small_rng"] }
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[lib]
@ -52,7 +60,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
cc = "1.0"
[features]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-dav1d"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Philippe Normand <philn@igalia.com>"]
edition = "2021"
rust-version = "1.63"
@ -10,9 +10,9 @@ description = "GStreamer dav1d AV1 decoder Plugin"
[dependencies]
dav1d = "0.9"
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
num_cpus = "1.0"
once_cell = "1.0"
@ -22,7 +22,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path = "../../version-helper" }
gst-plugin-version-helper = { path = "../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-ffv1"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Arun Raghavan <arun@asymptotic.io>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -11,19 +11,19 @@ rust-version = "1.63"
[dependencies]
byte-slice-cast = "1"
ffv1 = { git = "https://github.com/rust-av/ffv1.git", rev = "2afb025a327173ce891954c052e804d0f880368a" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
once_cell = "1.0"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_18"] }
[lib]
name = "gstffv1"
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-gif"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Markus Ebner <info@ebner-markus.de>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,14 +9,14 @@ rust-version = "1.63"
description = "GStreamer GIF plugin"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gif = "0.12"
atomic_refcell = "0.1"
once_cell = "1"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstgif"
@ -28,7 +28,7 @@ name = "testvideosrc2gif"
path = "examples/testvideosrc2gif.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-gtk4"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>", "Jordan Petridis <jordan@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,24 +9,24 @@ rust-version = "1.63"
description = "GStreamer GTK 4 Sink element and Paintable widget"
[dependencies]
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs" }
gdk_wayland = { package = "gdk4-wayland", git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_4"], optional = true}
gdk_x11 = { package = "gdk4-x11", git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_4"], optional = true}
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6" }
gdk_wayland = { package = "gdk4-wayland", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", features = ["v4_4"], optional = true}
gdk_x11 = { package = "gdk4-x11", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", features = ["v4_4"], optional = true}
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gst_base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"], optional = true }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
gst_base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"], optional = true }
gst_gl_wayland = { package = "gstreamer-gl-wayland", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"], optional = true }
gst_gl_x11 = { package = "gstreamer-gl-x11", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"], optional = true }
gst_gl_egl = { package = "gstreamer-gl-egl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"], optional = true }
gst_gl_wayland = { package = "gstreamer-gl-wayland", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"], optional = true }
gst_gl_x11 = { package = "gstreamer-gl-x11", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"], optional = true }
gst_gl_egl = { package = "gstreamer-gl-egl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"], optional = true }
once_cell = "1.0"
[target.'cfg(target_os = "macos")'.dependencies]
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", features = ["v4_6"] }
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_16"] }
gtk = { package = "gtk4", git = "https://github.com/gtk-rs/gtk4-rs", branch = "0.6", version = "0.6", features = ["v4_6"] }
gst_gl = { package = "gstreamer-gl", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20", features = ["v1_16"] }
[lib]
name = "gstgtk4"
@ -34,7 +34,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
default = []

View file

@ -5,3 +5,57 @@ offer the possibility to use a custom `gst::Pipeline`. The plugin provides a `gs
The Sink can generate GL Textures if the system is capable of it, but it needs to be compiled
with either `wayland`, `x11glx` or `x11egl` cargo features.
# Flatpak Integration
To build and include the plugin in a Flatpak manifest, you can add the following snippet to your json manifest:
```json
{
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable"
],
"build-options": {
"env": {
"CARGO_HOME": "/run/build/cargo-c/cargo"
},
"append-path": "/usr/lib/sdk/rust-stable/bin",
},
"modules": [
{
"name": "cargo-c",
"buildsystem": "simple",
"build-commands": [
"cargo install cargo-c --root /app"
],
"build-options": {
"build-args": [
"--share=network"
]
},
"cleanup": [
"*"
]
},
{
"name": "gst-plugins-rs",
"buildsystem": "simple",
"sources": [
{
"type": "git",
"url": "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
"branch": "0.10"
}
],
"build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [
"cargo cinstall -p gst-plugin-gtk4 --prefix=/app"
]
}
]
}
```

View file

@ -24,8 +24,6 @@ fn create_ui(app: &gtk::Application) {
.build()
.unwrap();
// Need to set state to Ready to get a GL context
gtksink.set_state(gst::State::Ready).unwrap();
let paintable = gtksink.property::<gdk::Paintable>("paintable");
// TODO: future plans to provide a bin-like element that works with less setup

View file

@ -21,7 +21,7 @@ pub(crate) struct Frame {
frame: gst_video::VideoFrame<gst_video::video_frame::Readable>,
overlays: Vec<Overlay>,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
gst_context: Option<gst_gl::GLContext>,
wrapped_context: Option<gst_gl::GLContext>,
}
#[derive(Debug)]
@ -100,7 +100,7 @@ fn video_frame_to_gl_texture(
cached_textures: &mut HashMap<usize, gdk::Texture>,
used_textures: &mut HashSet<usize>,
gdk_context: &gdk::GLContext,
gst_context: &gst_gl::GLContext,
wrapped_context: &gst_gl::GLContext,
) -> (gdk::Texture, f64) {
let texture_id = frame.texture_id(0).expect("Invalid texture id") as usize;
@ -116,7 +116,7 @@ fn video_frame_to_gl_texture(
let height = frame.height();
let sync_meta = frame.buffer().meta::<gst_gl::GLSyncMeta>().unwrap();
sync_meta.wait(gst_context);
sync_meta.wait(wrapped_context);
let texture = unsafe {
gdk::GLTexture::with_release_func(
@ -156,19 +156,21 @@ impl Frame {
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
if let (Some(gdk_ctx), Some(gst_ctx)) = (gdk_context, self.gst_context.as_ref()) {
if let (Some(gdk_ctx), Some(wrapped_ctx)) =
(gdk_context, self.wrapped_context.as_ref())
{
video_frame_to_gl_texture(
self.frame,
cached_textures,
&mut used_textures,
gdk_ctx,
gst_ctx,
wrapped_ctx,
)
} else {
// This will fail badly if the video frame was actually mapped as GL texture
// but this case can't really happen as we only do that if we actually have a
// GDK GL context.
assert!(self.gst_context.is_none());
assert!(self.wrapped_context.is_none());
video_frame_to_memory_texture(self.frame, cached_textures, &mut used_textures)
}
}
@ -208,7 +210,12 @@ impl Frame {
pub(crate) fn new(
buffer: &gst::Buffer,
info: &gst_video::VideoInfo,
#[allow(unused_variables)] have_gl_context: bool,
#[cfg(any(target_os = "macos", feature = "gst_gl"))] wrapped_context: Option<
&gst_gl::GLContext,
>,
#[allow(unused_variables)]
#[cfg(not(any(target_os = "macos", feature = "gst_gl")))]
wrapped_context: Option<&()>,
) -> Result<Self, gst::FlowError> {
// Empty buffers get filtered out in show_frame
debug_assert!(buffer.n_memory() > 0);
@ -225,44 +232,57 @@ impl Frame {
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
let is_buffer_gl = buffer
// Check we received a buffer with GL memory and if the context of that memory
// can share with the wrapped context around the GDK GL context.
//
// If not it has to be uploaded to the GPU.
let memory_ctx = buffer
.peek_memory(0)
.downcast_memory_ref::<gst_gl::GLBaseMemory>()
.is_some();
.and_then(|m| {
let ctx = m.context();
if wrapped_context
.map_or(false, |wrapped_context| wrapped_context.can_share(ctx))
{
Some(ctx)
} else {
None
}
});
if !is_buffer_gl || !have_gl_context {
frame = Self {
frame: gst_video::VideoFrame::from_buffer_readable(buffer.clone(), info)
.map_err(|_| gst::FlowError::Error)?,
overlays: vec![],
gst_context: None,
};
} else {
let gst_ctx = buffer
.peek_memory(0)
.downcast_memory_ref::<gst_gl::GLBaseMemory>()
.map(|m| m.context())
.expect("Failed to retrieve the GstGL Context.");
let mapped_frame = if let Some(meta) = buffer.meta::<gst_gl::GLSyncMeta>() {
meta.set_sync_point(gst_ctx);
if let Some(memory_ctx) = memory_ctx {
// If there is no GLSyncMeta yet then we need to add one here now, which requires
// obtaining a writable buffer.
let mapped_frame = if buffer.meta::<gst_gl::GLSyncMeta>().is_some() {
gst_video::VideoFrame::from_buffer_readable_gl(buffer.clone(), info)
.map_err(|_| gst::FlowError::Error)?
} else {
let mut buffer = buffer.clone();
{
let buffer = buffer.make_mut();
let meta = gst_gl::GLSyncMeta::add(buffer, gst_ctx);
meta.set_sync_point(gst_ctx);
gst_gl::GLSyncMeta::add(buffer, memory_ctx);
}
gst_video::VideoFrame::from_buffer_readable_gl(buffer, info)
.map_err(|_| gst::FlowError::Error)?
};
// Now that it's guaranteed that there is a sync meta and the frame is mapped, set
// a sync point so we can ensure that the texture is ready later when making use of
// it as gdk::GLTexture.
let meta = mapped_frame.buffer().meta::<gst_gl::GLSyncMeta>().unwrap();
meta.set_sync_point(memory_ctx);
frame = Self {
frame: mapped_frame,
overlays: vec![],
gst_context: Some(gst_ctx.clone()),
wrapped_context: Some(wrapped_context.unwrap().clone()),
};
} else {
frame = Self {
frame: gst_video::VideoFrame::from_buffer_readable(buffer.clone(), info)
.map_err(|_| gst::FlowError::Error)?,
overlays: vec![],
wrapped_context: None,
};
}
}

View file

@ -30,8 +30,23 @@ use crate::utils;
use gst_gl::prelude::GLContextExt as GstGLContextExt;
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
use gst_gl::prelude::*;
// Global GL context that is created by the first sink and kept around until the end of the
// process. This is provided to other elements in the pipeline to make sure they create GL contexts
// that are sharing with the GTK GL context.
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
use std::sync::atomic::{AtomicBool, Ordering};
enum GLContext {
Uninitialized,
Unsupported,
Initialized {
display: gst_gl::GLDisplay,
wrapped_context: gst_gl::GLContext,
gdk_context: ThreadGuard<gdk::GLContext>,
},
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
static GL_CONTEXT: Mutex<GLContext> = Mutex::new(GLContext::Uninitialized);
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
gst::DebugCategory::new(
@ -47,15 +62,7 @@ pub struct PaintableSink {
info: Mutex<Option<gst_video::VideoInfo>>,
sender: Mutex<Option<Sender<SinkEvent>>>,
pending_frame: Mutex<Option<Frame>>,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
gst_display: Mutex<Option<gst_gl::GLDisplay>>,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
gst_app_context: Mutex<Option<gst_gl::GLContext>>,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
gst_context: Mutex<Option<gst_gl::GLContext>>,
cached_caps: Mutex<Option<gst::Caps>>,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
have_gl_context: AtomicBool,
}
impl Drop for PaintableSink {
@ -147,10 +154,12 @@ impl ElementImpl for PaintableSink {
for features in [
None,
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
Some(gst::CapsFeatures::new([
"memory:GLMemory",
"meta:GstVideoOverlayComposition",
])),
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
Some(gst::CapsFeatures::new(["memory:GLMemory"])),
Some(gst::CapsFeatures::new([
"memory:SystemMemory",
@ -213,16 +222,33 @@ impl ElementImpl for PaintableSink {
drop(paintable);
// Notify the pipeline about the GL display and wrapped context so that any other
// elements in the pipeline ideally use the same / create GL contexts that are
// sharing with this one.
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
if self.have_gl_context.load(Ordering::Relaxed) {
if self.initialize_gl_wrapper() {
// We must have a display at this point.
let display = self.gst_display.lock().unwrap().clone().unwrap();
gst_gl::gl_element_propagate_display_context(&*self.obj(), &display);
} else {
self.have_gl_context.store(false, Ordering::Relaxed);
let gl_context = GL_CONTEXT.lock().unwrap();
if let GLContext::Initialized {
display,
wrapped_context,
..
} = &*gl_context
{
let display = display.clone();
let wrapped_context = wrapped_context.clone();
drop(gl_context);
gst_gl::gl_element_propagate_display_context(&*self.obj(), &display);
let mut ctx = gst::Context::new("gst.gl.app_context", true);
{
let ctx = ctx.get_mut().unwrap();
ctx.structure_mut().set("context", &wrapped_context);
}
let _ = self.obj().post_message(
gst::message::HaveContext::builder(ctx)
.src(&*self.obj())
.build(),
);
}
}
}
@ -246,12 +272,6 @@ impl ElementImpl for PaintableSink {
}
});
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
gst::StateChange::ReadyToNull => {
let _ = self.gst_context.lock().unwrap().take();
let _ = self.gst_app_context.lock().unwrap().take();
let _ = self.gst_display.lock().unwrap().take();
}
_ => (),
}
@ -272,25 +292,24 @@ impl BaseSinkImpl for PaintableSink {
templ[0].caps().clone()
});
gst::debug!(CAT, imp: self, "Advertising our own caps: {:?}", &tmp_caps);
gst::debug!(CAT, imp: self, "Advertising our own caps: {tmp_caps:?}");
if let Some(filter_caps) = filter {
gst::debug!(
CAT,
imp: self,
"Intersecting with filter caps: {:?}",
&filter_caps
"Intersecting with filter caps: {filter_caps:?}",
);
tmp_caps = filter_caps.intersect_with_mode(&tmp_caps, gst::CapsIntersectMode::First);
};
gst::debug!(CAT, imp: self, "Returning caps: {:?}", &tmp_caps);
gst::debug!(CAT, imp: self, "Returning caps: {tmp_caps:?}");
Some(tmp_caps)
}
fn set_caps(&self, caps: &gst::Caps) -> Result<(), gst::LoggableError> {
gst::debug!(CAT, imp: self, "Setting caps {:?}", caps);
gst::debug!(CAT, imp: self, "Setting caps {caps:?}");
let video_info = gst_video::VideoInfo::from_caps(caps)
.map_err(|_| gst::loggable_error!(CAT, "Invalid caps"))?;
@ -312,84 +331,21 @@ impl BaseSinkImpl for PaintableSink {
// TODO: Provide a preferred "window size" here for higher-resolution rendering
query.add_allocation_meta::<gst_video::VideoOverlayCompositionMeta>(None);
#[cfg(not(any(target_os = "macos", feature = "gst_gl")))]
{
Ok(())
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
// Early return if there is no context initialized
let gst_context = match &*self.gst_context.lock().unwrap() {
None => {
gst::debug!(
CAT,
imp: self,
"Found no GL Context during propose_allocation."
);
return Ok(());
}
Some(gst_context) => gst_context.clone(),
};
// GL specific things
let (caps, need_pool) = query.get_owned();
let caps = match caps {
None => {
return Ok(());
}
Some(caps) if caps.is_empty() || caps.is_any() => {
return Ok(());
}
Some(caps) => caps,
};
if let Some(f) = caps.features(0) {
if !f.contains("memory:GLMemory") {
gst::debug!(
CAT,
imp: self,
"No 'memory:GLMemory' feature in caps: {}",
caps
)
}
}
let info = gst_video::VideoInfo::from_caps(&caps)
.map_err(|_| gst::loggable_error!(CAT, "Failed to get VideoInfo from caps"))?;
let size = info.size() as u32;
let buffer_pool = if need_pool {
let buffer_pool = gst_gl::GLBufferPool::new(&gst_context);
gst::debug!(CAT, imp: self, "Creating new Pool");
let mut config = buffer_pool.config();
config.set_params(Some(&caps), size, 0, 0);
config.add_option("GstBufferPoolOptionGLSyncMeta");
if let Err(err) = buffer_pool.set_config(config) {
return Err(gst::loggable_error!(
CAT,
format!("Failed to set config in the GL BufferPool.: {err}")
));
}
Some(buffer_pool)
} else {
None
};
// we need at least 2 buffer because we hold on to the last one
query.add_allocation_pool(buffer_pool.as_ref(), size, 2, 0);
if gst_context.check_feature("GL_ARB_sync")
|| gst_context.check_feature("GL_EXT_EGL_sync")
if let GLContext::Initialized {
wrapped_context, ..
} = &*GL_CONTEXT.lock().unwrap()
{
query.add_allocation_meta::<gst_gl::GLSyncMeta>(None)
if wrapped_context.check_feature("GL_ARB_sync")
|| wrapped_context.check_feature("GL_EXT_EGL_sync")
{
query.add_allocation_meta::<gst_gl::GLSyncMeta>(None)
}
}
Ok(())
}
Ok(())
}
fn query(&self, query: &mut gst::QueryRef) -> bool {
@ -400,21 +356,27 @@ impl BaseSinkImpl for PaintableSink {
gst::QueryViewMut::Context(q) => {
// Avoid holding the locks while we respond to the query
// The objects are ref-counted anyway.
let (gst_display, app_ctx, gst_ctx) = (
self.gst_display.lock().unwrap().clone(),
self.gst_app_context.lock().unwrap().clone(),
self.gst_context.lock().unwrap().clone(),
);
let mut display_clone = None;
let mut wrapped_context_clone = None;
if let GLContext::Initialized {
display,
wrapped_context,
..
} = &*GL_CONTEXT.lock().unwrap()
{
display_clone = Some(display.clone());
wrapped_context_clone = Some(wrapped_context.clone());
}
if let (Some(gst_display), Some(app_ctx), Some(gst_ctx)) =
(gst_display, app_ctx, gst_ctx)
if let (Some(display), Some(wrapped_context)) =
(display_clone, wrapped_context_clone)
{
return gst_gl::functions::gl_handle_context_query(
&*self.obj(),
q,
Some(&gst_display),
Some(&gst_ctx),
Some(&app_ctx),
Some(&display),
None::<&gst_gl::GLContext>,
Some(&wrapped_context),
);
}
@ -445,17 +407,25 @@ impl VideoSinkImpl for PaintableSink {
gst::FlowError::NotNegotiated
})?;
let have_gl_context = {
let wrapped_context = {
#[cfg(not(any(target_os = "macos", feature = "gst_gl")))]
{
false
None
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
self.have_gl_context.load(Ordering::Relaxed)
let gl_context = GL_CONTEXT.lock().unwrap();
if let GLContext::Initialized {
wrapped_context, ..
} = &*gl_context
{
Some(wrapped_context.clone())
} else {
None
}
}
};
let frame = Frame::new(buffer, info, have_gl_context).map_err(|err| {
let frame = Frame::new(buffer, info, wrapped_context.as_ref()).map_err(|err| {
gst::error!(CAT, imp: self, "Failed to map video frame");
err
})?;
@ -507,7 +477,7 @@ impl PaintableSink {
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
// Filter out GL caps from the template pads if we have no context
if !self.have_gl_context.load(Ordering::Relaxed) {
if !matches!(&*GL_CONTEXT.lock().unwrap(), GLContext::Initialized { .. }) {
tmp_caps = tmp_caps
.iter_with_features()
.filter(|(_, features)| !features.contains("memory:GLMemory"))
@ -523,44 +493,52 @@ impl PaintableSink {
}
fn create_paintable(&self, paintable_storage: &mut MutexGuard<Option<ThreadGuard<Paintable>>>) {
#[allow(unused_mut)]
let mut ctx = None;
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
if let Some(c) = self.realize_context() {
self.have_gl_context.store(true, Ordering::Relaxed);
ctx = Some(c);
}
self.initialize_gl_context();
}
self.configure_caps();
self.initialize_paintable(ctx, paintable_storage);
self.initialize_paintable(paintable_storage);
}
fn initialize_paintable(
&self,
gl_context: Option<ThreadGuard<gdk::GLContext>>,
paintable_storage: &mut MutexGuard<Option<ThreadGuard<Paintable>>>,
) {
gst::debug!(CAT, imp: self, "Initializing paintable");
let paintable = utils::invoke_on_main_thread(|| {
// grab the context out of the fragile
let ctx = gl_context.map(|f| f.into_inner());
ThreadGuard::new(Paintable::new(ctx))
});
// The channel for the SinkEvents
let (sender, receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
let self_ = self.to_owned();
receiver.attach(
None,
glib::clone!(
@weak self_ => @default-return glib::Continue(false),
move |action| self_.do_action(action)
),
);
let paintable = utils::invoke_on_main_thread(move || {
// Attach the receiver from the main thread to make sure it is called
// from a place where it can acquire the default main context.
receiver.attach(
Some(&glib::MainContext::default()),
glib::clone!(
@weak self_ => @default-return glib::Continue(false),
move |action| self_.do_action(action)
),
);
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
{
let gdk_context = if let GLContext::Initialized { gdk_context, .. } =
&*GL_CONTEXT.lock().unwrap()
{
Some(gdk_context.get_ref().clone())
} else {
None
};
ThreadGuard::new(Paintable::new(gdk_context))
}
#[cfg(not(any(target_os = "macos", feature = "gst_gl")))]
{
ThreadGuard::new(Paintable::new(None))
}
});
**paintable_storage = Some(paintable);
@ -568,211 +546,144 @@ impl PaintableSink {
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
fn realize_context(&self) -> Option<ThreadGuard<gdk::GLContext>> {
fn initialize_gl_context(&self) {
gst::debug!(CAT, imp: self, "Realizing GDK GL Context");
let self_ = self.to_owned();
utils::invoke_on_main_thread(move || -> Option<ThreadGuard<gdk::GLContext>> {
gst::debug!(
CAT,
imp: self_,
"Realizing GDK GL Context from main context"
);
// This can return NULL but only happens in 2 situations:
// * If the function is called before gtk_init
// * If the function is called after gdk_display_close(default_display)
// Both of which are treated as programming errors.
//
// However, when we are building the docs, gtk_init doesn't get called
// and this would cause the documentation generation to error.
// Thus its okayish to return None here and fallback to software
// rendering, since this path isn't going to be used by applications
// anyway.
//
// FIXME: add a couple more gtk_init checks across the codebase where
// applicable since this is no longer going to panic.
let display = gdk::Display::default()?;
let ctx = match display.create_gl_context() {
Ok(ctx) => ctx,
Err(err) => {
gst::warning!(CAT, imp: self_, "Failed to create GDK GL Context: {err}");
return None;
}
};
match ctx.type_().name() {
#[cfg(all(target_os = "linux", feature = "x11egl"))]
"GdkX11GLContextEGL" => (),
#[cfg(all(target_os = "linux", feature = "x11glx"))]
"GdkX11GLContextGLX" => (),
#[cfg(all(target_os = "linux", feature = "wayland"))]
"GdkWaylandGLContext" => (),
#[cfg(target_os = "macos")]
"GdkMacosGLContext" => (),
display => {
gst::error!(CAT, imp: self_, "Unsupported GDK display {display} for GL");
return None;
}
}
gst::info!(CAT, imp: &self_, "Realizing GDK GL Context",);
match ctx.realize() {
Ok(_) => {
gst::info!(CAT, imp: self_, "Successfully realized GDK GL Context",);
Some(ThreadGuard::new(ctx))
}
Err(err) => {
gst::warning!(CAT, imp: self_, "Failed to realize GDK GL Context: {err}",);
None
}
}
})
utils::invoke_on_main_thread(move || {
self_.initialize_gl_context_main();
});
}
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
fn initialize_gl_wrapper(&self) -> bool {
gst::info!(CAT, imp: self, "Initializing GDK GL Context");
let self_ = self.to_owned();
utils::invoke_on_main_thread(move || self_.initialize_gl())
}
fn initialize_gl_context_main(&self) {
gst::debug!(CAT, imp: self, "Realizing GDK GL Context from main thread");
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
fn initialize_gl(&self) -> bool {
let ctx = {
let paintable = self.paintable.lock().unwrap();
// Impossible to not have a paintable and GL context at this point
paintable.as_ref().unwrap().get_ref().context().unwrap()
};
let mut gl_context_guard = GL_CONTEXT.lock().unwrap();
if !matches!(&*gl_context_guard, GLContext::Uninitialized) {
gst::debug!(CAT, imp: self, "Already initialized GL context before");
return;
}
*gl_context_guard = GLContext::Unsupported;
let display = gtk::prelude::GLContextExt::display(&ctx)
.expect("Failed to get GDK Display from GDK Context.");
ctx.make_current();
let mut app_ctx_guard = self.gst_app_context.lock().unwrap();
let mut display_guard = self.gst_display.lock().unwrap();
match ctx.type_().name() {
#[cfg(all(target_os = "linux", feature = "x11egl"))]
"GdkX11GLContextEGL" => {
self.initialize_x11egl(display, &mut display_guard, &mut app_ctx_guard);
}
#[cfg(all(target_os = "linux", feature = "x11glx"))]
"GdkX11GLContextGLX" => {
self.initialize_x11glx(display, &mut display_guard, &mut app_ctx_guard);
}
#[cfg(all(target_os = "linux", feature = "wayland"))]
"GdkWaylandGLContext" => {
self.initialize_waylandegl(display, &mut display_guard, &mut app_ctx_guard);
}
#[cfg(target_os = "macos")]
"GdkMacosGLContext" => {
self.initialize_macosgl(display, &mut display_guard, &mut app_ctx_guard);
}
_ => {
unreachable!("Unsupported GDK display {display} for GL");
}
};
// This should have been initialized once we are done with the platform checks
let app_ctx = match &*app_ctx_guard {
None => {
assert!(display_guard.is_none());
return false;
}
Some(app_ctx) => app_ctx,
};
let display = match &*display_guard {
None => return false,
// This can return NULL but only happens in 2 situations:
// * If the function is called before gtk_init
// * If the function is called after gdk_display_close(default_display)
// Both of which are treated as programming errors.
//
// However, when we are building the docs, gtk_init doesn't get called
// and this would cause the documentation generation to error.
// Thus its okayish to return None here and fallback to software
// rendering, since this path isn't going to be used by applications
// anyway.
//
// FIXME: add a couple more gtk_init checks across the codebase where
// applicable since this is no longer going to panic.
let gdk_display = match gdk::Display::default() {
Some(display) => display,
None => {
gst::warning!(CAT, imp: self, "Failed to retrieve GDK display");
return;
}
};
let gdk_context = match gdk_display.create_gl_context() {
Ok(gdk_context) => gdk_context,
Err(err) => {
gst::warning!(CAT, imp: self, "Failed to create GDK GL Context: {err}");
return;
}
};
match app_ctx.activate(true) {
Ok(_) => gst::info!(CAT, imp: self, "Successfully activated GL Context."),
match gdk_context.type_().name() {
#[cfg(all(target_os = "linux", feature = "x11egl"))]
"GdkX11GLContextEGL" => (),
#[cfg(all(target_os = "linux", feature = "x11glx"))]
"GdkX11GLContextGLX" => (),
#[cfg(all(target_os = "linux", feature = "wayland"))]
"GdkWaylandGLContext" => (),
#[cfg(target_os = "macos")]
"GdkMacosGLContext" => (),
display => {
gst::error!(CAT, imp: self, "Unsupported GDK display {display} for GL");
return;
}
}
gst::info!(CAT, imp: self, "Realizing GDK GL Context",);
if let Err(err) = gdk_context.realize() {
gst::warning!(CAT, imp: self, "Failed to realize GDK GL Context: {err}");
return;
}
gst::info!(CAT, imp: self, "Successfully realized GDK GL Context");
gdk_context.make_current();
let res = match gdk_context.type_().name() {
#[cfg(all(target_os = "linux", feature = "x11egl"))]
"GdkX11GLContextEGL" => self.initialize_x11egl(gdk_display),
#[cfg(all(target_os = "linux", feature = "x11glx"))]
"GdkX11GLContextGLX" => self.initialize_x11glx(gdk_display),
#[cfg(all(target_os = "linux", feature = "wayland"))]
"GdkWaylandGLContext" => self.initialize_waylandegl(gdk_display),
#[cfg(target_os = "macos")]
"GdkMacosGLContext" => self.initialize_macosgl(gdk_display),
display_type => {
unreachable!("Unsupported GDK display {display_type} for GL");
}
};
let (display, wrapped_context) = match res {
Some((display, wrapped_context)) => (display, wrapped_context),
None => {
return;
}
};
match wrapped_context.activate(true) {
Ok(_) => gst::info!(CAT, imp: self, "Successfully activated GL Context"),
Err(_) => {
gst::error!(CAT, imp: self, "Failed to activate GL context",);
*app_ctx_guard = None;
*display_guard = None;
return false;
return;
}
};
if let Err(err) = app_ctx.fill_info() {
if let Err(err) = wrapped_context.fill_info() {
gst::error!(
CAT,
imp: self,
"Failed to fill info on the GL Context: {err}",
);
// Deactivate the context upon failure
if app_ctx.activate(false).is_err() {
if wrapped_context.activate(false).is_err() {
gst::error!(
CAT,
imp: self,
"Failed to deactivate the context after failing fill info",
);
}
*app_ctx_guard = None;
*display_guard = None;
return false;
return;
}
if app_ctx.activate(false).is_err() {
gst::error!(CAT, imp: self, "Failed to deactivate GL context",);
*app_ctx_guard = None;
*display_guard = None;
return false;
}
gst::info!(CAT, imp: self, "Successfully initialized GL Context");
gst::info!(
CAT,
imp: self,
"Successfully deactivated GL Context after fill_info"
);
let display_object_guard = display.object_lock();
let gst_context =
match gst_gl::GLDisplay::create_context(&display_object_guard, Some(app_ctx)) {
Ok(gst_context) => gst_context,
Err(err) => {
gst::error!(CAT, imp: self, "Could not create GL context: {err}");
drop(display_object_guard);
*app_ctx_guard = None;
*display_guard = None;
return false;
}
};
match gst_gl::GLDisplay::add_context(&display_object_guard, &gst_context) {
Ok(_) => {
let mut gst_ctx_guard = self.gst_context.lock().unwrap();
gst::info!(CAT, imp: self, "Successfully initialized GL Context");
gst_ctx_guard.replace(gst_context);
true
}
Err(_) => {
gst::error!(CAT, imp: self, "Could not add GL context to display");
drop(display_object_guard);
*app_ctx_guard = None;
*display_guard = None;
false
}
}
*gl_context_guard = GLContext::Initialized {
display,
wrapped_context,
gdk_context: ThreadGuard::new(gdk_context),
};
}
#[cfg(all(target_os = "linux", feature = "x11egl"))]
fn initialize_x11egl(
&self,
display: gdk::Display,
display_guard: &mut Option<gst_gl::GLDisplay>,
app_ctx_guard: &mut Option<gst_gl::GLContext>,
) {
) -> Option<(gst_gl::GLDisplay, gst_gl::GLContext)> {
gst::info!(
CAT,
imp: self,
"Initializing GL for x11 EGL backend and display."
"Initializing GL for x11 EGL backend and display"
);
let platform = gst_gl::GLPlatform::EGL;
@ -780,37 +691,37 @@ impl PaintableSink {
let gl_ctx = gst_gl::GLContext::current_gl_context(platform);
if gl_ctx == 0 {
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext",);
return;
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext");
return None;
}
// FIXME: bindings
unsafe {
use glib::translate::*;
let d = display.downcast::<gdk_x11::X11Display>().unwrap();
let x11_display = gdk_x11::ffi::gdk_x11_display_get_egl_display(d.to_glib_none().0);
let display = display.downcast::<gdk_x11::X11Display>().unwrap();
let x11_display =
gdk_x11::ffi::gdk_x11_display_get_egl_display(display.to_glib_none().0);
if x11_display.is_null() {
gst::error!(CAT, imp: self, "Failed to get EGL display");
return;
return None;
}
let gst_display = gst_gl_egl::ffi::gst_gl_display_egl_new_with_egl_display(x11_display);
let gst_display =
gst_gl::GLDisplay::from_glib_full(gst_display as *mut gst_gl::ffi::GstGLDisplay);
let gst_app_context =
let wrapped_context =
gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api);
let gst_app_context = match gst_app_context {
let wrapped_context = match wrapped_context {
None => {
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
return;
return None;
}
Some(gst_app_context) => gst_app_context,
Some(wrapped_context) => wrapped_context,
};
display_guard.replace(gst_display);
app_ctx_guard.replace(gst_app_context);
Some((gst_display, wrapped_context))
}
}
@ -818,13 +729,11 @@ impl PaintableSink {
fn initialize_x11glx(
&self,
display: gdk::Display,
display_guard: &mut Option<gst_gl::GLDisplay>,
app_ctx_guard: &mut Option<gst_gl::GLContext>,
) {
) -> Option<(gst_gl::GLDisplay, gst_gl::GLContext)> {
gst::info!(
CAT,
imp: self,
"Initializing GL for x11 GLX backend and display."
"Initializing GL for x11 GLX backend and display"
);
let platform = gst_gl::GLPlatform::GLX;
@ -832,37 +741,36 @@ impl PaintableSink {
let gl_ctx = gst_gl::GLContext::current_gl_context(platform);
if gl_ctx == 0 {
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext",);
return;
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext");
return None;
}
// FIXME: bindings
unsafe {
use glib::translate::*;
let d = display.downcast::<gdk_x11::X11Display>().unwrap();
let x11_display = gdk_x11::ffi::gdk_x11_display_get_xdisplay(d.to_glib_none().0);
let display = display.downcast::<gdk_x11::X11Display>().unwrap();
let x11_display = gdk_x11::ffi::gdk_x11_display_get_xdisplay(display.to_glib_none().0);
if x11_display.is_null() {
gst::error!(CAT, imp: self, "Failed to get X11 display");
return;
return None;
}
let gst_display = gst_gl_x11::ffi::gst_gl_display_x11_new_with_display(x11_display);
let gst_display =
gst_gl::GLDisplay::from_glib_full(gst_display as *mut gst_gl::ffi::GstGLDisplay);
let gst_app_context =
let wrapped_context =
gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api);
let gst_app_context = match gst_app_context {
let wrapped_context = match wrapped_context {
None => {
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
return;
return None;
}
Some(gst_app_context) => gst_app_context,
Some(wrapped_context) => wrapped_context,
};
display_guard.replace(gst_display);
app_ctx_guard.replace(gst_app_context);
Some((gst_display, wrapped_context))
}
}
@ -870,13 +778,11 @@ impl PaintableSink {
fn initialize_waylandegl(
&self,
display: gdk::Display,
display_guard: &mut Option<gst_gl::GLDisplay>,
app_ctx_guard: &mut Option<gst_gl::GLContext>,
) {
) -> Option<(gst_gl::GLDisplay, gst_gl::GLContext)> {
gst::info!(
CAT,
imp: self,
"Initializing GL for Wayland EGL backend and display."
"Initializing GL for Wayland EGL backend and display"
);
let platform = gst_gl::GLPlatform::EGL;
@ -884,8 +790,8 @@ impl PaintableSink {
let gl_ctx = gst_gl::GLContext::current_gl_context(platform);
if gl_ctx == 0 {
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext",);
return;
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext");
return None;
}
// FIXME: bindings
@ -894,12 +800,12 @@ impl PaintableSink {
// let wayland_display = gdk_wayland::WaylandDisplay::wl_display(display.downcast());
// get the ptr directly since we are going to use it raw
let d = display.downcast::<gdk_wayland::WaylandDisplay>().unwrap();
let display = display.downcast::<gdk_wayland::WaylandDisplay>().unwrap();
let wayland_display =
gdk_wayland::ffi::gdk_wayland_display_get_wl_display(d.to_glib_none().0);
gdk_wayland::ffi::gdk_wayland_display_get_wl_display(display.to_glib_none().0);
if wayland_display.is_null() {
gst::error!(CAT, imp: self, "Failed to get Wayland display");
return;
return None;
}
let gst_display =
@ -907,19 +813,18 @@ impl PaintableSink {
let gst_display =
gst_gl::GLDisplay::from_glib_full(gst_display as *mut gst_gl::ffi::GstGLDisplay);
let gst_app_context =
let wrapped_context =
gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api);
let gst_app_context = match gst_app_context {
let wrapped_context = match wrapped_context {
None => {
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
return;
return None;
}
Some(gst_app_context) => gst_app_context,
Some(wrapped_context) => wrapped_context,
};
display_guard.replace(gst_display);
app_ctx_guard.replace(gst_app_context);
Some((gst_display, wrapped_context))
}
}
@ -927,13 +832,11 @@ impl PaintableSink {
fn initialize_macosgl(
&self,
display: gdk::Display,
display_guard: &mut Option<gst_gl::GLDisplay>,
app_ctx_guard: &mut Option<gst_gl::GLContext>,
) {
) -> Option<(gst_gl::GLDisplay, gst_gl::GLContext)> {
gst::info!(
CAT,
imp: self,
"Initializing GL for macOS backend and display."
"Initializing GL for macOS backend and display"
);
let platform = gst_gl::GLPlatform::CGL;
@ -941,25 +844,24 @@ impl PaintableSink {
let gl_ctx = gst_gl::GLContext::current_gl_context(platform);
if gl_ctx == 0 {
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext",);
return;
gst::error!(CAT, imp: self, "Failed to get handle from GdkGLContext");
return None;
}
let gst_display = gst_gl::GLDisplay::new();
unsafe {
let gst_app_context =
let wrapped_context =
gst_gl::GLContext::new_wrapped(&gst_display, gl_ctx, platform, gl_api);
let gst_app_context = match gst_app_context {
let wrapped_context = match wrapped_context {
None => {
gst::error!(CAT, imp: self, "Failed to create wrapped GL context");
return;
}
Some(gst_app_context) => gst_app_context,
Some(wrapped_context) => wrapped_context,
};
display_guard.replace(gst_display);
app_ctx_guard.replace(gst_app_context);
Some((gst_display, wrapped_context))
}
}
}

View file

@ -165,11 +165,6 @@ impl PaintableImpl for Paintable {
}
impl Paintable {
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
pub(super) fn context(&self) -> Option<gdk::GLContext> {
self.gl_context.borrow().clone()
}
pub(super) fn handle_frame_changed(&self, frame: Option<Frame>) {
let context = self.gl_context.borrow();
if let Some(frame) = frame {
@ -191,9 +186,7 @@ impl Paintable {
gst::debug!(
CAT,
imp: self,
"Size changed from {:?} to {:?}",
old_size,
new_size,
"Size changed from {old_size:?} to {new_size:?}",
);
self.obj().invalidate_size();
}

View file

@ -30,11 +30,6 @@ impl Paintable {
}
impl Paintable {
#[cfg(any(target_os = "macos", feature = "gst_gl"))]
pub(crate) fn context(&self) -> Option<gdk::GLContext> {
self.imp().context()
}
pub(crate) fn handle_frame_changed(&self, frame: Option<Frame>) {
self.imp().handle_frame_changed(frame);
}

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-hsv"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Julien Bardagi <julien.bardagi@gmail.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,16 +9,16 @@ rust-version = "1.63"
description = "GStreamer plugin with HSV manipulation elements"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-audio = { package = "gstreamer-audio", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
byte-slice-cast = "1.0"
num-traits = "0.2"
once_cell = "1.0"
[dev-dependencies]
gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gsthsv"
@ -26,7 +26,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-png"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Natanael Mojica <neithanmo@gmail.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,14 +9,14 @@ rust-version = "1.63"
description = "GStreamer Rust PNG encoder/decoder"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst_video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
png = "0.17.2"
once_cell = "1"
parking_lot = "0.12"
[dev-dependencies]
gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst_check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstrspng"
@ -24,7 +24,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-rav1e"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT OR Apache-2.0"
@ -9,14 +9,14 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
rav1e = { version = "0.6", default-features = false, features = ["threading"] }
once_cell = "1.0"
atomic_refcell = "0.1"
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.20", version = "0.20" }
[lib]
name = "gstrav1e"
@ -24,7 +24,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
default = ["hdr"]

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-videofx"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Sanchayan Maity <sanchayan@asymptotic.io>", "Rafael Caricio <rafael@caricio.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MPL-2.0"
@ -9,7 +9,7 @@ edition = "2021"
rust-version = "1.63"
[dependencies]
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"] }
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17", features=["use_glib"] }
atomic_refcell = "0.1"
once_cell = "1.0"
color-thief = "0.2.2"
@ -21,21 +21,29 @@ rgb = { version = "0.8", optional = true }
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package = "gstreamer"
[dependencies.gst-base]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package = "gstreamer-base"
[dependencies.gst-video]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
features = ["v1_16"]
package = "gstreamer-video"
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package = "gstreamer-check"
[lib]
@ -44,7 +52,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []

View file

@ -1,6 +1,6 @@
[package]
name = "gst-plugin-webp"
version = "0.10.0-alpha.1"
version = "0.10.3"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>"]
license = "MPL-2.0"
edition = "2021"
@ -14,10 +14,14 @@ libwebp-sys2 = { version = "0.1.2", features = ["demux", "0_5"] }
[dependencies.gst]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer"
[dependencies.gst-video]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-video"
[dev-dependencies]
@ -25,6 +29,8 @@ pretty_assertions = "1"
[dev-dependencies.gst-check]
git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
branch = "0.20"
version = "0.20"
package="gstreamer-check"
[lib]
@ -33,7 +39,7 @@ crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[build-dependencies]
gst-plugin-version-helper = { path="../../version-helper" }
gst-plugin-version-helper = { path="../../version-helper", version = "0.7" }
[features]
static = []