Compare commits

...

82 commits
main ... 0.20

Author SHA1 Message Date
Sebastian Dröge
37edd497cc Update CHANGELOG.md for 0.20.7 2023-07-05 12:21:59 +03:00
Sebastian Dröge
9e8fee59c4 Update Cargo.lock 2023-07-05 12:18:03 +03:00
Sebastian Dröge
7de3cef890 Update versions to 0.20.7 2023-07-05 12:17:47 +03:00
Sebastian Dröge
2c65a5a86a Update dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:36:44 +03:00
Sebastian Dröge
0f2c850785 gstreamer: Move various MetaAPI methods to an extension trait
These don't make sense to implement any different than the default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:36:44 +03:00
Sebastian Dröge
d77f983b02 basetransform: Don't leak any output buffer if prepare_output_buffer fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:36:44 +03:00
Sebastian Dröge
38420c7aab basetransform: Fix memory leak when dropping buffers from the transform function
Also add a basic test for a basetransform subclass.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/472

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:36:44 +03:00
Li Yuanheng
cbe627fe8b appsink: property should use hyphen not underscore
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:32:45 +03:00
Thibault Saunier
b9a9464301 ges: Mark asset APIs as Send+sync
Those objects are MT. safe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:32:38 +03:00
Thibault Saunier
559720693d ges: Allow subclassing GESFormatter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:32:00 +03:00
Sebastian Dröge
9b2a0f55c7 examples: Reduce dependencies of the thumbnail example
Instead of depending on libraries for every possible image format,
depend only on the JPEG and PNG libraries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:31:23 +03:00
Sebastian Dröge
d05ebfaf45 Update to cocoa 0.25
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:31:17 +03:00
Sebastian Dröge
5cf82ac910 Update to itertools 0.11
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:31:08 +03:00
Guillaume Desmottes
5b0f29003f pbutils: implement debug() method on DiscovererInfo related structs
The default Debug implementation is not very useful but unfortunately
cannot be overridden.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:30:33 +03:00
Sebastian Dröge
3c921f9320 examples: Update to memmap2 0.7
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1290>
2023-07-05 11:30:16 +03:00
Sebastian Dröge
f17ef98d4a Update Cargo.lock 2023-06-06 17:15:41 +03:00
Sebastian Dröge
d703cbcea6 Update CHANGELOG.md for 0.20.6 2023-06-06 17:13:05 +03:00
Sebastian Dröge
3eacb10d43 Update versions to 0.20.6 2023-06-06 17:10:21 +03:00
Sebastian Dröge
1792f72a14 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 14:33:44 +03:00
Sebastian Dröge
af77bd0b6a pbutils: Move DiscovererStreamInfo iterators to an extension trait
This way it can also be called directly on subclasses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 14:33:44 +03:00
Sebastian Dröge
24a00b9929 pbutils: Manually implement DiscovererStreamInfo::stream_id()
It can return `NULL` in some cases. The next release will use an
`Option` but to keep backwards compatibility here, `NULL` is mapped to
the empty string for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 14:33:44 +03:00
Daniel Pendse
545781d241 rtsp-server: Add RTSPContext uri getter
Add uri getter from RTSPContext

Fix #469

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 14:03:42 +03:00
Sebastian Dröge
011d3535bc gstreamer: Only retrieve the debug category once per log call
Each retrieval would go through the one-time-initialization check, i.e.
yet another branch, so let's avoid that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 13:56:25 +03:00
Sebastian Dröge
0d45fa3f07 gstreamer: Remove unnecessary clone() in debug logging macros
The macro called from them is already doing the `clone()` itself.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 13:56:19 +03:00
Sebastian Dröge
a7517cd27b gstreamer: Use temporary GStr for the debug category constructors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 13:56:10 +03:00
Sebastian Dröge
670d8ceec6 gstreamer: Mark DebugCategory as repr(transparent)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 13:56:02 +03:00
Sebastian Dröge
b0d6cab254 examples: Update to memmap2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1274>
2023-06-06 13:55:50 +03:00
Sebastian Dröge
371713a506 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1261>
2023-05-10 11:49:35 +03:00
Sebastian Dröge
a01a0f2e37 gstreamer: Get function name for logging outside the internal closure
Otherwise the function name will include the name of the closure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1261>
2023-05-10 11:49:16 +03:00
Sebastian Dröge
50ec192285 Update Cargo.lock 2023-04-22 11:52:30 +03:00
Sebastian Dröge
022a340742 Update versions to 0.20.5 2023-04-22 11:49:53 +03:00
Sebastian Dröge
42ec126d56 Update CHANGELOG.md for 0.20.5 2023-04-22 11:49:23 +03:00
Guillaume Desmottes
ff488987fa gstreamer: fix unused import in test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
2023-04-21 12:19:48 +03:00
Sebastian Dröge
97d55cdacb Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
2023-04-21 12:08:48 +03:00
Sebastian Dröge
b611f9702c Fix a couple of new Rust 1.69 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
2023-04-21 12:07:26 +03:00
Thibault Saunier
8d478c3fc9 miniobject: Implement the HasParamSpec trait in the macro
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
2023-04-21 12:07:21 +03:00
Bilal Elmoussaoui
4a60c71c84 gst-player: Implement Default for Player
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
2023-04-21 12:07:12 +03:00
Sebastian Dröge
3481f3b6c0 Update Cargo.lock 2023-04-07 13:06:40 +03:00
Sebastian Dröge
6fb1714114 Update versions to 0.20.4 2023-04-07 13:03:23 +03:00
Sebastian Dröge
78ded9ad88 Update CHANGELOG.md for 0.20.4 2023-04-07 13:02:41 +03:00
Sebastian Dröge
b72533d926 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:13 +03:00
Sebastian Dröge
e9644fb733 examples: Update to windows 0.48
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:13 +03:00
Sebastian Dröge
7d9b7fdaf7 examples: Update to windows 0.47
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:13 +03:00
Sebastian Dröge
43f29e361e examples: Update to windows 0.46
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:13 +03:00
Sebastian Dröge
a929123d4d deny: Update for older versions of the windows bindings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:01 +03:00
Sebastian Dröge
1d9d4cc346 deny: Update to allow multiple versions of syn for now
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 12:02:01 +03:00
Sebastian Dröge
64bc1f7625 webrtc: Work around WebRTCICE::add_candidate() API breakage in 1.24
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 11:55:10 +03:00
Sebastian Dröge
87a70b16ba audio: Don't store a copy of the AudioInfo in AudioFrame
Instead just reference the one inside the FFI struct directly by making
sure that the memory representation of the FFI and Rust type are the
same.

This reduces the size of `AudioFrame` by about half.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 11:52:08 +03:00
Sebastian Dröge
5c88d95553 video: Don't store a copy of the VideoInfo in VideoFrame
Instead just reference the one inside the FFI struct directly by making
sure that the memory representation of the FFI and Rust type are the
same.

This reduces the size of `VideoFrame` by about half.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1245>
2023-04-07 11:52:08 +03:00
Sebastian Dröge
a9dd58eca0 Update Cargo.lock 2023-03-14 13:16:14 +02:00
Sebastian Dröge
55ad90cc4d Update versions to 0.20.3 2023-03-14 13:15:57 +02:00
Sebastian Dröge
deb49017ec Update CHANGELOG.md for 0.20.3 2023-03-14 13:15:43 +02:00
Guillaume Desmottes
9102546d63 utils: streamproducer: document forward_eos default value
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 10:06:10 +01:00
Sebastian Dröge
f431630426 deny: Allow older windows-sys 0.42 for now
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 10:06:06 +01:00
Sebastian Dröge
6ef6f49e40 video: Fix two new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 10:06:06 +01:00
Marc Wiblishauser
18cbbfb1f8 ParamSpecArray: fix type_ from fraction to array
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 10:05:58 +01:00
Sebastian Dröge
cb6b7a2c2c rtsp-server: Work around GstRTSPClientClass ABI breakage in 1.18
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/455

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 10:05:58 +01:00
Sebastian Dröge
f0e766e7ee ci: Build 0.20 docs and drop 0.18 docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:43 +01:00
Jordan Petridis
92e2a23a99 ci: Update base image to debian 12 bookworm
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:43 +01:00
Sebastian Dröge
7be1db86fd ci: Update to gtk 4.10.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:43 +01:00
Sebastian Dröge
8ef5a045c1 ci: Update to meson 1.0.1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:43 +01:00
Sebastian Dröge
a77a656d04 ci: Update to Rust 1.68
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:42 +01:00
Sebastian Dröge
5171267260 ci: Update to rustup 1.25.2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 09:04:13 +01:00
Sebastian Dröge
d9ebcc5889 ci: windows: Update to dav1d 1.1.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1238>
2023-03-13 08:43:41 +01:00
Sebastian Dröge
a4c248cba3 Update Cargo.lock 2023-02-21 17:03:39 +02:00
Sebastian Dröge
4b9ac76020 Update versions to 0.20.2 2023-02-21 16:57:55 +02:00
Sebastian Dröge
facdd10eba Update CHANGELOG.md for 0.20.2 2023-02-21 16:57:30 +02:00
Sebastian Dröge
b78926a7f3 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1225>
2023-02-21 16:30:10 +02:00
François Laignel
2f41cb99d3 {Audio,Video}CapsBuilder: add for_encoding constructor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1225>
2023-02-21 16:11:15 +02:00
SeaDve
eeefa80227 gstreamer-play: impl default for Play
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1225>
2023-02-21 16:10:36 +02:00
SeaDve
9446401a46 gstreamer: implement HasParamSpec for ClockTime
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1225>
2023-02-21 16:10:29 +02:00
Sebastian Dröge
8afac7d31b Update CHANGELOG.md for 0.20.1 2023-02-13 15:02:29 +02:00
Sebastian Dröge
dabfc8d181 Update versions to 0.20.1 2023-02-13 15:02:29 +02:00
Sebastian Dröge
d1cc1b6715 video: Don't leak the gst::Buffer when converting a VideoFrame into an ffi::GstVideoFrame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1220>
2023-02-13 14:35:38 +02:00
Sebastian Dröge
bc3e1404d6 video: Don't forget to unmap the VideoFrame when converting into a gst::Buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1220>
2023-02-13 14:35:37 +02:00
Sebastian Dröge
2354cd6c4f audio: Don't forget to unmap the AudioBuffer and drop the Box when converting into a gst::Buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1220>
2023-02-13 14:35:35 +02:00
Sebastian Dröge
6cb469934d Revert "Add support for inline variable names in error/warning/info message creation macros"
This reverts commit 6bd559f5b5. It breaks
backwards compatibility as it makes it impossible to use a `&String` or
`&str` as debug message and only allows for string literals or format
strings plus arguments.
2023-02-13 11:40:55 +02:00
Sebastian Dröge
6bd559f5b5 Add support for inline variable names in error/warning/info message creation macros
Simply by removing the special-casing of string literals, which doesn't
really bring any improvements here.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/442

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1218>
2023-02-13 11:00:09 +02:00
Sebastian Dröge
66453fdc02 ci: Don't run cargo update on the stable branch 2023-02-11 20:15:46 +02:00
Sebastian Dröge
e901266415 Add Cargo.lock 2023-02-10 00:15:55 +02:00
Sebastian Dröge
8a02757434 Add 0.20 version to all local dependencies 2023-02-09 23:53:05 +02:00
Sebastian Dröge
2db1198311 Update to 0.17 branch of gtk-rs-core and gtk3-rs 2023-02-09 23:48:32 +02:00
108 changed files with 5263 additions and 481 deletions

View file

@ -17,7 +17,7 @@
# Updating the nightly image should be done by simply running a scheduled ci # Updating the nightly image should be done by simply running a scheduled ci
# pipeline on the upstream repo with the $UPDATE_NIGHTLY variable defined. # pipeline on the upstream repo with the $UPDATE_NIGHTLY variable defined.
.templates_sha: &templates_sha 567700e483aabed992d0a4fea84994a0472deff6 .templates_sha: &templates_sha fddab8aa63e89a8e65214f59860d9c0f030360c9
include: include:
- project: 'freedesktop/ci-templates' - project: 'freedesktop/ci-templates'
@ -56,8 +56,8 @@ variables:
# latest release must be at the top # latest release must be at the top
# (only relevant on main branch) # (only relevant on main branch)
RELEASES: RELEASES:
0.20=0.20
0.19=0.19 0.19=0.19
0.18=0.18
stages: stages:
- "trigger" - "trigger"
@ -89,41 +89,34 @@ trigger:
when: 'manual' when: 'manual'
allow_failure: false allow_failure: false
.debian:11: .debian:12:
needs: [] needs: []
variables: variables:
FDO_DISTRIBUTION_VERSION: 'bullseye-slim' FDO_DISTRIBUTION_VERSION: 'bookworm-slim'
before_script: before_script:
- source ./ci/env.sh - source ./ci/env.sh
- mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config - 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 --color=always
cargo update --color=always
fi
.debian:11-base: .debian:12-base:
extends: .debian:11 extends: .debian:12
variables: variables:
FDO_DISTRIBUTION_TAG: 'base-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_TAG: 'base-$GST_RS_IMG_TAG'
.debian:11-stable: .debian:12-stable:
extends: .debian:11 extends: .debian:12
variables: variables:
RUST_IMAGE_FULL: "1" RUST_IMAGE_FULL: "1"
FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-$GST_RS_IMG_TAG'
FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_STABLE $RUST_IMAGE_FULL' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_STABLE $RUST_IMAGE_FULL'
.debian:11-msrv: .debian:12-msrv:
extends: .debian:11 extends: .debian:12
variables: variables:
FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-$GST_RS_IMG_TAG'
FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_MSRV $RUST_IMAGE_FULL' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh $GST_RS_MSRV $RUST_IMAGE_FULL'
.debian:11-nightly: .debian:12-nightly:
extends: .debian:11 extends: .debian:12
variables: variables:
FDO_DISTRIBUTION_TAG: 'nightly-$GST_RS_IMG_TAG' FDO_DISTRIBUTION_TAG: 'nightly-$GST_RS_IMG_TAG'
FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh nightly $RUST_IMAGE_FULL' FDO_DISTRIBUTION_EXEC: 'bash ci/install-rust.sh nightly $RUST_IMAGE_FULL'
@ -145,37 +138,37 @@ trigger:
FDO_DISTRIBUTION_EXEC: >- FDO_DISTRIBUTION_EXEC: >-
bash ci/install-gst.sh && bash ci/install-gst.sh &&
bash ci/install-gtk4.sh && bash ci/install-gtk4.sh &&
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates
.build-final-image: .build-final-image:
extends: extends:
- .fdo.container-build@debian - .fdo.container-build@debian
stage: container-final stage: container-final
variables: variables:
FDO_BASE_IMAGE: '$CI_REGISTRY_IMAGE/debian/bullseye-slim:base-$GST_RS_IMG_TAG' FDO_BASE_IMAGE: '$CI_REGISTRY_IMAGE/debian/bookworm-slim:base-$GST_RS_IMG_TAG'
build-base: build-base:
extends: extends:
- .build-base-image - .build-base-image
- .debian:11-base - .debian:12-base
build-stable: build-stable:
needs: ["build-base"] needs: ["build-base"]
extends: extends:
- .build-final-image - .build-final-image
- .debian:11-stable - .debian:12-stable
build-msrv: build-msrv:
needs: ["build-base"] needs: ["build-base"]
extends: extends:
- .build-final-image - .build-final-image
- .debian:11-msrv - .debian:12-msrv
build-nightly: build-nightly:
needs: ["build-base"] needs: ["build-base"]
extends: extends:
- .build-final-image - .build-final-image
- .debian:11-nightly - .debian:12-nightly
update-nightly: update-nightly:
extends: build-nightly extends: build-nightly
@ -192,17 +185,17 @@ update-nightly:
.img-stable: .img-stable:
extends: extends:
- .debian:11-stable - .debian:12-stable
- .dist-debian-container - .dist-debian-container
.img-msrv: .img-msrv:
extends: extends:
- .debian:11-msrv - .debian:12-msrv
- .dist-debian-container - .dist-debian-container
.img-nightly: .img-nightly:
extends: extends:
- .debian:11-nightly - .debian:12-nightly
- .dist-debian-container - .dist-debian-container
# GST_PLUGINS_RS_TOKEN is a variable of type 'Var' defined in gstreamer-rs CI # GST_PLUGINS_RS_TOKEN is a variable of type 'Var' defined in gstreamer-rs CI

3138
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
variables: variables:
GST_RS_IMG_TAG: '2023-01-26.0' GST_RS_IMG_TAG: '2023-03-09.1-bookworm'
GST_RS_STABLE: '1.67.0' GST_RS_STABLE: '1.68.0'
GST_RS_MSRV: '1.64.0' GST_RS_MSRV: '1.64.0'

View file

@ -2,7 +2,7 @@
set -e set -e
pip3 install meson==1.0.0 pip3 install meson==1.0.1 --break-system-packages
# gstreamer-rs already has a 'gstreamer' directory so don't clone there # gstreamer-rs already has a 'gstreamer' directory so don't clone there
pushd . pushd .

View file

@ -2,7 +2,7 @@
set -eux set -eux
BRANCH=4.8.3 BRANCH=4.10.0
git clone https://gitlab.gnome.org/GNOME/gtk.git --branch $BRANCH --depth=1 git clone https://gitlab.gnome.org/GNOME/gtk.git --branch $BRANCH --depth=1
cd gtk cd gtk

View file

@ -5,7 +5,7 @@ source ./ci/env.sh
set -e set -e
export CARGO_HOME='/usr/local/cargo' export CARGO_HOME='/usr/local/cargo'
RUSTUP_VERSION=1.25.1 RUSTUP_VERSION=1.25.2
RUST_VERSION=$1 RUST_VERSION=$1
RUST_IMAGE_FULL=$2 RUST_IMAGE_FULL=$2
RUST_ARCH="x86_64-unknown-linux-gnu" RUST_ARCH="x86_64-unknown-linux-gnu"

View file

@ -1,7 +1,7 @@
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
# Download gstreamer and all its subprojects # Download gstreamer and all its subprojects
git clone -b 1.0.0 --depth 1 https://code.videolan.org/videolan/dav1d.git C:\dav1d git clone -b 1.1.0 --depth 1 https://code.videolan.org/videolan/dav1d.git C:\dav1d
if (!$?) { if (!$?) {
Write-Host "Failed to clone dav1d" Write-Host "Failed to clone dav1d"
Exit 1 Exit 1

View file

@ -3,7 +3,7 @@
$env:MESON_ARGS = "--prefix=C:\gst-install\" $env:MESON_ARGS = "--prefix=C:\gst-install\"
# Download gtk and all its subprojects # Download gtk and all its subprojects
git clone -b 4.8.3 --depth 1 https://gitlab.gnome.org/gnome/gtk.git C:\gtk git clone -b 4.10.0 --depth 1 https://gitlab.gnome.org/gnome/gtk.git C:\gtk
if (!$?) { if (!$?) {
Write-Host "Failed to clone gtk" Write-Host "Failed to clone gtk"
Exit 1 Exit 1

View file

@ -27,9 +27,43 @@ multiple-versions = "deny"
wildcards = "allow" wildcards = "allow"
highlight = "all" highlight = "all"
# Various crates depend on an older version of windows-sys
[[bans.skip]]
name = "windows-sys"
version = "0.45"
[[bans.skip]]
name = "windows_x86_64_msvc"
version = "0.42"
[[bans.skip]]
name = "windows_x86_64_gnullvm"
version = "0.42"
[[bans.skip]]
name = "windows_x86_64_gnu"
version = "0.42"
[[bans.skip]]
name = "windows_i686_msvc"
version = "0.42"
[[bans.skip]]
name = "windows_i686_gnu"
version = "0.42"
[[bans.skip]]
name = "windows_aarch64_msvc"
version = "0.42"
[[bans.skip]]
name = "windows_aarch64_gnullvm"
version = "0.42"
[[bans.skip]]
name = "windows-targets"
version = "0.42"
[sources] [sources]
unknown-registry = "deny" unknown-registry = "deny"
unknown-git = "deny" unknown-git = "deny"
allow-git = [ allow-git = [
"https://github.com/gtk-rs/gtk-rs-core", "https://github.com/gtk-rs/gtk-rs-core",
] ]
# Various crates depend on an older version of syn
[[bans.skip]]
name = "syn"
version = "1.0"

View file

@ -1,56 +1,56 @@
[package] [package]
name = "examples" name = "examples"
version = "0.20.0" version = "0.20.7"
license = "MIT" license = "MIT"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"
[dependencies] [dependencies]
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-gl = { package = "gstreamer-gl", path = "../gstreamer-gl", optional = true } gst-gl = { package = "gstreamer-gl", path = "../gstreamer-gl", version = "0.20", optional = true }
gst-gl-egl = { package = "gstreamer-gl-egl", path = "../gstreamer-gl/egl", optional = true } gst-gl-egl = { package = "gstreamer-gl-egl", path = "../gstreamer-gl/egl", version = "0.20", optional = true }
gst-gl-wayland = { package = "gstreamer-gl-wayland", path = "../gstreamer-gl/wayland", optional = true } gst-gl-wayland = { package = "gstreamer-gl-wayland", path = "../gstreamer-gl/wayland", version = "0.20", optional = true }
gst-gl-x11 = { package = "gstreamer-gl-x11", path = "../gstreamer-gl/x11", optional = true } gst-gl-x11 = { package = "gstreamer-gl-x11", path = "../gstreamer-gl/x11", optional = true }
gst-app = { package = "gstreamer-app", path = "../gstreamer-app" } gst-app = { package = "gstreamer-app", path = "../gstreamer-app", version = "0.20" }
gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio" } gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" } gst-video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20" }
gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils" } gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils", version = "0.20" }
gst-play = { package = "gstreamer-play", path = "../gstreamer-play", optional = true } gst-play = { package = "gstreamer-play", path = "../gstreamer-play", version = "0.20", optional = true }
gst-player = { package = "gstreamer-player", path = "../gstreamer-player", optional = true } gst-player = { package = "gstreamer-player", path = "../gstreamer-player", version = "0.20", optional = true }
ges = { package = "gstreamer-editing-services", path = "../gstreamer-editing-services", optional = true } ges = { package = "gstreamer-editing-services", path = "../gstreamer-editing-services", version = "0.20", optional = true }
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", optional = true } gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", version = "0.20", optional = true }
gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", optional = true } gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", version = "0.20", optional = true }
gst-rtsp-server = { package = "gstreamer-rtsp-server", path = "../gstreamer-rtsp-server", optional = true } gst-rtsp-server = { package = "gstreamer-rtsp-server", path = "../gstreamer-rtsp-server", version = "0.20", optional = true }
gst-allocators = { package = "gstreamer-allocators", path = "../gstreamer-allocators", optional = true } gst-allocators = { package = "gstreamer-allocators", path = "../gstreamer-allocators", version = "0.20", optional = true }
gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true } gtk = { git = "https://github.com/gtk-rs/gtk3-rs", branch = "0.17", version = "0.17.0", optional = true }
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true } gdk = { git = "https://github.com/gtk-rs/gtk3-rs", branch = "0.17", version = "0.17.0", optional = true }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true } gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17.0", optional = true }
anyhow = "1.0" anyhow = "1.0"
derive_more = "0.99.5" derive_more = "0.99.5"
futures = "0.3" futures = "0.3"
byte-slice-cast = "1" byte-slice-cast = "1"
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", features=["use_glib"], optional = true } cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17.0", features=["use_glib"], optional = true }
pango = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true } pango = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17.0", optional = true }
pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", optional = true } pangocairo = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17.0", optional = true }
glutin = { version = "0.29", optional = true } glutin = { version = "0.29", optional = true }
once_cell = "1.0" once_cell = "1.0"
image = { version = "0.24", optional = true } image = { version = "0.24", optional = true, default-features = false, features = ["png", "jpeg"] }
memmap2 = { version = "0.5", optional = true } memmap2 = { version = "0.7", optional = true }
memfd = { version = "0.6", optional = true } memfd = { version = "0.6", optional = true }
uds = { version = "0.2", optional = true } uds = { version = "0.2", optional = true }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
windows = { version = "0.44", features=["Win32_Graphics_Direct3D11", windows = { version = "0.48", features=["Win32_Graphics_Direct3D11",
"Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Dxgi", "Win32_Foundation", "Win32_Graphics_Direct3D", "Win32_Graphics_Dxgi",
"Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct2D", "Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct2D",
"Win32_Graphics_Direct2D_Common", "Win32_Graphics_DirectWrite", "Win32_Graphics_Direct2D_Common", "Win32_Graphics_DirectWrite",
"Foundation_Numerics"], optional = true } "Foundation_Numerics"], optional = true }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24" cocoa = "0.25"
[build-dependencies] [build-dependencies]
gl_generator = { version = "0.14", optional = true } gl_generator = { version = "0.14", optional = true }

View file

@ -133,7 +133,7 @@ fn main() -> Result<()> {
// situation and any of failure below would mean we are doing // situation and any of failure below would mean we are doing
// something in wrong way or driver bug or so. // something in wrong way or driver bug or so.
unsafe { unsafe {
let rtv = ID3D11RenderTargetView::from_raw_borrowed(&rtv_raw); let rtv = ID3D11RenderTargetView::from_raw_borrowed(&rtv_raw).unwrap();
let resource = rtv.GetResource().unwrap(); let resource = rtv.GetResource().unwrap();
let texture = resource.cast::<ID3D11Texture2D>().unwrap(); let texture = resource.cast::<ID3D11Texture2D>().unwrap();

View file

@ -303,6 +303,12 @@ mod client {
self.parent_closed(); self.parent_closed();
println!("Client {client:?} closed"); println!("Client {client:?} closed");
} }
fn describe_request(&self, ctx: &gst_rtsp_server::RTSPContext) {
self.parent_describe_request(ctx);
let request_uri = ctx.uri().unwrap().request_uri();
println!("Describe request for uri: {request_uri:?}");
}
} }
} }

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-allocators" name = "gstreamer-allocators"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Allocators library" description = "Rust bindings for GStreamer Allocators library"
@ -16,9 +16,9 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
bitflags = "1.0" bitflags = "1.0"
ffi = { package = "gstreamer-allocators-sys", path = "sys" } ffi = { package = "gstreamer-allocators-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
once_cell = "1.0" once_cell = "1.0"
[dev-dependencies] [dev-dependencies]

View file

@ -6,15 +6,20 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
package = "glib-sys" package = "glib-sys"
[dependencies.gobject] [dependencies.gobject]
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
package = "gobject-sys" package = "gobject-sys"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -43,7 +48,7 @@ name = "gstreamer-allocators-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
rust-version = "1.64" rust-version = "1.64"
version = "0.20.0" version = "0.20.7"
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = ["dox"] features = ["dox"]

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-app" name = "gstreamer-app"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer App library" description = "Rust bindings for GStreamer App library"
@ -18,10 +18,10 @@ futures-core = "0.3"
futures-sink = "0.3" futures-sink = "0.3"
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-app-sys", path = "sys" } ffi = { package = "gstreamer-app-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
once_cell = "1.0" once_cell = "1.0"
[dev-dependencies] [dev-dependencies]

View file

@ -1090,7 +1090,7 @@ impl AppSinkBuilder {
pub fn wait_on_eos(self, wait_on_eos: bool) -> Self { pub fn wait_on_eos(self, wait_on_eos: bool) -> Self {
Self { Self {
builder: self.builder.property("wait_on_eos", wait_on_eos), builder: self.builder.property("wait-on-eos", wait_on_eos),
..self ..self
} }
} }

View file

@ -7,14 +7,18 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -41,7 +45,7 @@ license = "MIT"
name = "gstreamer-app-sys" name = "gstreamer-app-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-audio" name = "gstreamer-audio"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Audio library" description = "Rust bindings for GStreamer Audio library"
@ -17,15 +17,15 @@ rust-version = "1.64"
libc = "0.2" libc = "0.2"
cfg-if = "1.0" cfg-if = "1.0"
bitflags = "1.0" bitflags = "1.0"
ffi = { package = "gstreamer-audio-sys", path = "sys" } ffi = { package = "gstreamer-audio-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
once_cell = "1.0" once_cell = "1.0"
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]
itertools = "0.10" itertools = "0.11"
serde_json = "1.0" serde_json = "1.0"
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -2,7 +2,7 @@
use std::{fmt, marker::PhantomData, mem, ops, ptr, slice}; use std::{fmt, marker::PhantomData, mem, ops, ptr, slice};
use glib::translate::{from_glib, Borrowed, FromGlibPtrNone, ToGlibPtr}; use glib::translate::{from_glib, Borrowed, ToGlibPtr};
pub enum Readable {} pub enum Readable {}
pub enum Writable {} pub enum Writable {}
@ -11,7 +11,6 @@ pub struct AudioBuffer<T> {
// Has to be boxed because it contains self-references // Has to be boxed because it contains self-references
audio_buffer: Box<ffi::GstAudioBuffer>, audio_buffer: Box<ffi::GstAudioBuffer>,
buffer: gst::Buffer, buffer: gst::Buffer,
info: crate::AudioInfo,
phantom: PhantomData<T>, phantom: PhantomData<T>,
} }
@ -21,10 +20,10 @@ unsafe impl<T> Sync for AudioBuffer<T> {}
impl<T> fmt::Debug for AudioBuffer<T> { impl<T> fmt::Debug for AudioBuffer<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("AudioBuffer") f.debug_struct("AudioBuffer")
.field("audio_buffer", &self.audio_buffer) .field("n_samples", &self.n_samples())
.field("buffer", &self.buffer) .field("n_planes", &self.n_planes())
.field("info", &self.info) .field("buffer", &self.buffer())
.field("phantom", &self.phantom) .field("info", &self.info())
.finish() .finish()
} }
} }
@ -32,12 +31,21 @@ impl<T> fmt::Debug for AudioBuffer<T> {
impl<T> AudioBuffer<T> { impl<T> AudioBuffer<T> {
#[inline] #[inline]
pub fn info(&self) -> &crate::AudioInfo { pub fn info(&self) -> &crate::AudioInfo {
&self.info unsafe {
&*(&self.audio_buffer.info as *const ffi::GstAudioInfo as *const crate::AudioInfo)
}
} }
#[inline] #[inline]
pub fn into_buffer(self) -> gst::Buffer { pub fn into_buffer(self) -> gst::Buffer {
unsafe { ptr::read(&mem::ManuallyDrop::new(self).buffer) } unsafe {
let mut s = mem::ManuallyDrop::new(self);
let buffer = ptr::read(&s.buffer);
ffi::gst_audio_buffer_unmap(&mut *s.audio_buffer);
ptr::drop_in_place(&mut s.audio_buffer);
buffer
}
} }
#[inline] #[inline]
@ -128,10 +136,8 @@ impl<T> AudioBuffer<T> {
#[inline] #[inline]
pub fn as_audio_buffer_ref(&self) -> AudioBufferRef<&gst::BufferRef> { pub fn as_audio_buffer_ref(&self) -> AudioBufferRef<&gst::BufferRef> {
let info = self.info.clone();
AudioBufferRef { AudioBufferRef {
audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::from(&*self.audio_buffer)), audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::from(&*self.audio_buffer)),
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
} }
@ -174,13 +180,9 @@ impl AudioBuffer<Readable> {
if !res { if !res {
Err(buffer) Err(buffer)
} else { } else {
let info = crate::AudioInfo::from_glib_none(
&audio_buffer.info as *const _ as *mut ffi::GstAudioInfo,
);
Ok(Self { Ok(Self {
audio_buffer, audio_buffer,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -210,13 +212,9 @@ impl AudioBuffer<Writable> {
if !res { if !res {
Err(buffer) Err(buffer)
} else { } else {
let info = crate::AudioInfo::from_glib_none(
&audio_buffer.info as *const _ as *mut ffi::GstAudioInfo,
);
Ok(Self { Ok(Self {
audio_buffer, audio_buffer,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -245,10 +243,8 @@ impl AudioBuffer<Writable> {
#[inline] #[inline]
pub fn as_mut_audio_buffer_ref(&mut self) -> AudioBufferRef<&mut gst::BufferRef> { pub fn as_mut_audio_buffer_ref(&mut self) -> AudioBufferRef<&mut gst::BufferRef> {
let info = self.info.clone();
AudioBufferRef { AudioBufferRef {
audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::from(&mut *self.audio_buffer)), audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::from(&mut *self.audio_buffer)),
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
} }
@ -288,19 +284,32 @@ impl ops::DerefMut for AudioBufferPtr {
} }
} }
#[derive(Debug)]
pub struct AudioBufferRef<T> { pub struct AudioBufferRef<T> {
// Has to be boxed because it contains self-references // Has to be boxed because it contains self-references
audio_buffer: AudioBufferPtr, audio_buffer: AudioBufferPtr,
info: crate::AudioInfo,
unmap: bool, unmap: bool,
phantom: PhantomData<T>, phantom: PhantomData<T>,
} }
impl<T> fmt::Debug for AudioBufferRef<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("AudioBufferRef")
.field("n_samples", &self.n_samples())
.field("n_planes", &self.n_planes())
.field("buffer", &unsafe {
gst::BufferRef::from_ptr(self.audio_buffer.buffer)
})
.field("info", &self.info())
.finish()
}
}
impl<T> AudioBufferRef<T> { impl<T> AudioBufferRef<T> {
#[inline] #[inline]
pub fn info(&self) -> &crate::AudioInfo { pub fn info(&self) -> &crate::AudioInfo {
&self.info unsafe {
&*(&self.audio_buffer.info as *const ffi::GstAudioInfo as *const crate::AudioInfo)
}
} }
#[inline] #[inline]
@ -399,14 +408,10 @@ impl<'a> AudioBufferRef<&'a gst::BufferRef> {
pub unsafe fn from_glib_borrow(audio_buffer: *const ffi::GstAudioBuffer) -> Borrowed<Self> { pub unsafe fn from_glib_borrow(audio_buffer: *const ffi::GstAudioBuffer) -> Borrowed<Self> {
debug_assert!(!audio_buffer.is_null()); debug_assert!(!audio_buffer.is_null());
let info = crate::AudioInfo::from_glib_none(
&(*audio_buffer).info as *const _ as *mut ffi::GstAudioInfo,
);
Borrowed::new(Self { Borrowed::new(Self {
audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::new_unchecked( audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::new_unchecked(
audio_buffer as *mut _, audio_buffer as *mut _,
)), )),
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -433,12 +438,8 @@ impl<'a> AudioBufferRef<&'a gst::BufferRef> {
if !res { if !res {
Err(glib::bool_error!("Failed to map AudioBuffer")) Err(glib::bool_error!("Failed to map AudioBuffer"))
} else { } else {
let info = crate::AudioInfo::from_glib_none(
&audio_buffer.info as *const _ as *mut ffi::GstAudioInfo,
);
Ok(Self { Ok(Self {
audio_buffer: AudioBufferPtr::Owned(audio_buffer), audio_buffer: AudioBufferPtr::Owned(audio_buffer),
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -457,12 +458,8 @@ impl<'a> AudioBufferRef<&'a mut gst::BufferRef> {
pub unsafe fn from_glib_borrow_mut(audio_buffer: *mut ffi::GstAudioBuffer) -> Borrowed<Self> { pub unsafe fn from_glib_borrow_mut(audio_buffer: *mut ffi::GstAudioBuffer) -> Borrowed<Self> {
debug_assert!(!audio_buffer.is_null()); debug_assert!(!audio_buffer.is_null());
let info = crate::AudioInfo::from_glib_none(
&(*audio_buffer).info as *const _ as *mut ffi::GstAudioInfo,
);
Borrowed::new(Self { Borrowed::new(Self {
audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::new_unchecked(audio_buffer)), audio_buffer: AudioBufferPtr::Borrowed(ptr::NonNull::new_unchecked(audio_buffer)),
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -489,12 +486,8 @@ impl<'a> AudioBufferRef<&'a mut gst::BufferRef> {
if !res { if !res {
Err(glib::bool_error!("Failed to map AudioBuffer")) Err(glib::bool_error!("Failed to map AudioBuffer"))
} else { } else {
let info = crate::AudioInfo::from_glib_none(
&audio_buffer.info as *const _ as *mut ffi::GstAudioInfo,
);
Ok(Self { Ok(Self {
audio_buffer: AudioBufferPtr::Owned(audio_buffer), audio_buffer: AudioBufferPtr::Owned(audio_buffer),
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })

View file

@ -9,6 +9,7 @@ use gst::prelude::*;
#[doc(alias = "GstAudioInfo")] #[doc(alias = "GstAudioInfo")]
#[derive(Clone)] #[derive(Clone)]
#[repr(transparent)]
pub struct AudioInfo(ffi::GstAudioInfo); pub struct AudioInfo(ffi::GstAudioInfo);
impl fmt::Debug for AudioInfo { impl fmt::Debug for AudioInfo {

View file

@ -11,7 +11,19 @@ pub struct AudioCapsBuilder<T> {
} }
impl AudioCapsBuilder<gst::caps::NoFeature> { impl AudioCapsBuilder<gst::caps::NoFeature> {
// rustdoc-stripper-ignore-next
/// Constructs an `AudioCapsBuilder` for the "audio/x-raw" encoding.
///
/// If left unchanged, the resulting `Caps` will be initialized with:
/// - "audio/x-raw" encoding.
/// - maximum rate range.
/// - maximum channels range.
/// - both interleaved and non-interleaved layouts.
/// - all available formats.
///
/// Use [`AudioCapsBuilder::for_encoding`] to specify another encoding.
pub fn new() -> Self { pub fn new() -> Self {
assert_initialized_main_thread!();
let builder = Caps::builder(glib::gstr!("audio/x-raw")); let builder = Caps::builder(glib::gstr!("audio/x-raw"));
let builder = AudioCapsBuilder { builder }; let builder = AudioCapsBuilder { builder };
builder builder
@ -21,10 +33,34 @@ impl AudioCapsBuilder<gst::caps::NoFeature> {
.format_list(AudioFormat::iter_raw()) .format_list(AudioFormat::iter_raw())
} }
// rustdoc-stripper-ignore-next
/// Constructs an `AudioCapsBuilder` for the "audio/x-raw" encoding
/// with interleaved layout.
///
/// If left unchanged, the resulting `Caps` will be initialized with:
/// - "audio/x-raw" encoding.
/// - maximum rate range.
/// - maximum channels range.
/// - interleaved layout.
/// - all available formats.
///
/// Use [`AudioCapsBuilder::for_encoding`] to specify another encoding.
pub fn new_interleaved() -> Self { pub fn new_interleaved() -> Self {
AudioCapsBuilder::new().layout(AudioLayout::Interleaved) AudioCapsBuilder::new().layout(AudioLayout::Interleaved)
} }
// rustdoc-stripper-ignore-next
/// Constructs an `AudioCapsBuilder` for the specified encoding.
///
/// The resulting `Caps` will use the `encoding` argument as name
/// and will not contain any additional fields unless explicitly added.
pub fn for_encoding(encoding: impl IntoGStr) -> Self {
assert_initialized_main_thread!();
AudioCapsBuilder {
builder: Caps::builder(encoding),
}
}
pub fn any_features(self) -> AudioCapsBuilder<gst::caps::HasFeatures> { pub fn any_features(self) -> AudioCapsBuilder<gst::caps::HasFeatures> {
AudioCapsBuilder { AudioCapsBuilder {
builder: self.builder.any_features(), builder: self.builder.any_features(),
@ -180,3 +216,22 @@ fn layout_str(layout: AudioLayout) -> &'static glib::GStr {
crate::AudioLayout::__Unknown(_) => glib::gstr!("unknown"), crate::AudioLayout::__Unknown(_) => glib::gstr!("unknown"),
} }
} }
#[cfg(test)]
mod tests {
use super::AudioCapsBuilder;
#[test]
fn default_encoding() {
gst::init().unwrap();
let caps = AudioCapsBuilder::new().build();
assert_eq!(caps.structure(0).unwrap().name(), "audio/x-raw");
}
#[test]
fn explicit_encoding() {
gst::init().unwrap();
let caps = AudioCapsBuilder::for_encoding("audio/mpeg").build();
assert_eq!(caps.structure(0).unwrap().name(), "audio/mpeg");
}
}

View file

@ -7,18 +7,24 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -45,7 +51,7 @@ license = "MIT"
name = "gstreamer-audio-sys" name = "gstreamer-audio-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-base" name = "gstreamer-base"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base library" description = "Rust bindings for GStreamer Base library"
@ -17,10 +17,11 @@ rust-version = "1.64"
cfg-if = "1.0" cfg-if = "1.0"
libc = "0.2" libc = "0.2"
bitflags = "1.0" bitflags = "1.0"
ffi = { package = "gstreamer-base-sys", path = "sys" } ffi = { package = "gstreamer-base-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
atomic_refcell = "0.1" atomic_refcell = "0.1"
once_cell = "1"
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -104,7 +104,7 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) { fn set_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) {
self.as_ref() self.as_ref()
.set_property("min-upstream-latency", &min_upstream_latency); .set_property("min-upstream-latency", min_upstream_latency);
} }
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]

View file

@ -570,6 +570,13 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
PrepareOutputBufferSuccess::Buffer(from_glib_full(outbuf)) PrepareOutputBufferSuccess::Buffer(from_glib_full(outbuf))
} }
}) })
.map_err(|err| {
if outbuf != buf as *mut _ {
drop(Option::<gst::Buffer>::from_glib_full(outbuf));
}
err
})
}) })
.unwrap_or(Err(gst::FlowError::NotSupported)) .unwrap_or(Err(gst::FlowError::NotSupported))
} }
@ -828,21 +835,20 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.expect("Missing parent function `generate_output`"); .expect("Missing parent function `generate_output`");
let mut outbuf = ptr::null_mut(); let mut outbuf = ptr::null_mut();
gst::FlowSuccess::try_from_glib(f( let res = gst::FlowSuccess::try_from_glib(f(
self.obj() self.obj()
.unsafe_cast_ref::<BaseTransform>() .unsafe_cast_ref::<BaseTransform>()
.to_glib_none() .to_glib_none()
.0, .0,
&mut outbuf, &mut outbuf,
)) ));
.map(|res| {
if res == crate::BASE_TRANSFORM_FLOW_DROPPED { let outbuf = Option::<gst::Buffer>::from_glib_full(outbuf);
GenerateOutputSuccess::Dropped
} else if res != gst::FlowSuccess::Ok || outbuf.is_null() { res.map(move |res| match (res, outbuf) {
GenerateOutputSuccess::NoOutput (crate::BASE_TRANSFORM_FLOW_DROPPED, _) => GenerateOutputSuccess::Dropped,
} else { (gst::FlowSuccess::Ok, Some(outbuf)) => GenerateOutputSuccess::Buffer(outbuf),
GenerateOutputSuccess::Buffer(from_glib_full(outbuf)) _ => GenerateOutputSuccess::NoOutput,
}
}) })
} }
} }
@ -1141,6 +1147,8 @@ unsafe extern "C" fn base_transform_prepare_output_buffer<T: BaseTransformImpl>(
true => InputBuffer::Writable(gst::BufferRef::from_mut_ptr(inbuf)), true => InputBuffer::Writable(gst::BufferRef::from_mut_ptr(inbuf)),
}; };
*outbuf = ptr::null_mut();
gst::panic_to_error!(imp, gst::FlowReturn::Error, { gst::panic_to_error!(imp, gst::FlowReturn::Error, {
match imp.prepare_output_buffer(buffer) { match imp.prepare_output_buffer(buffer) {
Ok(PrepareOutputBufferSuccess::InputBuffer) => { Ok(PrepareOutputBufferSuccess::InputBuffer) => {
@ -1378,3 +1386,133 @@ unsafe extern "C" fn base_transform_generate_output<T: BaseTransformImpl>(
}) })
.into_glib() .into_glib()
} }
#[cfg(test)]
mod tests {
use super::*;
pub mod imp {
use super::*;
use std::sync::atomic::{self, AtomicBool};
#[derive(Default)]
pub struct TestTransform {
drop_next: AtomicBool,
}
#[glib::object_subclass]
impl ObjectSubclass for TestTransform {
const NAME: &'static str = "TestTransform";
type Type = super::TestTransform;
type ParentType = crate::BaseTransform;
}
impl ObjectImpl for TestTransform {}
impl GstObjectImpl for TestTransform {}
impl ElementImpl for TestTransform {
fn metadata() -> Option<&'static gst::subclass::ElementMetadata> {
use once_cell::sync::Lazy;
static ELEMENT_METADATA: Lazy<gst::subclass::ElementMetadata> = Lazy::new(|| {
gst::subclass::ElementMetadata::new(
"Test Transform",
"Generic",
"Does nothing",
"Sebastian Dröge <sebastian@centricular.com>",
)
});
Some(&*ELEMENT_METADATA)
}
fn pad_templates() -> &'static [gst::PadTemplate] {
use once_cell::sync::Lazy;
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| {
let caps = gst::Caps::new_any();
vec![
gst::PadTemplate::new(
"src",
gst::PadDirection::Src,
gst::PadPresence::Always,
&caps,
)
.unwrap(),
gst::PadTemplate::new(
"sink",
gst::PadDirection::Sink,
gst::PadPresence::Always,
&caps,
)
.unwrap(),
]
});
PAD_TEMPLATES.as_ref()
}
}
impl BaseTransformImpl for TestTransform {
const MODE: BaseTransformMode = BaseTransformMode::AlwaysInPlace;
const PASSTHROUGH_ON_SAME_CAPS: bool = false;
const TRANSFORM_IP_ON_PASSTHROUGH: bool = false;
fn transform_ip(
&self,
_buf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> {
if self.drop_next.load(atomic::Ordering::SeqCst) {
self.drop_next.store(false, atomic::Ordering::SeqCst);
Ok(crate::BASE_TRANSFORM_FLOW_DROPPED)
} else {
self.drop_next.store(true, atomic::Ordering::SeqCst);
Ok(gst::FlowSuccess::Ok)
}
}
}
}
glib::wrapper! {
pub struct TestTransform(ObjectSubclass<imp::TestTransform>) @extends crate::BaseTransform, gst::Element, gst::Object;
}
impl TestTransform {
pub fn new(name: Option<&str>) -> Self {
glib::Object::builder().property("name", name).build()
}
}
#[test]
fn test_transform_subclass() {
gst::init().unwrap();
let element = TestTransform::new(Some("test"));
assert_eq!(element.name(), "test");
let pipeline = gst::Pipeline::default();
let src = gst::ElementFactory::make("audiotestsrc")
.property("num-buffers", 100i32)
.build()
.unwrap();
let sink = gst::ElementFactory::make("fakesink").build().unwrap();
pipeline
.add_many(&[&src, element.upcast_ref(), &sink])
.unwrap();
gst::Element::link_many(&[&src, element.upcast_ref(), &sink]).unwrap();
pipeline.set_state(gst::State::Playing).unwrap();
let bus = pipeline.bus().unwrap();
let eos = bus.timed_pop_filtered(gst::ClockTime::NONE, &[gst::MessageType::Eos]);
assert!(eos.is_some());
let stats = sink.property::<gst::Structure>("stats");
assert_eq!(stats.get::<u64>("rendered").unwrap(), 50);
pipeline.set_state(gst::State::Null).unwrap();
}
}

View file

@ -7,14 +7,19 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -43,7 +48,7 @@ license = "MIT"
name = "gstreamer-base-sys" name = "gstreamer-base-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-check" name = "gstreamer-check"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Check library" description = "Rust bindings for GStreamer Check library"
@ -15,9 +15,9 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
ffi = { package = "gstreamer-check-sys", path = "sys" } ffi = { package = "gstreamer-check-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -7,14 +7,19 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -41,7 +46,7 @@ license = "MIT"
name = "gstreamer-check-sys" name = "gstreamer-check-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-controller" name = "gstreamer-controller"
version = "0.20.0" version = "0.20.7"
authors = ["Alexey Galakhov <agalakhov@gmail.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Alexey Galakhov <agalakhov@gmail.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Controller library" description = "Rust bindings for GStreamer Controller library"
@ -16,9 +16,9 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
once_cell = "1.0" once_cell = "1.0"
ffi = { package = "gstreamer-controller-sys", path = "sys" } ffi = { package = "gstreamer-controller-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -8,14 +8,19 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -42,7 +47,7 @@ license = "MIT"
name = "gstreamer-controller-sys" name = "gstreamer-controller-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-editing-services" name = "gstreamer-editing-services"
version = "0.20.0" version = "0.20.7"
authors = ["Thibault Saunier <tsaunier@igalia.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Thibault Saunier <tsaunier@igalia.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Editing Services" description = "Rust bindings for GStreamer Editing Services"
@ -16,12 +16,12 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
bitflags = "1.0" bitflags = "1.0"
ffi = { package = "gstreamer-editing-services-sys", path = "sys"} ffi = { package = "gstreamer-editing-services-sys", path = "sys", version = "0.20"}
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } 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" } gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils" } gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils", version = "0.20" }
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -59,11 +59,9 @@ generate = [
"GES.BaseTransitionClip", "GES.BaseTransitionClip",
"GES.BaseXmlFormatter", "GES.BaseXmlFormatter",
"GES.ChildrenControlMode", "GES.ChildrenControlMode",
"GES.ClipAsset",
"GES.CommandLineFormatter", "GES.CommandLineFormatter",
"GES.Edge", "GES.Edge",
"GES.EditMode", "GES.EditMode",
"GES.EffectAsset",
"GES.EffectClip", "GES.EffectClip",
"GES.Error", "GES.Error",
"GES.ExtractableCheckId", "GES.ExtractableCheckId",
@ -83,7 +81,6 @@ generate = [
"GES.PipelineFlags", "GES.PipelineFlags",
"GES.Source", "GES.Source",
"GES.SourceClip", "GES.SourceClip",
"GES.SourceClipAsset",
"GES.TestClip", "GES.TestClip",
"GES.TextHAlign", "GES.TextHAlign",
"GES.TextOverlay", "GES.TextOverlay",
@ -91,12 +88,9 @@ generate = [
"GES.TextVAlign", "GES.TextVAlign",
"GES.TitleClip", "GES.TitleClip",
"GES.TitleSource", "GES.TitleSource",
"GES.TrackElementAsset",
"GES.TrackType", "GES.TrackType",
"GES.Transition", "GES.Transition",
"GES.TransitionClip", "GES.TransitionClip",
"GES.UriClipAsset",
"GES.UriSourceAsset",
"GES.VideoSource", "GES.VideoSource",
"GES.VideoStandardTransitionType", "GES.VideoStandardTransitionType",
"GES.VideoTestPattern", "GES.VideoTestPattern",
@ -110,6 +104,7 @@ generate = [
[[object]] [[object]]
name = "GES.Asset" name = "GES.Asset"
status = "generate" status = "generate"
concurrency = "send+sync"
[[object.function]] [[object.function]]
name = "set_proxy" name = "set_proxy"
[object.function.return] [object.function.return]
@ -161,6 +156,11 @@ status = "generate"
[object.function.return] [object.function.return]
nullable_return_is_error = "Failed to split clip" nullable_return_is_error = "Failed to split clip"
[[object]]
name = "GES.ClipAsset"
status = "generate"
concurrency = "send+sync"
[[object]] [[object]]
name = "GES.Container" name = "GES.Container"
status = "generate" status = "generate"
@ -188,6 +188,11 @@ status = "generate"
[object.function.return] [object.function.return]
nullable_return_is_error = "Failed to create effect from description" nullable_return_is_error = "Failed to create effect from description"
[[object]]
name = "GES.EffectAsset"
status = "generate"
concurrency = "send+sync"
[[object]] [[object]]
name = "GES.Extractable" name = "GES.Extractable"
status = "generate" status = "generate"
@ -256,6 +261,11 @@ status = "generate"
[object.function.return] [object.function.return]
bool_return_is_error = "Failed to remove asset" bool_return_is_error = "Failed to remove asset"
[[object]]
name = "GES.SourceClipAsset"
status = "generate"
concurrency = "send+sync"
[[object]] [[object]]
name = "GES.Timeline" name = "GES.Timeline"
status = "generate" status = "generate"
@ -462,6 +472,11 @@ status = "generate"
name = "value" name = "value"
const = true const = true
[[object]]
name = "GES.TrackElementAsset"
status = "generate"
concurrency = "send+sync"
[[object]] [[object]]
name = "GES.UriClip" name = "GES.UriClip"
status = "generate" status = "generate"
@ -470,6 +485,16 @@ status = "generate"
[object.function.return] [object.function.return]
nullable_return_is_error = "Failed to create Uri clip from Uri" nullable_return_is_error = "Failed to create Uri clip from Uri"
[[object]]
name = "GES.UriClipAsset"
status = "generate"
concurrency = "send+sync"
[[object]]
name = "GES.UriSourceAsset"
status = "generate"
concurrency = "send+sync"
[[object]] [[object]]
name = "Gst.Buffer" name = "Gst.Buffer"
status = "manual" status = "manual"

View file

@ -126,6 +126,9 @@ impl Asset {
} }
} }
unsafe impl Send for Asset {}
unsafe impl Sync for Asset {}
pub trait AssetExt: 'static { pub trait AssetExt: 'static {
#[doc(alias = "ges_asset_extract")] #[doc(alias = "ges_asset_extract")]
fn extract(&self) -> Result<Extractable, glib::Error>; fn extract(&self) -> Result<Extractable, glib::Error>;
@ -162,10 +165,13 @@ pub trait AssetExt: 'static {
fn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), glib::error::BoolError>; fn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), glib::error::BoolError>;
#[doc(alias = "proxy")] #[doc(alias = "proxy")]
fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "proxy-target")] #[doc(alias = "proxy-target")]
fn connect_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
} }
impl<O: IsA<Asset>> AssetExt for O { impl<O: IsA<Asset>> AssetExt for O {
@ -241,8 +247,11 @@ impl<O: IsA<Asset>> AssetExt for O {
} }
} }
fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_trampoline<P: IsA<Asset>, F: Fn(&P) + 'static>( unsafe extern "C" fn notify_proxy_trampoline<
P: IsA<Asset>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GESAsset, this: *mut ffi::GESAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer, f: glib::ffi::gpointer,
@ -263,8 +272,14 @@ impl<O: IsA<Asset>> AssetExt for O {
} }
} }
fn connect_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>(
unsafe extern "C" fn notify_proxy_target_trampoline<P: IsA<Asset>, F: Fn(&P) + 'static>( &self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_target_trampoline<
P: IsA<Asset>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GESAsset, this: *mut ffi::GESAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer, f: glib::ffi::gpointer,

View file

@ -30,6 +30,9 @@ impl ClipAsset {
pub const NONE: Option<&'static ClipAsset> = None; pub const NONE: Option<&'static ClipAsset> = None;
} }
unsafe impl Send for ClipAsset {}
unsafe impl Sync for ClipAsset {}
pub trait ClipAssetExt: 'static { pub trait ClipAssetExt: 'static {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
@ -51,7 +54,10 @@ pub trait ClipAssetExt: 'static {
fn set_supported_formats(&self, supportedformats: TrackType); fn set_supported_formats(&self, supportedformats: TrackType);
#[doc(alias = "supported-formats")] #[doc(alias = "supported-formats")]
fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_supported_formats_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
} }
impl<O: IsA<ClipAsset>> ClipAssetExt for O { impl<O: IsA<ClipAsset>> ClipAssetExt for O {
@ -102,10 +108,13 @@ impl<O: IsA<ClipAsset>> ClipAssetExt for O {
} }
} }
fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_supported_formats_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline< unsafe extern "C" fn notify_supported_formats_trampoline<
P: IsA<ClipAsset>, P: IsA<ClipAsset>,
F: Fn(&P) + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut ffi::GESClipAsset, this: *mut ffi::GESClipAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,

View file

@ -17,3 +17,6 @@ glib::wrapper! {
impl EffectAsset { impl EffectAsset {
pub const NONE: Option<&'static EffectAsset> = None; pub const NONE: Option<&'static EffectAsset> = None;
} }
unsafe impl Send for EffectAsset {}
unsafe impl Sync for EffectAsset {}

View file

@ -17,3 +17,6 @@ glib::wrapper! {
impl SourceClipAsset { impl SourceClipAsset {
pub const NONE: Option<&'static SourceClipAsset> = None; pub const NONE: Option<&'static SourceClipAsset> = None;
} }
unsafe impl Send for SourceClipAsset {}
unsafe impl Sync for SourceClipAsset {}

View file

@ -27,6 +27,9 @@ impl TrackElementAsset {
pub const NONE: Option<&'static TrackElementAsset> = None; pub const NONE: Option<&'static TrackElementAsset> = None;
} }
unsafe impl Send for TrackElementAsset {}
unsafe impl Sync for TrackElementAsset {}
pub trait TrackElementAssetExt: 'static { pub trait TrackElementAssetExt: 'static {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
@ -42,7 +45,10 @@ pub trait TrackElementAssetExt: 'static {
fn set_track_type(&self, type_: TrackType); fn set_track_type(&self, type_: TrackType);
#[doc(alias = "track-type")] #[doc(alias = "track-type")]
fn connect_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_track_type_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
} }
impl<O: IsA<TrackElementAsset>> TrackElementAssetExt for O { impl<O: IsA<TrackElementAsset>> TrackElementAssetExt for O {
@ -82,10 +88,13 @@ impl<O: IsA<TrackElementAsset>> TrackElementAssetExt for O {
} }
} }
fn connect_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_track_type_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_track_type_trampoline< unsafe extern "C" fn notify_track_type_trampoline<
P: IsA<TrackElementAsset>, P: IsA<TrackElementAsset>,
F: Fn(&P) + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut ffi::GESTrackElementAsset, this: *mut ffi::GESTrackElementAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,

View file

@ -65,6 +65,9 @@ impl UriClipAsset {
} }
} }
unsafe impl Send for UriClipAsset {}
unsafe impl Sync for UriClipAsset {}
pub trait UriClipAssetExt: 'static { pub trait UriClipAssetExt: 'static {
#[doc(alias = "ges_uri_clip_asset_get_duration")] #[doc(alias = "ges_uri_clip_asset_get_duration")]
#[doc(alias = "get_duration")] #[doc(alias = "get_duration")]
@ -97,12 +100,18 @@ pub trait UriClipAssetExt: 'static {
fn is_nested_timeline(&self) -> bool; fn is_nested_timeline(&self) -> bool;
#[doc(alias = "duration")] #[doc(alias = "duration")]
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "is-nested-timeline")] #[doc(alias = "is-nested-timeline")]
fn connect_is_nested_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_is_nested_timeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
} }
impl<O: IsA<UriClipAsset>> UriClipAssetExt for O { impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
@ -160,10 +169,13 @@ impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
glib::ObjectExt::property(self.as_ref(), "is-nested-timeline") glib::ObjectExt::property(self.as_ref(), "is-nested-timeline")
} }
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline< unsafe extern "C" fn notify_duration_trampoline<
P: IsA<UriClipAsset>, P: IsA<UriClipAsset>,
F: Fn(&P) + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut ffi::GESUriClipAsset, this: *mut ffi::GESUriClipAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,
@ -187,10 +199,13 @@ impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn connect_is_nested_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { fn connect_is_nested_timeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_is_nested_timeline_trampoline< unsafe extern "C" fn notify_is_nested_timeline_trampoline<
P: IsA<UriClipAsset>, P: IsA<UriClipAsset>,
F: Fn(&P) + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut ffi::GESUriClipAsset, this: *mut ffi::GESUriClipAsset,
_param_spec: glib::ffi::gpointer, _param_spec: glib::ffi::gpointer,

View file

@ -19,6 +19,9 @@ impl UriSourceAsset {
pub const NONE: Option<&'static UriSourceAsset> = None; pub const NONE: Option<&'static UriSourceAsset> = None;
} }
unsafe impl Send for UriSourceAsset {}
unsafe impl Sync for UriSourceAsset {}
pub trait UriSourceAssetExt: 'static { pub trait UriSourceAssetExt: 'static {
#[doc(alias = "ges_uri_source_asset_get_filesource_asset")] #[doc(alias = "ges_uri_source_asset_get_filesource_asset")]
#[doc(alias = "get_filesource_asset")] #[doc(alias = "get_filesource_asset")]

View file

@ -0,0 +1,73 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::prelude::*;
use gst::glib::translate::*;
pub trait FormatterExtManual: 'static {
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error>;
#[doc(alias = "ges_formatter_class_register_metas")]
fn register(
type_: glib::types::Type,
name: &str,
description: Option<&str>,
extensions: Option<&str>,
caps: Option<&str>,
version: f64,
rank: gst::Rank,
);
}
impl<O: IsA<crate::Formatter>> FormatterExtManual for O {
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
unsafe {
let klass = self.class_of::<crate::Formatter>().unwrap();
let f = klass.as_ref().can_load_uri.ok_or_else(|| {
glib::Error::new(gst::CoreError::Failed, "No `can_load_uri` method defined")
})?;
let mut err = std::ptr::null_mut();
let res = f(
self.as_ref().to_glib_none().0,
uri.to_glib_none().0,
&mut err,
);
if res == glib::ffi::GTRUE {
Ok(())
} else {
Err(from_glib_full(err))
}
}
}
#[doc(alias = "ges_formatter_class_register_metas")]
fn register(
type_: glib::types::Type,
name: &str,
description: Option<&str>,
extensions: Option<&str>,
caps: Option<&str>,
version: f64,
rank: gst::Rank,
) {
skip_assert_initialized!();
unsafe {
let klass = mut_override(
gst::glib::Class::<crate::Formatter>::from_type(type_)
.unwrap()
.as_ref(),
);
ffi::ges_formatter_class_register_metas(
klass,
name.to_glib_none().0,
description.to_glib_none().0,
extensions.to_glib_none().0,
caps.to_glib_none().0,
version,
rank.into_glib(),
)
}
}
}

View file

@ -54,7 +54,9 @@ macro_rules! skip_assert_initialized {
#[allow(deprecated)] #[allow(deprecated)]
#[allow(unused_imports)] #[allow(unused_imports)]
mod auto; mod auto;
mod formatter;
pub use crate::auto::*; pub use crate::auto::*;
pub mod subclass;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
mod flag_serde; mod flag_serde;
@ -65,9 +67,12 @@ pub mod prelude {
#[doc(hidden)] #[doc(hidden)]
pub use gio::prelude::*; pub use gio::prelude::*;
#[doc(hidden)] #[doc(hidden)]
pub use glib::prelude::*;
#[doc(hidden)]
pub use gst_base::prelude::*; pub use gst_base::prelude::*;
#[doc(hidden)] #[doc(hidden)]
pub use gst_pbutils::prelude::*; pub use gst_pbutils::prelude::*;
pub use crate::auto::traits::*; pub use crate::auto::traits::*;
pub use crate::formatter::FormatterExtManual;
} }

View file

@ -0,0 +1,363 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::prelude::*;
use crate::Formatter;
use glib::{subclass::prelude::*, translate::*};
pub trait FormatterImpl: FormatterImplExt + ObjectImpl + Send + Sync {
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
self.parent_can_load_uri(uri)
}
fn load_from_uri(&self, timeline: &crate::Timeline, uri: &str) -> Result<(), glib::Error> {
self.parent_load_from_uri(timeline, uri)
}
fn save_to_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
overwrite: bool,
) -> Result<(), glib::Error> {
self.parent_save_to_uri(timeline, uri, overwrite)
}
}
pub trait FormatterImplExt: ObjectSubclass {
fn parent_can_load_uri(&self, uri: &str) -> Result<(), glib::Error>;
fn parent_load_from_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
) -> Result<(), glib::Error>;
fn parent_save_to_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
overwrite: bool,
) -> Result<(), glib::Error>;
}
impl<T: FormatterImpl> FormatterImplExt for T {
fn parent_can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
unsafe {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GESFormatterClass;
let f = (*parent_class)
.can_load_uri
.expect("Missing parent function `can_load_uri`");
let mut error = std::ptr::null_mut();
let res = f(
self.obj()
.unsafe_cast_ref::<crate::Formatter>()
.to_glib_none()
.0,
uri.to_glib_none().0,
&mut error,
);
if res == glib::ffi::GFALSE {
if error.is_null() {
Err(glib::Error::new(
gst::CoreError::Failed,
"Can load uri failed",
))
} else {
Err(from_glib_full(error))
}
} else {
Ok(())
}
}
}
fn parent_load_from_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
) -> Result<(), glib::Error> {
unsafe {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GESFormatterClass;
let f = (*parent_class)
.load_from_uri
.expect("Missing parent function `load_from_uri`");
let mut error = std::ptr::null_mut();
let res = f(
self.obj()
.unsafe_cast_ref::<crate::Formatter>()
.to_glib_none()
.0,
timeline
.unsafe_cast_ref::<crate::Timeline>()
.to_glib_none()
.0,
uri.to_glib_none().0,
&mut error,
);
if res == glib::ffi::GFALSE {
if error.is_null() {
Err(glib::Error::new(
gst::CoreError::Failed,
"Load from uri failed",
))
} else {
Err(from_glib_full(error))
}
} else {
Ok(())
}
}
}
fn parent_save_to_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
overwrite: bool,
) -> Result<(), glib::Error> {
unsafe {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GESFormatterClass;
let f = (*parent_class)
.save_to_uri
.expect("Missing parent function `save_to_uri`");
let mut error = std::ptr::null_mut();
let res = f(
self.obj()
.unsafe_cast_ref::<crate::Formatter>()
.to_glib_none()
.0,
timeline
.unsafe_cast_ref::<crate::Timeline>()
.to_glib_none()
.0,
uri.to_glib_none().0,
overwrite.into_glib(),
&mut error,
);
if res == glib::ffi::GFALSE {
if error.is_null() {
Err(glib::Error::new(
gst::CoreError::Failed,
"Save to uri failed",
))
} else {
Err(from_glib_full(error))
}
} else {
Ok(())
}
}
}
}
unsafe impl<T: FormatterImpl> IsSubclassable<T> for Formatter {
fn class_init(klass: &mut glib::Class<Self>) {
Self::parent_class_init::<T>(klass);
let klass = klass.as_mut();
klass.can_load_uri = Some(formatter_can_load_uri::<T>);
klass.load_from_uri = Some(formatter_load_from_uri::<T>);
klass.save_to_uri = Some(formatter_save_to_uri::<T>);
}
}
unsafe extern "C" fn formatter_can_load_uri<T: FormatterImpl>(
ptr: *mut ffi::GESFormatter,
uri: *const libc::c_char,
error: *mut *mut glib::ffi::GError,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
match imp.can_load_uri(glib::GString::from_glib_borrow(uri).as_str()) {
Err(err) => {
if !error.is_null() {
*error = err.into_glib_ptr();
}
glib::ffi::GFALSE
}
Ok(_) => glib::ffi::GTRUE,
}
}
unsafe extern "C" fn formatter_load_from_uri<T: FormatterImpl>(
ptr: *mut ffi::GESFormatter,
timeline: *mut ffi::GESTimeline,
uri: *const libc::c_char,
error: *mut *mut glib::ffi::GError,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let timeline = from_glib_borrow(timeline);
match imp.load_from_uri(&timeline, glib::GString::from_glib_borrow(uri).as_str()) {
Err(err) => {
if !error.is_null() {
*error = err.into_glib_ptr();
}
glib::ffi::GFALSE
}
Ok(_) => glib::ffi::GTRUE,
}
}
unsafe extern "C" fn formatter_save_to_uri<T: FormatterImpl>(
ptr: *mut ffi::GESFormatter,
timeline: *mut ffi::GESTimeline,
uri: *const libc::c_char,
overwrite: glib::ffi::gboolean,
error: *mut *mut glib::ffi::GError,
) -> glib::ffi::gboolean {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let timeline = from_glib_borrow(timeline);
match imp.save_to_uri(
&timeline,
glib::GString::from_glib_borrow(uri).as_str(),
from_glib(overwrite),
) {
Err(err) => {
if !error.is_null() {
*error = err.into_glib_ptr();
}
glib::ffi::GFALSE
}
Ok(_) => glib::ffi::GTRUE,
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::Formatter;
pub mod imp {
use super::*;
#[derive(Default)]
pub struct SimpleFormatter;
#[glib::object_subclass]
impl ObjectSubclass for SimpleFormatter {
const NAME: &'static str = "SimpleFormatter";
type Type = super::SimpleFormatter;
type ParentType = Formatter;
}
impl ObjectImpl for SimpleFormatter {}
impl FormatterImpl for SimpleFormatter {
fn can_load_uri(&self, uri: &str) -> Result<(), glib::Error> {
if uri.starts_with("ges:test") {
Ok(())
} else {
self.parent_can_load_uri(uri)
}
}
fn load_from_uri(
&self,
timeline: &crate::Timeline,
_uri: &str,
) -> Result<(), glib::Error> {
timeline.append_layer();
Ok(())
}
fn save_to_uri(
&self,
timeline: &crate::Timeline,
uri: &str,
_overwrite: bool,
) -> Result<(), glib::Error> {
unsafe { timeline.set_data("saved", uri.to_string()) };
Ok(())
}
}
}
glib::wrapper! {
pub struct SimpleFormatter(ObjectSubclass<imp::SimpleFormatter>) @extends Formatter, gst::Object;
}
impl SimpleFormatter {
pub fn new() -> Self {
glib::Object::builder().build()
}
}
impl Default for SimpleFormatter {
fn default() -> Self {
Self::new()
}
}
#[test]
fn test_formatter_subclass() {
crate::init().unwrap();
let formatter = SimpleFormatter::new();
formatter
.can_load_uri("ges:test:")
.expect("We can load anything...");
assert!(formatter.can_load_uri("nottest").is_err());
let timeline = crate::Timeline::new();
assert_eq!(timeline.layers().len(), 0);
#[allow(deprecated)]
formatter
.load_from_uri(&timeline, "test")
.expect("We can load anything...");
assert_eq!(timeline.layers().len(), 1);
unsafe {
assert_eq!(timeline.data::<Option<String>>("saved"), None);
}
#[allow(deprecated)]
formatter
.save_to_uri(&timeline, "test", false)
.expect("We can save anything...");
unsafe {
assert_eq!(
timeline.data::<String>("saved").unwrap().as_ref(),
&"test".to_string()
);
}
Formatter::register(
SimpleFormatter::static_type(),
"SimpleFormatter",
None,
None,
None,
1.0,
gst::Rank::Primary,
);
let proj = crate::Project::new(Some("ges:test:"));
let timeline = proj
.extract()
.unwrap()
.downcast::<crate::Timeline>()
.unwrap();
assert_eq!(timeline.layers().len(), 1);
let proj = crate::Project::new(Some("ges:notest:"));
assert!(proj.extract().is_err());
}
}

View file

@ -0,0 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
#![allow(clippy::cast_ptr_alignment)]
mod formatter;
pub mod prelude {
#[doc(hidden)]
pub use glib::subclass::prelude::*;
pub use gst::subclass::prelude::*;
pub use super::formatter::{FormatterImpl, FormatterImplExt};
}

View file

@ -7,22 +7,30 @@ libc = "0.2"
[dependencies.gio] [dependencies.gio]
package = "gio-sys" package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_pbutils] [dependencies.gst_pbutils]
package = "gstreamer-pbutils-sys" package = "gstreamer-pbutils-sys"
path = "../../gstreamer-pbutils/sys" path = "../../gstreamer-pbutils/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -49,7 +57,7 @@ license = "MIT"
name = "gstreamer-editing-services-sys" name = "gstreamer-editing-services-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-gl" name = "gstreamer-gl"
version = "0.20.0" version = "0.20.7"
authors = [ authors = [
"Sebastian Dröge <sebastian@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>",
"Víctor M. Jáquez L. <vjaquez@igalia.com>" "Víctor M. Jáquez L. <vjaquez@igalia.com>"
@ -20,11 +20,11 @@ rust-version = "1.64"
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
once_cell = "1.0" once_cell = "1.0"
ffi = { package = "gstreamer-gl-sys", path = "sys" } ffi = { package = "gstreamer-gl-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" } gst-video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20" }
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-gl-egl" name = "gstreamer-gl-egl"
version = "0.20.0" version = "0.20.7"
authors = [ authors = [
"Sebastian Dröge <sebastian@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>",
"Víctor M. Jáquez L. <vjaquez@igalia.com>" "Víctor M. Jáquez L. <vjaquez@igalia.com>"
@ -18,11 +18,11 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-gl-egl-sys", path = "sys" } ffi = { package = "gstreamer-gl-egl-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../../gstreamer" } gst = { package = "gstreamer", path = "../../gstreamer", version = "0.20" }
gst-gl = { package = "gstreamer-gl", path = "../" } gst-gl = { package = "gstreamer-gl", path = "../", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -9,7 +9,7 @@ license = "MIT"
name = "gstreamer-gl-egl-sys" name = "gstreamer-gl-egl-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"
@ -42,10 +42,13 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_gl] [dependencies.gst_gl]
package = "gstreamer-gl-sys" package = "gstreamer-gl-sys"
path = "../../sys" path = "../../sys"
version = "0.20"
[build-dependencies] [build-dependencies]
system-deps = "6" system-deps = "6"

View file

@ -7,22 +7,29 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dependencies.gst_video] [dependencies.gst_video]
package = "gstreamer-video-sys" package = "gstreamer-video-sys"
path = "../../gstreamer-video/sys" path = "../../gstreamer-video/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -49,7 +56,7 @@ license = "MIT"
name = "gstreamer-gl-sys" name = "gstreamer-gl-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-gl-wayland" name = "gstreamer-gl-wayland"
version = "0.20.0" version = "0.20.7"
authors = [ authors = [
"Sebastian Dröge <sebastian@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>",
"Víctor M. Jáquez L. <vjaquez@igalia.com>" "Víctor M. Jáquez L. <vjaquez@igalia.com>"
@ -18,11 +18,11 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-gl-wayland-sys", path = "sys" } ffi = { package = "gstreamer-gl-wayland-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../../gstreamer" } gst = { package = "gstreamer", path = "../../gstreamer", version = "0.20" }
gst-gl = { package = "gstreamer-gl", path = "../" } gst-gl = { package = "gstreamer-gl", path = "../", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -9,7 +9,7 @@ license = "MIT"
name = "gstreamer-gl-wayland-sys" name = "gstreamer-gl-wayland-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"
@ -42,10 +42,13 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_gl] [dependencies.gst_gl]
package = "gstreamer-gl-sys" package = "gstreamer-gl-sys"
path = "../../sys" path = "../../sys"
version = "0.20"
[build-dependencies] [build-dependencies]
system-deps = "6" system-deps = "6"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-gl-x11" name = "gstreamer-gl-x11"
version = "0.20.0" version = "0.20.7"
authors = [ authors = [
"Sebastian Dröge <sebastian@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>",
"Víctor M. Jáquez L. <vjaquez@igalia.com>" "Víctor M. Jáquez L. <vjaquez@igalia.com>"
@ -18,11 +18,11 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-gl-x11-sys", path = "sys" } ffi = { package = "gstreamer-gl-x11-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../../gstreamer" } gst = { package = "gstreamer", path = "../../gstreamer", version = "0.20" }
gst-gl = { package = "gstreamer-gl", path = "../" } gst-gl = { package = "gstreamer-gl", path = "../", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -9,7 +9,7 @@ license = "MIT"
name = "gstreamer-gl-x11-sys" name = "gstreamer-gl-x11-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"
@ -42,10 +42,13 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_gl] [dependencies.gst_gl]
package = "gstreamer-gl-sys" package = "gstreamer-gl-sys"
path = "../../sys" path = "../../sys"
version = "0.20"
[build-dependencies] [build-dependencies]
system-deps = "6" system-deps = "6"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-mpegts" name = "gstreamer-mpegts"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>", "Rafael Caricio <rafael@caricio.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>", "Rafael Caricio <rafael@caricio.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer MpegTs library" description = "Rust bindings for GStreamer MpegTs library"
@ -14,9 +14,9 @@ edition = "2021"
rust-version = "1.64" rust-version = "1.64"
[dependencies] [dependencies]
ffi = { package = "gstreamer-mpegts-sys", path = "sys" } ffi = { package = "gstreamer-mpegts-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -9,7 +9,7 @@ license = "MIT"
name = "gstreamer-mpegts-sys" name = "gstreamer-mpegts-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"
@ -44,14 +44,18 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-net" name = "gstreamer-net"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Net library" description = "Rust bindings for GStreamer Net library"
@ -14,10 +14,10 @@ edition = "2021"
rust-version = "1.64" rust-version = "1.64"
[dependencies] [dependencies]
ffi = { package = "gstreamer-net-sys", path = "sys" } ffi = { package = "gstreamer-net-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gio = { git = "https://github.com/gtk-rs/gtk-rs-core" } gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -7,14 +7,19 @@ libc = "0.2"
[dependencies.gio] [dependencies.gio]
package = "gio-sys" package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -41,7 +46,7 @@ license = "MIT"
name = "gstreamer-net-sys" name = "gstreamer-net-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-pbutils" name = "gstreamer-pbutils"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Base Utils library" description = "Rust bindings for GStreamer Base Utils library"
@ -16,11 +16,11 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-pbutils-sys", path = "sys" } ffi = { package = "gstreamer-pbutils-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" } gst-video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20" }
gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio" } gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio", version = "0.20" }
thiserror = "1.0" thiserror = "1.0"
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }

View file

@ -279,6 +279,10 @@ final_type = false
name = "list_free" name = "list_free"
ignore = true ignore = true
[[object.function]]
name = "get_stream_id"
manual = true
[[object]] [[object]]
name = "GstPbutils.DiscovererSubtitleInfo" name = "GstPbutils.DiscovererSubtitleInfo"
status = "generate" status = "generate"

View file

@ -40,10 +40,6 @@ pub trait DiscovererStreamInfoExt: 'static {
#[must_use] #[must_use]
fn previous(&self) -> Option<DiscovererStreamInfo>; fn previous(&self) -> Option<DiscovererStreamInfo>;
#[doc(alias = "gst_discoverer_stream_info_get_stream_id")]
#[doc(alias = "get_stream_id")]
fn stream_id(&self) -> glib::GString;
#[cfg(any(feature = "v1_20", feature = "dox"))] #[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_discoverer_stream_info_get_stream_number")] #[doc(alias = "gst_discoverer_stream_info_get_stream_number")]
@ -96,14 +92,6 @@ impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
} }
} }
fn stream_id(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::gst_discoverer_stream_info_get_stream_id(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))] #[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn stream_number(&self) -> i32 { fn stream_number(&self) -> i32 {

View file

@ -1,6 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{boxed::Box as Box_, mem::transmute}; use std::{boxed::Box as Box_, fmt, mem::transmute};
use glib::{ use glib::{
prelude::*, prelude::*,
@ -8,11 +8,11 @@ use glib::{
translate::*, translate::*,
}; };
use crate::auto::Discoverer; use crate::{auto::Discoverer, DiscovererInfo};
impl Discoverer { impl Discoverer {
pub fn set_timeout(&self, timeout: gst::ClockTime) { pub fn set_timeout(&self, timeout: gst::ClockTime) {
self.set_property("timeout", &timeout); self.set_property("timeout", timeout);
} }
pub fn timeout(&self) -> gst::ClockTime { pub fn timeout(&self) -> gst::ClockTime {
@ -48,3 +48,75 @@ unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'sta
let f: &F = &*(f as *const F); let f: &F = &*(f as *const F);
f(Discoverer::from_glib_borrow(this).unsafe_cast_ref()) f(Discoverer::from_glib_borrow(this).unsafe_cast_ref())
} }
pub struct DebugInfo<'a>(&'a DiscovererInfo);
impl<'a> fmt::Debug for DebugInfo<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let stream_info = self.0.stream_info();
let stream_list = self.0.stream_list();
let container_streams = self.0.container_streams();
let audio_streams = self.0.audio_streams();
let video_streams = self.0.video_streams();
let subtitle_streams = self.0.subtitle_streams();
f.debug_struct("DiscovererInfo")
.field("uri", &self.0.uri())
.field("result", &self.0.result())
.field("duration", &self.0.duration())
.field("is-live", &self.0.is_live())
.field("is-seekable", &self.0.is_seekable())
.field(
"stream-info",
&stream_info.as_ref().map(|info| info.debug()),
)
.field(
"stream-list",
&stream_list
.iter()
.map(|info| info.debug())
.collect::<Vec<_>>(),
)
.field(
"container-streams",
&container_streams
.iter()
.map(|info| info.debug())
.collect::<Vec<_>>(),
)
.field(
"audio-streams",
&audio_streams
.iter()
.map(|info| info.debug())
.collect::<Vec<_>>(),
)
.field(
"video-streams",
&video_streams
.iter()
.map(|info| info.debug())
.collect::<Vec<_>>(),
)
.field(
"subtitle-streams",
&subtitle_streams
.iter()
.map(|info| info.debug())
.collect::<Vec<_>>(),
)
.field("toc", &self.0.toc())
.field("misc", &self.0.misc())
.field(
"missing-elements-installer-details",
&self.0.missing_elements_installer_details(),
)
.finish()
}
}
impl DiscovererInfo {
pub fn debug(&self) -> DebugInfo {
DebugInfo(self)
}
}

View file

@ -0,0 +1,32 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use std::fmt;
use glib::Cast;
use crate::{DiscovererAudioInfo, DiscovererStreamInfo};
pub struct Debug<'a>(&'a DiscovererAudioInfo);
impl<'a> fmt::Debug for Debug<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let info = self.0.upcast_ref::<DiscovererStreamInfo>();
f.debug_struct("DiscovererAudioInfo")
.field("channels", &self.0.channels())
.field("sample-rate", &self.0.sample_rate())
.field("depth", &self.0.depth())
.field("bitrate", &self.0.bitrate())
.field("max-bitrate", &self.0.max_bitrate())
.field("channel-mask", &self.0.channel_mask())
.field("language", &self.0.language())
.field("stream", &info.debug())
.finish()
}
}
impl DiscovererAudioInfo {
pub fn debug(&self) -> Debug {
Debug(self)
}
}

View file

@ -0,0 +1,32 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use std::fmt;
use crate::{prelude::*, DiscovererContainerInfo};
pub struct Debug<'a>(&'a DiscovererContainerInfo);
impl<'a> fmt::Debug for Debug<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let streams = self.0.streams();
let mut d = f.debug_struct("DiscovererContainerInfo");
d.field("tags", &self.0.tags()).field(
"streams",
&streams.iter().map(|info| info.debug()).collect::<Vec<_>>(),
);
#[cfg(feature = "v1_20")]
d.field("stream-number", &self.0.stream_number());
#[cfg(feature = "v1_20")]
d.field("tags", &self.0.tags());
d.finish()
}
}
impl DiscovererContainerInfo {
pub fn debug(&self) -> Debug {
Debug(self)
}
}

View file

@ -1,4 +1,7 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::fmt;
use glib::translate::*;
use crate::{prelude::*, DiscovererStreamInfo}; use crate::{prelude::*, DiscovererStreamInfo};
@ -28,20 +31,65 @@ impl Iterator for Iter {
} }
} }
impl DiscovererStreamInfo { impl std::iter::FusedIterator for Iter {}
pub fn next_iter(&self) -> Iter {
pub trait DiscovererStreamInfoExtManual: 'static {
fn next_iter(&self) -> Iter;
fn previous_iter(&self) -> Iter;
#[doc(alias = "gst_discoverer_stream_info_get_stream_id")]
#[doc(alias = "get_stream_id")]
fn stream_id(&self) -> glib::GString;
}
impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExtManual for O {
fn next_iter(&self) -> Iter {
Iter { Iter {
stream_info: self.next(), stream_info: self.next(),
direction_forward: true, direction_forward: true,
} }
} }
pub fn previous_iter(&self) -> Iter { fn previous_iter(&self) -> Iter {
Iter { Iter {
stream_info: self.previous(), stream_info: self.previous(),
direction_forward: false, direction_forward: false,
} }
} }
fn stream_id(&self) -> glib::GString {
unsafe {
let ptr = ffi::gst_discoverer_stream_info_get_stream_id(self.as_ref().to_glib_none().0);
if ptr.is_null() {
glib::GString::new()
} else {
from_glib_none(ptr)
}
}
}
} }
impl std::iter::FusedIterator for Iter {} pub struct Debug<'a>(&'a DiscovererStreamInfo);
impl<'a> fmt::Debug for Debug<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut d = f.debug_struct("DiscovererStreamInfo");
d.field("caps", &self.0.caps())
.field("stream-id", &self.0.stream_id())
.field("misc", &self.0.misc())
.field("stream-type-nick", &self.0.stream_type_nick())
.field("tags", &self.0.tags())
.field("toc", &self.0.toc());
#[cfg(feature = "v1_20")]
d.field("stream-number", &self.0.stream_number());
d.finish()
}
}
impl DiscovererStreamInfo {
pub fn debug(&self) -> Debug {
Debug(self)
}
}

View file

@ -0,0 +1,26 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use std::fmt;
use glib::Cast;
use crate::{DiscovererStreamInfo, DiscovererSubtitleInfo};
pub struct Debug<'a>(&'a DiscovererSubtitleInfo);
impl<'a> fmt::Debug for Debug<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let info = self.0.upcast_ref::<DiscovererStreamInfo>();
f.debug_struct("DiscovererSubtitleInfo")
.field("language", &self.0.language())
.field("stream", &info.debug())
.finish()
}
}
impl DiscovererSubtitleInfo {
pub fn debug(&self) -> Debug {
Debug(self)
}
}

View file

@ -1,8 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use glib::translate::*; use std::fmt;
use crate::DiscovererVideoInfo; use glib::{translate::*, Cast};
use crate::{DiscovererStreamInfo, DiscovererVideoInfo};
impl DiscovererVideoInfo { impl DiscovererVideoInfo {
#[doc(alias = "get_framerate")] #[doc(alias = "get_framerate")]
@ -28,4 +30,27 @@ impl DiscovererVideoInfo {
) )
} }
} }
pub fn debug(&self) -> Debug {
Debug(self)
}
}
pub struct Debug<'a>(&'a DiscovererVideoInfo);
impl<'a> fmt::Debug for Debug<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let info = self.0.upcast_ref::<DiscovererStreamInfo>();
f.debug_struct("DiscovererVideoInfo")
.field("width", &self.0.width())
.field("height", &self.0.height())
.field("depth", &self.0.depth())
.field("bitrate", &self.0.bitrate())
.field("max-bitrate", &self.0.max_bitrate())
.field("is-image", &self.0.is_image())
.field("is-interlaced", &self.0.is_interlaced())
.field("stream", &info.debug())
.finish()
}
} }

View file

@ -41,7 +41,10 @@ mod flag_serde;
mod discoverer; mod discoverer;
pub use crate::discoverer::*; pub use crate::discoverer::*;
mod discoverer_audio_info;
mod discoverer_container_info;
pub mod discoverer_stream_info; pub mod discoverer_stream_info;
mod discoverer_subtitle_info;
mod discoverer_video_info; mod discoverer_video_info;
pub mod encoding_profile; pub mod encoding_profile;
@ -62,6 +65,7 @@ pub mod prelude {
pub use crate::{ pub use crate::{
audio_visualizer::*, audio_visualizer::*,
auto::traits::*, auto::traits::*,
discoverer_stream_info::DiscovererStreamInfoExtManual,
encoding_profile::{ encoding_profile::{
EncodingProfileBuilder, EncodingProfileExtManual, EncodingProfileHasRestrictionGetter, EncodingProfileBuilder, EncodingProfileExtManual, EncodingProfileHasRestrictionGetter,
}, },

View file

@ -7,22 +7,29 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_audio] [dependencies.gst_audio]
package = "gstreamer-audio-sys" package = "gstreamer-audio-sys"
path = "../../gstreamer-audio/sys" path = "../../gstreamer-audio/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dependencies.gst_video] [dependencies.gst_video]
package = "gstreamer-video-sys" package = "gstreamer-video-sys"
path = "../../gstreamer-video/sys" path = "../../gstreamer-video/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -49,7 +56,7 @@ license = "MIT"
name = "gstreamer-pbutils-sys" name = "gstreamer-pbutils-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-play" name = "gstreamer-play"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Play library" description = "Rust bindings for GStreamer Play library"
@ -16,10 +16,10 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-play-sys", path = "sys" } ffi = { package = "gstreamer-play-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer", features = ["v1_20"] } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20", features = ["v1_20"] }
gst-video = { package = "gstreamer-video", path = "../gstreamer-video", features = ["v1_20"] } gst-video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20", features = ["v1_20"] }
once_cell = "1.0" once_cell = "1.0"
[dev-dependencies] [dev-dependencies]

View file

@ -37,3 +37,9 @@ impl Play {
} }
} }
} }
impl Default for Play {
fn default() -> Self {
Self::new(None::<crate::PlayVideoRenderer>)
}
}

View file

@ -7,18 +7,24 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dependencies.gst_video] [dependencies.gst_video]
package = "gstreamer-video-sys" package = "gstreamer-video-sys"
path = "../../gstreamer-video/sys" path = "../../gstreamer-video/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -42,7 +48,7 @@ license = "MIT"
name = "gstreamer-play-sys" name = "gstreamer-play-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-player" name = "gstreamer-player"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Player library" description = "Rust bindings for GStreamer Player library"
@ -16,10 +16,10 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-player-sys", path = "sys" } ffi = { package = "gstreamer-player-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" } gst-video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20" }
once_cell = "1.0" once_cell = "1.0"
[dev-dependencies] [dev-dependencies]

View file

@ -98,6 +98,15 @@ impl Player {
} }
} }
impl Default for Player {
fn default() -> Self {
Self::new(
None::<crate::PlayerVideoRenderer>,
None::<crate::PlayerSignalDispatcher>,
)
}
}
unsafe extern "C" fn duration_changed_trampoline< unsafe extern "C" fn duration_changed_trampoline<
F: Fn(&Player, Option<gst::ClockTime>) + Send + 'static, F: Fn(&Player, Option<gst::ClockTime>) + Send + 'static,
>( >(

View file

@ -7,18 +7,24 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dependencies.gst_video] [dependencies.gst_video]
package = "gstreamer-video-sys" package = "gstreamer-video-sys"
path = "../../gstreamer-video/sys" path = "../../gstreamer-video/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -45,7 +51,7 @@ license = "MIT"
name = "gstreamer-player-sys" name = "gstreamer-player-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-rtp" name = "gstreamer-rtp"
version = "0.20.0" version = "0.20.7"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Rtp library" description = "Rust bindings for GStreamer Rtp library"
@ -17,9 +17,9 @@ rust-version = "1.64"
bitflags = "1.0" bitflags = "1.0"
once_cell = "1.0" once_cell = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-rtp-sys", path = "sys" } ffi = { package = "gstreamer-rtp-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -7,14 +7,18 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -41,7 +45,7 @@ license = "MIT"
name = "gstreamer-rtp-sys" name = "gstreamer-rtp-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-rtsp-server" name = "gstreamer-rtsp-server"
version = "0.20.0" version = "0.20.7"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer RTSP Server library" description = "Rust bindings for GStreamer RTSP Server library"
@ -17,13 +17,13 @@ rust-version = "1.64"
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
once_cell = "1.0" once_cell = "1.0"
ffi = { package = "gstreamer-rtsp-server-sys", path = "sys" } ffi = { package = "gstreamer-rtsp-server-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } 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" } gio = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp" } gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", version = "0.20" }
gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp" } gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", version = "0.20" }
gst-net = { package = "gstreamer-net", path = "../gstreamer-net" } gst-net = { package = "gstreamer-net", path = "../gstreamer-net", version = "0.20" }
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -1,11 +1,16 @@
// Take a look at the license at the top of the repository in the LICENSE file. // Take a look at the license at the top of the repository in the LICENSE file.
use std::{marker::PhantomData, ptr}; use std::{
marker::PhantomData,
ptr::{self, addr_of},
};
use glib::translate::*; use glib::translate::*;
use gst_rtsp::RTSPUrl;
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]
#[doc(alias = "GstRTSPContext")] #[doc(alias = "GstRTSPContext")]
#[repr(transparent)]
pub struct RTSPContext(ptr::NonNull<ffi::GstRTSPContext>); pub struct RTSPContext(ptr::NonNull<ffi::GstRTSPContext>);
impl RTSPContext { impl RTSPContext {
@ -22,7 +27,22 @@ impl RTSPContext {
} }
} }
// TODO: Add various getters for all the contained fields as needed #[inline]
pub fn uri(&self) -> Option<&RTSPUrl> {
unsafe {
let ptr = self.0.as_ptr();
if (*ptr).uri.is_null() {
None
} else {
let uri = RTSPUrl::from_glib_ptr_borrow(
addr_of!((*ptr).uri) as *const *const gst_rtsp::ffi::GstRTSPUrl
);
Some(uri)
}
}
}
// TODO: Add additional getters for all the contained fields as needed
} }
#[doc(hidden)] #[doc(hidden)]

View file

@ -736,6 +736,236 @@ unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
fn class_init(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
Self::parent_class_init::<T>(klass); Self::parent_class_init::<T>(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
// There was unintentional ABI breakage in 1.18 so let's work around that
// for now by casting to the old struct layout.
#[cfg(not(feature = "v1_18"))]
{
if gst::version() < (1, 18, 0, 0) {
#[derive(Copy, Clone)]
#[repr(C)]
pub struct CompatClass {
pub parent_class: glib::gobject_ffi::GObjectClass,
pub create_sdp: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPMedia,
)
-> *mut gst_sdp::ffi::GstSDPMessage,
>,
pub configure_client_media: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPMedia,
*mut ffi::GstRTSPStream,
*mut ffi::GstRTSPContext,
) -> glib::ffi::gboolean,
>,
pub configure_client_transport: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
*mut gst_rtsp::ffi::GstRTSPTransport,
) -> glib::ffi::gboolean,
>,
pub params_set: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPResult,
>,
pub params_get: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPResult,
>,
pub make_path_from_uri: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*const gst_rtsp::ffi::GstRTSPUrl,
) -> *mut libc::c_char,
>,
pub closed: Option<unsafe extern "C" fn(*mut ffi::GstRTSPClient)>,
pub new_session: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPSession),
>,
pub options_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub describe_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub setup_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub play_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub pause_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub teardown_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub set_parameter_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub get_parameter_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub handle_response: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub tunnel_http_response: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut gst_rtsp::ffi::GstRTSPMessage,
*mut gst_rtsp::ffi::GstRTSPMessage,
),
>,
pub send_message: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
*mut gst_rtsp::ffi::GstRTSPMessage,
),
>,
pub handle_sdp: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
*mut ffi::GstRTSPMedia,
*mut gst_sdp::ffi::GstSDPMessage,
) -> glib::ffi::gboolean,
>,
pub announce_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub record_request: Option<
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
>,
pub check_requirements: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
*mut *mut libc::c_char,
) -> *mut libc::c_char,
>,
pub pre_options_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_describe_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_setup_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_play_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_pause_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_teardown_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_set_parameter_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_get_parameter_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_announce_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub pre_record_request: Option<
unsafe extern "C" fn(
*mut ffi::GstRTSPClient,
*mut ffi::GstRTSPContext,
)
-> gst_rtsp::ffi::GstRTSPStatusCode,
>,
pub _gst_reserved: [glib::ffi::gpointer; 4],
}
let klass = unsafe {
std::mem::transmute::<&mut ffi::GstRTSPClientClass, &mut CompatClass>(klass)
};
klass.create_sdp = Some(client_create_sdp::<T>);
klass.configure_client_media = Some(client_configure_client_media::<T>);
klass.params_set = Some(client_params_set::<T>);
klass.params_get = Some(client_params_get::<T>);
klass.make_path_from_uri = Some(client_make_path_from_uri::<T>);
klass.closed = Some(client_closed::<T>);
klass.new_session = Some(client_new_session::<T>);
klass.options_request = Some(client_options_request::<T>);
klass.describe_request = Some(client_describe_request::<T>);
klass.setup_request = Some(client_setup_request::<T>);
klass.play_request = Some(client_play_request::<T>);
klass.pause_request = Some(client_pause_request::<T>);
klass.teardown_request = Some(client_teardown_request::<T>);
klass.set_parameter_request = Some(client_set_parameter_request::<T>);
klass.get_parameter_request = Some(client_get_parameter_request::<T>);
klass.announce_request = Some(client_announce_request::<T>);
klass.record_request = Some(client_record_request::<T>);
klass.handle_response = Some(client_handle_response::<T>);
klass.handle_sdp = Some(client_handle_sdp::<T>);
klass.check_requirements = Some(client_check_requirements::<T>);
klass.pre_options_request = Some(client_pre_options_request::<T>);
klass.pre_describe_request = Some(client_pre_describe_request::<T>);
klass.pre_setup_request = Some(client_pre_setup_request::<T>);
klass.pre_play_request = Some(client_pre_play_request::<T>);
klass.pre_pause_request = Some(client_pre_pause_request::<T>);
klass.pre_teardown_request = Some(client_pre_teardown_request::<T>);
klass.pre_set_parameter_request = Some(client_pre_set_parameter_request::<T>);
klass.pre_get_parameter_request = Some(client_pre_get_parameter_request::<T>);
klass.pre_announce_request = Some(client_pre_announce_request::<T>);
klass.pre_record_request = Some(client_pre_record_request::<T>);
return;
}
}
klass.create_sdp = Some(client_create_sdp::<T>); klass.create_sdp = Some(client_create_sdp::<T>);
klass.configure_client_media = Some(client_configure_client_media::<T>); klass.configure_client_media = Some(client_configure_client_media::<T>);
klass.params_set = Some(client_params_set::<T>); klass.params_set = Some(client_params_set::<T>);

View file

@ -7,30 +7,40 @@ libc = "0.2"
[dependencies.gio] [dependencies.gio]
package = "gio-sys" package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_net] [dependencies.gst_net]
package = "gstreamer-net-sys" package = "gstreamer-net-sys"
path = "../../gstreamer-net/sys" path = "../../gstreamer-net/sys"
version = "0.20"
[dependencies.gst_rtsp] [dependencies.gst_rtsp]
package = "gstreamer-rtsp-sys" package = "gstreamer-rtsp-sys"
path = "../../gstreamer-rtsp/sys" path = "../../gstreamer-rtsp/sys"
version = "0.20"
[dependencies.gst_sdp] [dependencies.gst_sdp]
package = "gstreamer-sdp-sys" package = "gstreamer-sdp-sys"
path = "../../gstreamer-sdp/sys" path = "../../gstreamer-sdp/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -57,7 +67,7 @@ license = "MIT"
name = "gstreamer-rtsp-server-sys" name = "gstreamer-rtsp-server-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-rtsp" name = "gstreamer-rtsp"
version = "0.20.0" version = "0.20.7"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Rtsp library" description = "Rust bindings for GStreamer Rtsp library"
@ -16,10 +16,10 @@ rust-version = "1.64"
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-rtsp-sys", path = "sys" } ffi = { package = "gstreamer-rtsp-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp" } gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", version = "0.20" }
serde = { version = "1.0", optional = true } serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]

View file

@ -7,22 +7,30 @@ libc = "0.2"
[dependencies.gio] [dependencies.gio]
package = "gio-sys" package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_sdp] [dependencies.gst_sdp]
package = "gstreamer-sdp-sys" package = "gstreamer-sdp-sys"
path = "../../gstreamer-sdp/sys" path = "../../gstreamer-sdp/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -49,7 +57,7 @@ license = "MIT"
name = "gstreamer-rtsp-sys" name = "gstreamer-rtsp-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-sdp" name = "gstreamer-sdp"
version = "0.20.0" version = "0.20.7"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"] authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Sdp library" description = "Rust bindings for GStreamer Sdp library"
@ -14,9 +14,9 @@ edition = "2021"
rust-version = "1.64" rust-version = "1.64"
[dependencies] [dependencies]
ffi = { package = "gstreamer-sdp-sys", path = "sys" } ffi = { package = "gstreamer-sdp-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -7,10 +7,13 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -37,7 +40,7 @@ license = "MIT"
name = "gstreamer-sdp-sys" name = "gstreamer-sdp-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -7,14 +7,19 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -41,7 +46,7 @@ license = "MIT"
name = "gstreamer-tag-sys" name = "gstreamer-tag-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-utils" name = "gstreamer-utils"
version = "0.20.0" version = "0.20.7"
authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Thibault Saunier <tsaunier@igalia.com>"] authors = ["Mathieu Duponchelle <mathieu@centricular.com>", "Thibault Saunier <tsaunier@igalia.com>"]
categories = ["multimedia"] categories = ["multimedia"]
description = "Exposes an object to build several Gst pipeline with one producer and several consumer" description = "Exposes an object to build several Gst pipeline with one producer and several consumer"
@ -16,9 +16,9 @@ rust-version = "1.64"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
gst = { package = "gstreamer", path = "../gstreamer", features = ["v1_20"] } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20", features = ["v1_20"] }
gst_app = { package = "gstreamer-app", path = "../gstreamer-app", features = ["v1_20"] } gst_app = { package = "gstreamer-app", path = "../gstreamer-app", version = "0.20", features = ["v1_20"] }
gst_video = { package = "gstreamer-video", path = "../gstreamer-video", features = ["v1_20"] } gst_video = { package = "gstreamer-video", path = "../gstreamer-video", version = "0.20", features = ["v1_20"] }
once_cell = "1" once_cell = "1"
thiserror = "1" thiserror = "1"

View file

@ -235,7 +235,7 @@ impl StreamProducer {
} }
} }
/// configure if EOS from appsrc should be forwarded to all the consumers /// configure if EOS from appsrc should be forwarded to all the consumers (default: `true`)
pub fn set_forward_eos(&self, forward_eos: bool) { pub fn set_forward_eos(&self, forward_eos: bool) {
self.consumers.lock().unwrap().forward_eos = forward_eos; self.consumers.lock().unwrap().forward_eos = forward_eos;
} }

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-validate" name = "gstreamer-validate"
version = "0.20.0" version = "0.20.7"
authors = ["Philippe Normand <philn@igalia.com>"] authors = ["Philippe Normand <philn@igalia.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer WebRTC library" description = "Rust bindings for GStreamer WebRTC library"
@ -15,9 +15,9 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-validate-sys", path = "sys" } ffi = { package = "gstreamer-validate-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer", features = ["v1_22"] } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20", features = ["v1_22"] }
bitflags = "1.0" bitflags = "1.0"
[dev-dependencies] [dev-dependencies]

View file

@ -9,7 +9,7 @@ license = "MIT"
name = "gstreamer-validate-sys" name = "gstreamer-validate-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.57" rust-version = "1.57"
@ -32,18 +32,25 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gio] [dependencies.gio]
package = "gio-sys" package = "gio-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-video" name = "gstreamer-video"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer Video library" description = "Rust bindings for GStreamer Video library"
@ -17,16 +17,16 @@ rust-version = "1.64"
bitflags = "1.0" bitflags = "1.0"
libc = "0.2" libc = "0.2"
cfg-if = "1.0" cfg-if = "1.0"
ffi = { package = "gstreamer-video-sys", path = "sys" } ffi = { package = "gstreamer-video-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" } gst-base = { package = "gstreamer-base", path = "../gstreamer-base", version = "0.20" }
once_cell = "1.0" once_cell = "1.0"
futures-channel = "0.3" futures-channel = "0.3"
serde = { version = "1.0", optional = true, features = ["derive"] } serde = { version = "1.0", optional = true, features = ["derive"] }
[dev-dependencies] [dev-dependencies]
itertools = "0.10" itertools = "0.11"
serde_json = "1.0" serde_json = "1.0"
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -10,7 +10,18 @@ pub struct VideoCapsBuilder<T> {
} }
impl VideoCapsBuilder<gst::caps::NoFeature> { impl VideoCapsBuilder<gst::caps::NoFeature> {
// rustdoc-stripper-ignore-next
/// Constructs an `VideoCapsBuilder` for the "video/x-raw" encoding.
///
/// If left unchanged, the resulting `Caps` will be initialized with:
/// - "video/x-raw" encoding.
/// - all available formats.
/// - maximum width range.
/// - maximum height range.
///
/// Use [`VideoCapsBuilder::for_encoding`] to specify another encoding.
pub fn new() -> Self { pub fn new() -> Self {
assert_initialized_main_thread!();
let builder = Caps::builder(glib::gstr!("video/x-raw")); let builder = Caps::builder(glib::gstr!("video/x-raw"));
let builder = VideoCapsBuilder { builder }; let builder = VideoCapsBuilder { builder };
builder builder
@ -20,6 +31,18 @@ impl VideoCapsBuilder<gst::caps::NoFeature> {
.framerate_range(..) .framerate_range(..)
} }
// rustdoc-stripper-ignore-next
/// Constructs an `VideoCapsBuilder` for the specified encoding.
///
/// The resulting `Caps` will use the `encoding` argument as name
/// and will not contain any additional fields unless explicitly added.
pub fn for_encoding(encoding: impl IntoGStr) -> Self {
assert_initialized_main_thread!();
VideoCapsBuilder {
builder: Caps::builder(encoding),
}
}
pub fn any_features(self) -> VideoCapsBuilder<gst::caps::HasFeatures> { pub fn any_features(self) -> VideoCapsBuilder<gst::caps::HasFeatures> {
VideoCapsBuilder { VideoCapsBuilder {
builder: self.builder.any_features(), builder: self.builder.any_features(),
@ -283,41 +306,60 @@ fn next_fraction(fraction: gst::Fraction) -> gst::Fraction {
gst::Fraction::new(new_num, new_den) gst::Fraction::new(new_num, new_den)
} }
#[test] #[cfg(test)]
fn test_0_1_fraction() { mod tests {
gst::init().unwrap(); use super::{next_fraction, previous_fraction, VideoCapsBuilder};
let zero_over_one = gst::Fraction::new(0, 1);
let prev = previous_fraction(zero_over_one);
assert_eq!(prev.numer(), -1);
assert_eq!(prev.denom(), i32::MAX);
let next = next_fraction(zero_over_one);
assert_eq!(next.numer(), 1);
assert_eq!(next.denom(), i32::MAX);
}
#[test] #[test]
fn test_25_1() { fn default_encoding() {
gst::init().unwrap(); gst::init().unwrap();
let twentyfive = gst::Fraction::new(25, 1); let caps = VideoCapsBuilder::new().build();
let next = next_fraction(twentyfive); assert_eq!(caps.structure(0).unwrap().name(), "video/x-raw");
//25.000000011641532 }
assert_eq!(next.numer(), 2147483626);
assert_eq!(next.denom(), 85899345); #[test]
let prev = previous_fraction(twentyfive); fn explicit_encoding() {
//24.999999988358468 gst::init().unwrap();
assert_eq!(prev.numer(), 2147483624); let caps = VideoCapsBuilder::for_encoding("video/mpeg").build();
assert_eq!(prev.denom(), 85899345); assert_eq!(caps.structure(0).unwrap().name(), "video/mpeg");
} }
#[test]
fn test_1_25() { #[test]
gst::init().unwrap(); fn test_0_1_fraction() {
let twentyfive = gst::Fraction::new(1, 25); gst::init().unwrap();
let next = next_fraction(twentyfive); let zero_over_one = gst::Fraction::new(0, 1);
//0.040000000018626 let prev = previous_fraction(zero_over_one);
assert_eq!(next.numer(), 85899345); assert_eq!(prev.numer(), -1);
assert_eq!(next.denom(), 2147483624); assert_eq!(prev.denom(), i32::MAX);
let prev = previous_fraction(twentyfive); let next = next_fraction(zero_over_one);
//0.039999999981374 assert_eq!(next.numer(), 1);
assert_eq!(prev.numer(), 85899345); assert_eq!(next.denom(), i32::MAX);
assert_eq!(prev.denom(), 2147483626); }
#[test]
fn test_25_1() {
gst::init().unwrap();
let twentyfive = gst::Fraction::new(25, 1);
let next = next_fraction(twentyfive);
//25.000000011641532
assert_eq!(next.numer(), 2147483626);
assert_eq!(next.denom(), 85899345);
let prev = previous_fraction(twentyfive);
//24.999999988358468
assert_eq!(prev.numer(), 2147483624);
assert_eq!(prev.denom(), 85899345);
}
#[test]
fn test_1_25() {
gst::init().unwrap();
let twentyfive = gst::Fraction::new(1, 25);
let next = next_fraction(twentyfive);
//0.040000000018626
assert_eq!(next.numer(), 85899345);
assert_eq!(next.denom(), 2147483624);
let prev = previous_fraction(twentyfive);
//0.039999999981374
assert_eq!(prev.numer(), 85899345);
assert_eq!(prev.denom(), 2147483626);
}
} }

View file

@ -502,9 +502,7 @@ impl fmt::Debug for VideoFormatInfo {
{ {
fmt.field( fmt.field(
"tile-info", "tile-info",
&(0..self.n_planes()) &(0..self.n_planes()).map(|plane| self.tile_info(plane)),
.into_iter()
.map(|plane| self.tile_info(plane)),
); );
} }

View file

@ -10,7 +10,6 @@ pub enum Writable {}
pub struct VideoFrame<T> { pub struct VideoFrame<T> {
frame: ffi::GstVideoFrame, frame: ffi::GstVideoFrame,
buffer: gst::Buffer, buffer: gst::Buffer,
info: crate::VideoInfo,
phantom: PhantomData<T>, phantom: PhantomData<T>,
} }
@ -20,10 +19,10 @@ unsafe impl<T> Sync for VideoFrame<T> {}
impl<T> fmt::Debug for VideoFrame<T> { impl<T> fmt::Debug for VideoFrame<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoFrame") f.debug_struct("VideoFrame")
.field("frame", &self.frame) .field("flags", &self.flags())
.field("buffer", &self.buffer) .field("id", &self.id())
.field("info", &self.info) .field("buffer", &self.buffer())
.field("phantom", &self.phantom) .field("info", &self.info())
.finish() .finish()
} }
} }
@ -31,7 +30,7 @@ impl<T> fmt::Debug for VideoFrame<T> {
impl<T> VideoFrame<T> { impl<T> VideoFrame<T> {
#[inline] #[inline]
pub fn info(&self) -> &crate::VideoInfo { pub fn info(&self) -> &crate::VideoInfo {
&self.info unsafe { &*(&self.frame.info as *const ffi::GstVideoInfo as *const crate::VideoInfo) }
} }
#[inline] #[inline]
@ -46,8 +45,12 @@ impl<T> VideoFrame<T> {
#[inline] #[inline]
pub fn into_buffer(self) -> gst::Buffer { pub fn into_buffer(self) -> gst::Buffer {
let s = mem::ManuallyDrop::new(self); unsafe {
unsafe { ptr::read(&s.buffer) } let mut s = mem::ManuallyDrop::new(self);
let buffer = ptr::read(&s.buffer);
ffi::gst_video_frame_unmap(&mut s.frame);
buffer
}
} }
#[doc(alias = "gst_video_frame_copy")] #[doc(alias = "gst_video_frame_copy")]
@ -250,12 +253,10 @@ impl<T> VideoFrame<T> {
#[inline] #[inline]
pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self { pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self {
let info = crate::VideoInfo(ptr::read(&frame.info));
let buffer = gst::Buffer::from_glib_none(frame.buffer); let buffer = gst::Buffer::from_glib_none(frame.buffer);
Self { Self {
frame, frame,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
} }
} }
@ -263,10 +264,8 @@ impl<T> VideoFrame<T> {
#[inline] #[inline]
pub fn as_video_frame_ref(&self) -> VideoFrameRef<&gst::BufferRef> { pub fn as_video_frame_ref(&self) -> VideoFrameRef<&gst::BufferRef> {
let frame = unsafe { ptr::read(&self.frame) }; let frame = unsafe { ptr::read(&self.frame) };
let info = self.info.clone();
VideoFrameRef { VideoFrameRef {
frame, frame,
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
} }
@ -279,7 +278,11 @@ impl<T> VideoFrame<T> {
#[inline] #[inline]
pub fn into_raw(self) -> ffi::GstVideoFrame { pub fn into_raw(self) -> ffi::GstVideoFrame {
mem::ManuallyDrop::new(self).frame unsafe {
let mut s = mem::ManuallyDrop::new(self);
ptr::drop_in_place(&mut s.buffer);
s.frame
}
} }
} }
@ -315,11 +318,9 @@ impl VideoFrame<Readable> {
Err(buffer) Err(buffer)
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -350,11 +351,9 @@ impl VideoFrame<Readable> {
Err(buffer) Err(buffer)
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -392,11 +391,9 @@ impl VideoFrame<Writable> {
Err(buffer) Err(buffer)
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -429,11 +426,9 @@ impl VideoFrame<Writable> {
Err(buffer) Err(buffer)
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
buffer, buffer,
info,
phantom: PhantomData, phantom: PhantomData,
}) })
} }
@ -489,10 +484,8 @@ impl VideoFrame<Writable> {
#[inline] #[inline]
pub fn as_mut_video_frame_ref(&mut self) -> VideoFrameRef<&mut gst::BufferRef> { pub fn as_mut_video_frame_ref(&mut self) -> VideoFrameRef<&mut gst::BufferRef> {
let frame = unsafe { ptr::read(&self.frame) }; let frame = unsafe { ptr::read(&self.frame) };
let info = self.info.clone();
VideoFrameRef { VideoFrameRef {
frame, frame,
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
} }
@ -504,18 +497,29 @@ impl VideoFrame<Writable> {
} }
} }
#[derive(Debug)]
pub struct VideoFrameRef<T> { pub struct VideoFrameRef<T> {
frame: ffi::GstVideoFrame, frame: ffi::GstVideoFrame,
info: crate::VideoInfo,
unmap: bool, unmap: bool,
phantom: PhantomData<T>, phantom: PhantomData<T>,
} }
impl<T> fmt::Debug for VideoFrameRef<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("VideoFrameRef")
.field("flags", &self.flags())
.field("id", &self.id())
.field("buffer", &unsafe {
gst::BufferRef::from_ptr(self.frame.buffer)
})
.field("info", &self.info())
.finish()
}
}
impl<T> VideoFrameRef<T> { impl<T> VideoFrameRef<T> {
#[inline] #[inline]
pub fn info(&self) -> &crate::VideoInfo { pub fn info(&self) -> &crate::VideoInfo {
&self.info unsafe { &*(&self.frame.info as *const ffi::GstVideoInfo as *const crate::VideoInfo) }
} }
#[inline] #[inline]
@ -735,10 +739,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
debug_assert!(!frame.is_null()); debug_assert!(!frame.is_null());
let frame = ptr::read(frame); let frame = ptr::read(frame);
let info = crate::VideoInfo(ptr::read(&frame.info));
Borrowed::new(Self { Borrowed::new(Self {
frame, frame,
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -746,10 +748,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
#[inline] #[inline]
pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self { pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self {
let info = crate::VideoInfo(ptr::read(&frame.info));
Self { Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
} }
@ -777,10 +777,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
Err(glib::bool_error!("Failed to map VideoFrame")) Err(glib::bool_error!("Failed to map VideoFrame"))
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -812,10 +810,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
Err(glib::bool_error!("Failed to map VideoFrame")) Err(glib::bool_error!("Failed to map VideoFrame"))
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -835,10 +831,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
debug_assert!(!frame.is_null()); debug_assert!(!frame.is_null());
let frame = ptr::read(frame); let frame = ptr::read(frame);
let info = crate::VideoInfo(ptr::read(&frame.info));
Self { Self {
frame, frame,
info,
unmap: false, unmap: false,
phantom: PhantomData, phantom: PhantomData,
} }
@ -846,10 +840,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
#[inline] #[inline]
pub unsafe fn from_glib_full_mut(frame: ffi::GstVideoFrame) -> Self { pub unsafe fn from_glib_full_mut(frame: ffi::GstVideoFrame) -> Self {
let info = crate::VideoInfo(ptr::read(&frame.info));
Self { Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
} }
@ -879,10 +871,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
Err(glib::bool_error!("Failed to map VideoFrame")) Err(glib::bool_error!("Failed to map VideoFrame"))
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })
@ -916,10 +906,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
Err(glib::bool_error!("Failed to map VideoFrame")) Err(glib::bool_error!("Failed to map VideoFrame"))
} else { } else {
let frame = frame.assume_init(); let frame = frame.assume_init();
let info = crate::VideoInfo(ptr::read(&frame.info));
Ok(Self { Ok(Self {
frame, frame,
info,
unmap: true, unmap: true,
phantom: PhantomData, phantom: PhantomData,
}) })

View file

@ -92,6 +92,7 @@ impl From<VideoColorRange> for glib::Value {
#[doc(alias = "GstVideoColorimetry")] #[doc(alias = "GstVideoColorimetry")]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
#[repr(transparent)]
pub struct VideoColorimetry(ffi::GstVideoColorimetry); pub struct VideoColorimetry(ffi::GstVideoColorimetry);
impl VideoColorimetry { impl VideoColorimetry {
@ -267,6 +268,7 @@ impl TryFrom<crate::VideoMultiviewMode> for crate::VideoMultiviewFramePacking {
#[doc(alias = "GstVideoInfo")] #[doc(alias = "GstVideoInfo")]
#[derive(Clone)] #[derive(Clone)]
#[repr(transparent)]
pub struct VideoInfo(pub(crate) ffi::GstVideoInfo); pub struct VideoInfo(pub(crate) ffi::GstVideoInfo);
impl fmt::Debug for VideoInfo { impl fmt::Debug for VideoInfo {
@ -854,7 +856,7 @@ impl VideoInfo {
pub fn align_full( pub fn align_full(
&mut self, &mut self,
align: &mut crate::VideoAlignment, align: &mut crate::VideoAlignment,
) -> Result<([usize; crate::VIDEO_MAX_PLANES]), glib::BoolError> { ) -> Result<[usize; crate::VIDEO_MAX_PLANES], glib::BoolError> {
let mut plane_size = [0; crate::VIDEO_MAX_PLANES]; let mut plane_size = [0; crate::VIDEO_MAX_PLANES];
unsafe { unsafe {

View file

@ -7,18 +7,24 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gobject] [dependencies.gobject]
package = "gobject-sys" package = "gobject-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst_base] [dependencies.gst_base]
package = "gstreamer-base-sys" package = "gstreamer-base-sys"
path = "../../gstreamer-base/sys" path = "../../gstreamer-base/sys"
version = "0.20"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -45,7 +51,7 @@ license = "MIT"
name = "gstreamer-video-sys" name = "gstreamer-video-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer-webrtc" name = "gstreamer-webrtc"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer WebRTC library" description = "Rust bindings for GStreamer WebRTC library"
@ -15,10 +15,10 @@ rust-version = "1.64"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-webrtc-sys", path = "sys" } ffi = { package = "gstreamer-webrtc-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
gst = { package = "gstreamer", path = "../gstreamer" } gst = { package = "gstreamer", path = "../gstreamer", version = "0.20" }
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp" } gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", version = "0.20" }
[dev-dependencies] [dev-dependencies]
gir-format-check = "0.1" gir-format-check = "0.1"

View file

@ -22,10 +22,16 @@ pub use crate::auto::*;
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
mod web_rtc_ice_candidate_stats; mod web_rtc_ice_candidate_stats;
mod web_rtc_session_description; mod web_rtc_session_description;
#[cfg(any(feature = "v1_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
mod web_rtcice;
// Re-export all the traits in a prelude module, so that applications // Re-export all the traits in a prelude module, so that applications
// can always "use gst_webrtc::prelude::*" without getting conflicts // can always "use gst_webrtc::prelude::*" without getting conflicts
pub mod prelude { pub mod prelude {
#[cfg(any(feature = "v1_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
pub use crate::web_rtcice::WebRTCICEExtManual;
#[doc(hidden)] #[doc(hidden)]
pub use gst_sdp::prelude::*; pub use gst_sdp::prelude::*;
} }

View file

@ -0,0 +1,46 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use glib::{prelude::*, translate::*};
use crate::{WebRTCICE, WebRTCICEStream};
pub trait WebRTCICEExtManual: 'static {
#[doc(alias = "gst_webrtc_ice_add_candidate")]
fn add_candidate(&self, stream: &impl IsA<WebRTCICEStream>, candidate: &str);
}
impl<O: IsA<WebRTCICE>> WebRTCICEExtManual for O {
fn add_candidate(&self, stream: &impl IsA<WebRTCICEStream>, candidate: &str) {
unsafe {
use std::{mem, ptr};
if gst::version() >= (1, 23, 0, 0) {
let func = mem::transmute::<
unsafe extern "C" fn(
*mut ffi::GstWebRTCICE,
*mut ffi::GstWebRTCICEStream,
*const std::os::raw::c_char,
),
unsafe extern "C" fn(
*mut ffi::GstWebRTCICE,
*mut ffi::GstWebRTCICEStream,
*const std::os::raw::c_char,
*mut gst::ffi::GstPromise,
),
>(ffi::gst_webrtc_ice_add_candidate);
func(
self.as_ref().to_glib_none().0,
stream.as_ref().to_glib_none().0,
candidate.to_glib_none().0,
ptr::null_mut(),
);
} else {
ffi::gst_webrtc_ice_add_candidate(
self.as_ref().to_glib_none().0,
stream.as_ref().to_glib_none().0,
candidate.to_glib_none().0,
);
}
}
}
}

View file

@ -7,14 +7,18 @@ libc = "0.2"
[dependencies.glib] [dependencies.glib]
package = "glib-sys" package = "glib-sys"
git = "https://github.com/gtk-rs/gtk-rs-core" git = "https://github.com/gtk-rs/gtk-rs-core"
branch = "0.17"
version = "0.17"
[dependencies.gst] [dependencies.gst]
package = "gstreamer-sys" package = "gstreamer-sys"
path = "../../gstreamer/sys" path = "../../gstreamer/sys"
version = "0.20"
[dependencies.gst_sdp] [dependencies.gst_sdp]
package = "gstreamer-sdp-sys" package = "gstreamer-sdp-sys"
path = "../../gstreamer-sdp/sys" path = "../../gstreamer-sdp/sys"
version = "0.20"
[dev-dependencies] [dev-dependencies]
shell-words = "1.0.0" shell-words = "1.0.0"
@ -42,7 +46,7 @@ license = "MIT"
name = "gstreamer-webrtc-sys" name = "gstreamer-webrtc-sys"
readme = "README.md" readme = "README.md"
repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
version = "0.20.0" version = "0.20.7"
edition = "2021" edition = "2021"
rust-version = "1.64" rust-version = "1.64"

View file

@ -5,6 +5,64 @@ 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), 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). specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-version-field).
## [0.20.7] - 2023-07-05
### Fixed
- Fix `wait-for-eos` property name string in `appsink`.
- Fix various memory leaks in `BaseTransform` subclassing bindings.
- Mark some GES APIs as `Send+Sync`.
### Added
- Implement `DiscovererInfo::debug()` and on related structs.
+ Add subclassing bindings for `GESFormatter`.
## [0.20.6] - 2023-06-06
### Added
- Getter for the `gst_rtsp_server::RTSPContext` URI field.
### Fixed
- `gst_pbutils::DiscovererStreamInfo::stream_id()` can return `NULL`. This is
mapped to the empty string for this release to keep backwards compatibility.
- `gst_pbutils::DiscovererStreamInfo` iterator methods can be called on any
subclass directly now without casting.
- Debug logs use the actual function name against instead of the name of a
closure generated by the log macros.
### Changed
- Minor performance improvements to debug logging.
## [0.20.5] - 2023-04-22
### Added
- `glib::HasParamSpec` impl for miniobjects to allow using them with the
properties derive macro.
- `Default` impl for `gst_player::Player`.
## [0.20.4] - 2023-04-07
### Fixed
- Work around `gst_webrtc::WebRTCICE::add_candidate()` API breakage in 1.24.
### Changed
- Reduce size of `gst_audio::AudioBuffer` and `gst_video::VideoFrame` by a
factor of two by not storing an unnecessary copy of the audio/video info.
## [0.20.3] - 2023-03-14
### Fixed
- `gst::ParamSpecArray` uses the correct `glib::Type` now.
- Work around accidental ABI breakage in 1.18 gst-rtsp-server `GstRTSPClient`.
### Added
- Document `gst_utils::StreamProducer::forward_eos()` default value.
## [0.20.2] - 2023-02-21
### Added
- `glib::HasParamSpec` impl for `gst::ClockTime`
- `Default` impl for `gst_play::Play`
- Constructors for non-raw `gst_audio::AudioCapsBuilder` / `gst_video::VideoCapsBuilder`
## [0.20.1] - 2023-02-13
### Fixed
- Fix memory leaks when converting a `gst_audio::AudioBuffer` or
`gst_video::VideoFrame` to a `gst::Buffer` or FFI type.
## [0.20.0] - 2023-02-10 ## [0.20.0] - 2023-02-10
### Fixed ### Fixed
- Make `gst_gL::GLDisplay::create_context()` `other_context` parameter optional. - Make `gst_gL::GLDisplay::create_context()` `other_context` parameter optional.
@ -1474,7 +1532,10 @@ specifically the [variant used by Rust](http://doc.crates.io/manifest.html#the-v
(< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs). (< 0.8.0) of the bindings can be found [here](https://github.com/arturoc/gstreamer1.0-rs).
The API of the two is incompatible. The API of the two is incompatible.
[Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.20.0...HEAD [Unreleased]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.20.3...HEAD
[0.20.3]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.20.2...0.20.3
[0.20.2]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.20.1...0.20.2
[0.20.1]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.20.0...0.20.1
[0.20.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.8...0.20.0 [0.20.0]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.8...0.20.0
[0.19.8]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.7...0.19.8 [0.19.8]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.7...0.19.8
[0.19.7]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.6...0.19.7 [0.19.7]: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/compare/0.19.6...0.19.7

View file

@ -1,6 +1,6 @@
[package] [package]
name = "gstreamer" name = "gstreamer"
version = "0.20.0" version = "0.20.7"
authors = ["Sebastian Dröge <sebastian@centricular.com>"] authors = ["Sebastian Dröge <sebastian@centricular.com>"]
categories = ["api-bindings", "multimedia"] categories = ["api-bindings", "multimedia"]
description = "Rust bindings for GStreamer" description = "Rust bindings for GStreamer"
@ -17,8 +17,8 @@ rust-version = "1.64"
bitflags = "1.0" bitflags = "1.0"
cfg-if = "1.0" cfg-if = "1.0"
libc = "0.2" libc = "0.2"
ffi = { package = "gstreamer-sys", path = "sys" } ffi = { package = "gstreamer-sys", path = "sys", version = "0.20" }
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.17", version = "0.17" }
num-integer = { version = "0.1", default-features = false, features = [] } num-integer = { version = "0.1", default-features = false, features = [] }
num-rational = { version = "0.4", default-features = false, features = [] } num-rational = { version = "0.4", default-features = false, features = [] }
once_cell = "1.0" once_cell = "1.0"

Some files were not shown because too many files have changed in this diff Show more