mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-27 10:30:35 +00:00
Compare commits
115 commits
Author | SHA1 | Date | |
---|---|---|---|
|
bdf502c632 | ||
|
350662e140 | ||
|
cc4c814095 | ||
|
0714c2ceb0 | ||
|
b708208408 | ||
|
b54746cf62 | ||
|
7ca1834cd6 | ||
|
4f6f7028b9 | ||
|
99021c6c07 | ||
|
37409be8bc | ||
|
7baa69563a | ||
|
57052b9417 | ||
|
94f7041d29 | ||
|
d4e63494dd | ||
|
f27a717ceb | ||
|
fb894d4490 | ||
|
455fef0734 | ||
|
fd28a25948 | ||
|
ee2505388b | ||
|
24f8b74f21 | ||
|
27700b86de | ||
|
085108f4a2 | ||
|
f50ddc134b | ||
|
47a8d27a04 | ||
|
a78177aacb | ||
|
b7a52b0da0 | ||
|
80fba8f1e0 | ||
|
8ff2416988 | ||
|
aadbeac8c1 | ||
|
74f4948db5 | ||
|
251dc5c576 | ||
|
096f39d7b3 | ||
|
095b174ded | ||
|
01ab46a483 | ||
|
58ea85c52c | ||
|
709c01ed65 | ||
|
c5672f12e1 | ||
|
40315be230 | ||
|
3fb604e653 | ||
|
2bcc1884cb | ||
|
29fb694f10 | ||
|
fd82f163d2 | ||
|
56007b3a4b | ||
|
6f55e5e8b5 | ||
|
06bc1d7bc1 | ||
|
e8914592c0 | ||
|
8fe05e7865 | ||
|
913dfdcdfc | ||
|
9520f2da0e | ||
|
a422ea69d7 | ||
|
d6cc1e0aa1 | ||
|
212d09aee3 | ||
|
fe8e00f72b | ||
|
49eadcea5e | ||
|
bd46e74386 | ||
|
bb90b58547 | ||
|
c1459c1de8 | ||
|
dbd9447a26 | ||
|
d68abaeef8 | ||
|
eec3f18936 | ||
|
a8dd4aa165 | ||
|
2cf5347d1b | ||
|
846bd77ef7 | ||
|
8c6758f4a4 | ||
|
7fcd2f0cf6 | ||
|
d5e58d2dd4 | ||
|
2c06dce3c8 | ||
|
864ff31795 | ||
|
a941148deb | ||
|
f66d536569 | ||
|
da84e723ab | ||
|
2fe30fb166 | ||
|
7f1f7f4d67 | ||
|
51c8a12f35 | ||
|
ae5f5b7b02 | ||
|
40143109da | ||
|
1087b63ac4 | ||
|
be71147904 | ||
|
698a67b0f8 | ||
|
31c13899a8 | ||
|
49ba205ff7 | ||
|
fa993659db | ||
|
048693202c | ||
|
056b0df294 | ||
|
fef5611eb1 | ||
|
bfa468e87f | ||
|
4aa53ebaeb | ||
|
38dfe1596d | ||
|
61cc4d704c | ||
|
328d0930f8 | ||
|
250a65f02d | ||
|
57d7a44137 | ||
|
784c44b947 | ||
|
dc11c7312a | ||
|
979a15993b | ||
|
891a768e1b | ||
|
0aac683ec9 | ||
|
41c2a2d4af | ||
|
5dd56d8c43 | ||
|
59c081c230 | ||
|
b67887c8dd | ||
|
f440534c6d | ||
|
a6a168d200 | ||
|
0db0fa7270 | ||
|
20120fda3d | ||
|
af58f2d913 | ||
|
f60dfebe07 | ||
|
d1029e374a | ||
|
2bec28e920 | ||
|
83d5efbeb4 | ||
|
82c60a0a93 | ||
|
72f7444805 | ||
|
dba98bd7c7 | ||
|
09c89aec91 | ||
|
ccd53dc17f |
195
.gitlab-ci.yml
195
.gitlab-ci.yml
|
@ -61,6 +61,7 @@ variables:
|
||||||
0.16=0.16
|
0.16=0.16
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- "trigger"
|
||||||
- "container-base"
|
- "container-base"
|
||||||
- "container-final"
|
- "container-final"
|
||||||
- "lint"
|
- "lint"
|
||||||
|
@ -68,20 +69,34 @@ stages:
|
||||||
- "extras"
|
- "extras"
|
||||||
- "deploy"
|
- "deploy"
|
||||||
|
|
||||||
|
# This is an empty job that is used to trigger the pipeline.
|
||||||
|
trigger:
|
||||||
|
image: alpine:latest
|
||||||
|
stage: 'trigger'
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- echo "Trigger job done, now running the pipeline."
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||||
|
# If the MR is assigned to the Merge bot, trigger the pipeline automatically
|
||||||
|
- if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
|
||||||
|
# Require explicit action to trigger tests post merge
|
||||||
|
- if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
|
||||||
|
when: 'manual'
|
||||||
|
# When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
|
||||||
|
# to avoid wasting CI resources
|
||||||
|
- if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
|
||||||
|
when: 'manual'
|
||||||
|
allow_failure: false
|
||||||
|
|
||||||
.debian:11:
|
.debian:11:
|
||||||
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
FDO_DISTRIBUTION_VERSION: 'bullseye-slim'
|
FDO_DISTRIBUTION_VERSION: 'bullseye-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:11-base:
|
||||||
extends: .debian:11
|
extends: .debian:11
|
||||||
|
@ -112,7 +127,15 @@ stages:
|
||||||
- .fdo.container-build@debian
|
- .fdo.container-build@debian
|
||||||
stage: container-base
|
stage: container-base
|
||||||
variables:
|
variables:
|
||||||
FDO_DISTRIBUTION_PACKAGES: "build-essential curl python3-setuptools liborc-0.4-dev libglib2.0-dev libxml2-dev libgtk-3-dev libegl1-mesa libgles2-mesa libgl1-mesa-dri libgl1-mesa-glx libwayland-egl1-mesa xz-utils libssl-dev git wget ca-certificates ninja-build python3-pip flex bison libglib2.0-dev libx11-dev libx11-xcb-dev libsoup2.4-dev libvorbis-dev libogg-dev libtheora-dev libmatroska-dev libvpx-dev libopus-dev libgraphene-1.0-dev libjpeg-dev libwayland-dev python3-gi"
|
FDO_DISTRIBUTION_PACKAGES: >-
|
||||||
|
build-essential curl python3-setuptools liborc-0.4-dev libglib2.0-dev
|
||||||
|
libxml2-dev libgtk-3-dev libegl1-mesa libgles2-mesa libgl1-mesa-dri
|
||||||
|
libgl1-mesa-glx libwayland-egl1-mesa xz-utils libssl-dev git wget
|
||||||
|
ca-certificates ninja-build python3-pip flex bison libglib2.0-dev
|
||||||
|
libx11-dev libx11-xcb-dev libsoup2.4-dev libvorbis-dev libogg-dev
|
||||||
|
libtheora-dev libmatroska-dev libvpx-dev libopus-dev libgraphene-1.0-dev
|
||||||
|
libjpeg-dev libwayland-dev python3-gi libavcodec-dev libavformat-dev
|
||||||
|
libavutil-dev libavfilter-dev libswscale-dev yasm libx264-dev
|
||||||
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 &&
|
||||||
|
@ -131,16 +154,19 @@ build-base:
|
||||||
- .debian:11-base
|
- .debian:11-base
|
||||||
|
|
||||||
build-stable:
|
build-stable:
|
||||||
|
needs: ["build-base"]
|
||||||
extends:
|
extends:
|
||||||
- .build-final-image
|
- .build-final-image
|
||||||
- .debian:11-stable
|
- .debian:11-stable
|
||||||
|
|
||||||
build-msrv:
|
build-msrv:
|
||||||
|
needs: ["build-base"]
|
||||||
extends:
|
extends:
|
||||||
- .build-final-image
|
- .build-final-image
|
||||||
- .debian:11-msrv
|
- .debian:11-msrv
|
||||||
|
|
||||||
build-nightly:
|
build-nightly:
|
||||||
|
needs: ["build-base"]
|
||||||
extends:
|
extends:
|
||||||
- .build-final-image
|
- .build-final-image
|
||||||
- .debian:11-nightly
|
- .debian:11-nightly
|
||||||
|
@ -225,44 +251,7 @@ plugins-update-nightly:
|
||||||
UPDATE_IMG: "nightly"
|
UPDATE_IMG: "nightly"
|
||||||
|
|
||||||
.cargo_test_var: &cargo_test
|
.cargo_test_var: &cargo_test
|
||||||
- rustc --version
|
- ./ci/run-cargo-test.sh
|
||||||
# First build and test all the crates with their relevant features
|
|
||||||
# Keep features in sync with below
|
|
||||||
- |
|
|
||||||
get_features() {
|
|
||||||
crate=$1
|
|
||||||
case "$crate" in
|
|
||||||
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
|
|
||||||
echo "--features=serde,v1_22"
|
|
||||||
;;
|
|
||||||
gstreamer-validate)
|
|
||||||
echo ""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "--features=v1_22"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
|
|
||||||
if [ -e $crate/Cargo.toml ]; then
|
|
||||||
if [ -n "$ALL_FEATURES" ]; then
|
|
||||||
FEATURES="$(get_features $crate)"
|
|
||||||
else
|
|
||||||
FEATURES=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building and testing $crate with $FEATURES"
|
|
||||||
|
|
||||||
cargo build --locked --color=always --manifest-path $crate/Cargo.toml $FEATURES
|
|
||||||
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path $crate/Cargo.toml $FEATURES
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- |
|
|
||||||
if [ -n "$EXAMPLES_TUTORIALS" ]; then
|
|
||||||
cargo build --locked --color=always --manifest-path examples/Cargo.toml --bins --examples --all-features
|
|
||||||
cargo build --locked --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features
|
|
||||||
fi
|
|
||||||
|
|
||||||
.cargo test:
|
.cargo test:
|
||||||
stage: "test"
|
stage: "test"
|
||||||
|
@ -274,6 +263,8 @@ test msrv:
|
||||||
- '.cargo test'
|
- '.cargo test'
|
||||||
- .img-msrv
|
- .img-msrv
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-msrv'
|
- job: 'build-msrv'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -282,6 +273,8 @@ test stable:
|
||||||
- '.cargo test'
|
- '.cargo test'
|
||||||
- .img-stable
|
- .img-stable
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-stable'
|
- job: 'build-stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -293,6 +286,8 @@ test stable all-features:
|
||||||
- '.cargo test'
|
- '.cargo test'
|
||||||
- .img-stable
|
- .img-stable
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-stable'
|
- job: 'build-stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -303,6 +298,8 @@ test nightly:
|
||||||
- '.cargo test'
|
- '.cargo test'
|
||||||
- .img-nightly
|
- .img-nightly
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-nightly'
|
- job: 'build-nightly'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -316,65 +313,23 @@ test nightly all-features:
|
||||||
- '.cargo test'
|
- '.cargo test'
|
||||||
- .img-nightly
|
- .img-nightly
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-nightly'
|
- job: 'build-nightly'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
.cargo test sys:
|
.cargo test sys:
|
||||||
stage: "test"
|
stage: "test"
|
||||||
script:
|
script:
|
||||||
- rustc --version
|
- ./ci/run-sys-cargo-test.sh
|
||||||
- |
|
|
||||||
get_features() {
|
|
||||||
module=${1%%/sys}
|
|
||||||
case "$module" in
|
|
||||||
gstreamer-validate)
|
|
||||||
echo ""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "--features=v1_22"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
}
|
|
||||||
# First build and test all the crates with their relevant features
|
|
||||||
# Keep features in sync with below
|
|
||||||
for crate in gstreamer*/sys gstreamer-gl/*/sys; do
|
|
||||||
if [ -e $crate/Cargo.toml ]; then
|
|
||||||
echo "Building $crate with $(get_features $crate)"
|
|
||||||
cargo build --locked --color=always --manifest-path $crate/Cargo.toml $(get_features $crate)
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# Run tests for crates we can currently run.
|
|
||||||
# Other tests are broken currently.
|
|
||||||
for crate in gstreamer/sys \
|
|
||||||
gstreamer-app/sys \
|
|
||||||
gstreamer-audio/sys \
|
|
||||||
gstreamer-base/sys \
|
|
||||||
gstreamer-check/sys \
|
|
||||||
gstreamer-controller/sys \
|
|
||||||
gstreamer-gl/sys \
|
|
||||||
gstreamer-gl/egl/sys \
|
|
||||||
gstreamer-gl/wayland/sys \
|
|
||||||
gstreamer-gl/x11/sys \
|
|
||||||
gstreamer-mpegts/sys \
|
|
||||||
gstreamer-net/sys \
|
|
||||||
gstreamer-pbutils/sys \
|
|
||||||
gstreamer-player/sys \
|
|
||||||
gstreamer-rtsp-server/sys \
|
|
||||||
gstreamer-rtsp/sys \
|
|
||||||
gstreamer-sdp/sys \
|
|
||||||
gstreamer-tag/sys \
|
|
||||||
gstreamer-video/sys \
|
|
||||||
gstreamer-webrtc/sys; do
|
|
||||||
echo "Testing $crate with $(get_features $crate)"
|
|
||||||
cargo test --locked --color=always --manifest-path $crate/Cargo.toml $(get_features $crate)
|
|
||||||
done
|
|
||||||
|
|
||||||
test stable sys:
|
test stable sys:
|
||||||
extends:
|
extends:
|
||||||
- '.cargo test sys'
|
- '.cargo test sys'
|
||||||
- .img-stable
|
- .img-stable
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-stable'
|
- job: 'build-stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -383,6 +338,8 @@ test msrv sys:
|
||||||
- '.cargo test sys'
|
- '.cargo test sys'
|
||||||
- .img-msrv
|
- .img-msrv
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-msrv'
|
- job: 'build-msrv'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -391,6 +348,8 @@ test nightly sys:
|
||||||
- '.cargo test sys'
|
- '.cargo test sys'
|
||||||
- .img-nightly
|
- .img-nightly
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-nightly'
|
- job: 'build-nightly'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
|
||||||
|
@ -419,39 +378,12 @@ clippy:
|
||||||
variables:
|
variables:
|
||||||
CLIPPY_LINTS: -D warnings
|
CLIPPY_LINTS: -D warnings
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-stable'
|
- job: 'build-stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
script:
|
script:
|
||||||
- cargo clippy --version
|
- ./ci/run-clippy.sh
|
||||||
# Keep features in sync with above
|
|
||||||
- |
|
|
||||||
get_features() {
|
|
||||||
crate=$1
|
|
||||||
case "$crate" in
|
|
||||||
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
|
|
||||||
echo "--features=serde,v1_22"
|
|
||||||
;;
|
|
||||||
gstreamer-validate)
|
|
||||||
echo ""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "--features=v1_22"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
|
|
||||||
if [ -e $crate/Cargo.toml ]; then
|
|
||||||
FEATURES=$(get_features $crate)
|
|
||||||
|
|
||||||
echo "Running clippy on $crate with $FEATURES"
|
|
||||||
|
|
||||||
cargo clippy --locked --color=always --manifest-path $crate/Cargo.toml $FEATURES --all-targets -- $CLIPPY_LINTS
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# And also run over all the examples/tutorials
|
|
||||||
- |
|
|
||||||
cargo clippy --locked --color=always --manifest-path examples/Cargo.toml --all-targets --all-features -- $CLIPPY_LINTS
|
|
||||||
cargo clippy --locked --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- $CLIPPY_LINTS
|
|
||||||
|
|
||||||
deny:
|
deny:
|
||||||
extends: .img-stable
|
extends: .img-stable
|
||||||
|
@ -494,6 +426,8 @@ coverage:
|
||||||
- .img-stable
|
- .img-stable
|
||||||
stage: 'extras'
|
stage: 'extras'
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'build-stable'
|
- job: 'build-stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
variables:
|
variables:
|
||||||
|
@ -597,6 +531,7 @@ pages:
|
||||||
|
|
||||||
.windows rust docker build:
|
.windows rust docker build:
|
||||||
stage: 'container-final'
|
stage: 'container-final'
|
||||||
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
# Unlike the buildah/linux jobs, this file
|
# Unlike the buildah/linux jobs, this file
|
||||||
# needs to be relative to windows-docker/ subdir
|
# needs to be relative to windows-docker/ subdir
|
||||||
|
@ -642,17 +577,7 @@ windows rust docker msrv:
|
||||||
- 'docker'
|
- 'docker'
|
||||||
- 'windows'
|
- 'windows'
|
||||||
- '2022'
|
- '2022'
|
||||||
parallel:
|
|
||||||
matrix:
|
|
||||||
- FEATURES:
|
|
||||||
- "--features=v1_18,"
|
|
||||||
- "--features=v1_20,"
|
|
||||||
- "--features=v1_22,"
|
|
||||||
- "--no-default-features"
|
|
||||||
- ""
|
|
||||||
script:
|
script:
|
||||||
- echo $env:FEATURES
|
|
||||||
|
|
||||||
# Skip -sys tests as they don't work
|
# Skip -sys tests as they don't work
|
||||||
# https://github.com/gtk-rs/gtk3-rs/issues/54
|
# https://github.com/gtk-rs/gtk3-rs/issues/54
|
||||||
#
|
#
|
||||||
|
@ -669,12 +594,16 @@ windows rust docker msrv:
|
||||||
test windows msrv:
|
test windows msrv:
|
||||||
image: $WINDOWS_RUST_MINIMUM_IMAGE
|
image: $WINDOWS_RUST_MINIMUM_IMAGE
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'windows rust docker msrv'
|
- job: 'windows rust docker msrv'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
extends: '.msvc2019 build'
|
extends: '.msvc2019 build'
|
||||||
|
|
||||||
test windows stable:
|
test windows stable:
|
||||||
needs:
|
needs:
|
||||||
|
- job: 'trigger'
|
||||||
|
artifacts: false
|
||||||
- job: 'windows rust docker stable'
|
- job: 'windows rust docker stable'
|
||||||
artifacts: false
|
artifacts: false
|
||||||
image: "$WINDOWS_RUST_STABLE_IMAGE"
|
image: "$WINDOWS_RUST_STABLE_IMAGE"
|
||||||
|
|
3330
Cargo.lock
generated
Normal file
3330
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
||||||
variables:
|
variables:
|
||||||
GST_RS_IMG_TAG: '2022-10-12.0'
|
GST_RS_IMG_TAG: '2023-01-24.0'
|
||||||
GST_RS_STABLE: '1.64.0'
|
GST_RS_STABLE: '1.66.0'
|
||||||
GST_RS_MSRV: '1.63.0'
|
GST_RS_MSRV: '1.63.0'
|
||||||
|
|
|
@ -1,21 +1,46 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
pip3 install meson==0.63.2
|
pip3 install meson==1.0.0
|
||||||
|
|
||||||
# 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 .
|
||||||
cd ..
|
cd ..
|
||||||
git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gstreamer.git --branch main
|
git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git \
|
||||||
|
--depth 1 \
|
||||||
|
--branch 1.22
|
||||||
|
|
||||||
cd gstreamer
|
cd gstreamer
|
||||||
|
|
||||||
# plugins required by tests
|
# plugins required by tests
|
||||||
PLUGINS="-D gst-plugins-base:ogg=enabled -D gst-plugins-base:vorbis=enabled -D gst-plugins-base:theora=enabled -D gst-plugins-good:matroska=enabled -D gst-plugins-good:vpx=enabled -D gst-plugins-bad:opus=enabled"
|
PLUGINS="-D gst-plugins-base:ogg=enabled \
|
||||||
|
-D gst-plugins-base:vorbis=enabled \
|
||||||
|
-D gst-plugins-base:theora=enabled \
|
||||||
|
-D gst-plugins-good:matroska=enabled \
|
||||||
|
-D gst-plugins-good:vpx=enabled \
|
||||||
|
-D gst-plugins-bad:opus=enabled \
|
||||||
|
-D gst-plugins-ugly:x264=enabled"
|
||||||
|
|
||||||
meson build -D prefix=/usr/local -D examples=disabled -D gtk_doc=disabled -D introspection=disabled -D libav=disabled -D python=disabled -D ugly=disabled -D vaapi=disabled $PLUGINS
|
meson setup build \
|
||||||
ninja -C build
|
-D prefix=/usr/local \
|
||||||
ninja -C build install
|
-D gpl=enabled \
|
||||||
|
-D ugly=enabled \
|
||||||
|
-D examples=disabled \
|
||||||
|
-D gtk_doc=disabled \
|
||||||
|
-D introspection=disabled \
|
||||||
|
-D libav=disabled \
|
||||||
|
-D python=disabled \
|
||||||
|
-D vaapi=disabled \
|
||||||
|
$PLUGINS
|
||||||
|
meson compile -C build
|
||||||
|
meson install -C build
|
||||||
|
ldconfig
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf gstreamer/
|
rm -rf gstreamer/
|
||||||
|
|
||||||
|
# Check what plugins we installed
|
||||||
|
gst-inspect-1.0
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -2,13 +2,17 @@
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
BRANCH=4.8.1
|
BRANCH=4.8.3
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
meson build -D prefix=/usr/local -Dbuild-tests=false -Dwayland-protocols:tests=false
|
meson setup build \
|
||||||
ninja -C build
|
-D prefix=/usr/local \
|
||||||
ninja -C build install
|
-Dbuild-tests=false \
|
||||||
|
-Dwayland-protocols:tests=false
|
||||||
|
meson compile -C build
|
||||||
|
meson install -C build
|
||||||
|
ldconfig
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf gtk/
|
rm -rf gtk/
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
source ./ci/env.sh
|
source ./ci/env.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
47
ci/run-cargo-test.sh
Executable file
47
ci/run-cargo-test.sh
Executable file
|
@ -0,0 +1,47 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
# First build and test all the crates with their relevant features
|
||||||
|
# Keep features in sync with the list below below
|
||||||
|
get_features() {
|
||||||
|
crate=$1
|
||||||
|
case "$crate" in
|
||||||
|
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
|
||||||
|
echo "--features=serde,v1_22"
|
||||||
|
;;
|
||||||
|
gstreamer-validate)
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "--features=v1_22"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
|
||||||
|
if [ -e "$crate/Cargo.toml" ]; then
|
||||||
|
if [ -n "$ALL_FEATURES" ]; then
|
||||||
|
FEATURES=$(get_features "$crate")
|
||||||
|
else
|
||||||
|
FEATURES=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Building and testing $crate with $FEATURES"
|
||||||
|
|
||||||
|
cargo build --locked --color=always --manifest-path "$crate/Cargo.toml" $FEATURES
|
||||||
|
G_DEBUG=fatal_warnings cargo test --color=always --manifest-path "$crate/Cargo.toml" $FEATURES
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$EXAMPLES_TUTORIALS" ]; then
|
||||||
|
# Keep in sync with examples/Cargo.toml
|
||||||
|
# List all features except windows/win32
|
||||||
|
EXAMPLES_FEATURES="--features=gtksink,gtkvideooverlay,gtkvideooverlay-x11,gtkvideooverlay-quartz,rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gl,gst-gl-x11,gst-gl-wayland,gst-gl-egl,allocators,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18"
|
||||||
|
|
||||||
|
cargo build --locked --color=always --manifest-path examples/Cargo.toml --bins --examples "$EXAMPLES_FEATURES"
|
||||||
|
cargo build --locked --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features
|
||||||
|
fi
|
41
ci/run-clippy.sh
Executable file
41
ci/run-clippy.sh
Executable file
|
@ -0,0 +1,41 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
cargo clippy --version
|
||||||
|
|
||||||
|
# Keep features in sync with run-cargo-test.sh
|
||||||
|
get_features() {
|
||||||
|
crate=$1
|
||||||
|
case "$crate" in
|
||||||
|
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
|
||||||
|
echo "--features=serde,v1_22"
|
||||||
|
;;
|
||||||
|
gstreamer-validate)
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "--features=v1_22"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
|
||||||
|
if [ -e "$crate/Cargo.toml" ]; then
|
||||||
|
FEATURES=$(get_features "$crate")
|
||||||
|
|
||||||
|
echo "Running clippy on $crate with $FEATURES"
|
||||||
|
|
||||||
|
cargo clippy --locked --color=always --manifest-path "$crate/Cargo.toml" $FEATURES --all-targets -- $CLIPPY_LINTS
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Keep in sync with examples/Cargo.toml
|
||||||
|
# List all features except windows/win32
|
||||||
|
EXAMPLES_FEATURES="--features=gtksink,gtkvideooverlay,gtkvideooverlay-x11,gtkvideooverlay-quartz,rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gl,gst-gl-x11,gst-gl-wayland,gst-gl-egl,allocators,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18"
|
||||||
|
|
||||||
|
# And also run over all the examples/tutorials
|
||||||
|
cargo clippy --locked --color=always --manifest-path examples/Cargo.toml --all-targets "$EXAMPLES_FEATURES" -- $CLIPPY_LINTS
|
||||||
|
cargo clippy --locked --color=always --manifest-path tutorials/Cargo.toml --all-targets --all-features -- $CLIPPY_LINTS
|
53
ci/run-sys-cargo-test.sh
Executable file
53
ci/run-sys-cargo-test.sh
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
get_features() {
|
||||||
|
module=${1%%/sys}
|
||||||
|
case "$module" in
|
||||||
|
gstreamer-validate)
|
||||||
|
echo ""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "--features=v1_22"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# First build and test all the crates with their relevant features
|
||||||
|
# Keep features in sync with below
|
||||||
|
for crate in gstreamer*/sys gstreamer-gl/*/sys; do
|
||||||
|
if [ -e "$crate/Cargo.toml" ]; then
|
||||||
|
echo "Building $crate with $(get_features "$crate")"
|
||||||
|
cargo build --locked --color=always --manifest-path "$crate/Cargo.toml" $(get_features "$crate")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Run tests for crates we can currently run.
|
||||||
|
# Other tests are broken currently.
|
||||||
|
for crate in gstreamer/sys \
|
||||||
|
gstreamer-app/sys \
|
||||||
|
gstreamer-audio/sys \
|
||||||
|
gstreamer-base/sys \
|
||||||
|
gstreamer-check/sys \
|
||||||
|
gstreamer-controller/sys \
|
||||||
|
gstreamer-gl/sys \
|
||||||
|
gstreamer-gl/egl/sys \
|
||||||
|
gstreamer-gl/wayland/sys \
|
||||||
|
gstreamer-gl/x11/sys \
|
||||||
|
gstreamer-mpegts/sys \
|
||||||
|
gstreamer-net/sys \
|
||||||
|
gstreamer-pbutils/sys \
|
||||||
|
gstreamer-player/sys \
|
||||||
|
gstreamer-rtsp-server/sys \
|
||||||
|
gstreamer-rtsp/sys \
|
||||||
|
gstreamer-sdp/sys \
|
||||||
|
gstreamer-tag/sys \
|
||||||
|
gstreamer-video/sys \
|
||||||
|
gstreamer-webrtc/sys; do
|
||||||
|
echo "Testing $crate with $(get_features $crate)"
|
||||||
|
cargo test --locked --color=always --manifest-path $crate/Cargo.toml "$(get_features $crate)"
|
||||||
|
done
|
|
@ -35,47 +35,58 @@
|
||||||
'examples'
|
'examples'
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach($crate in $crates)
|
# "" is the default build, no flags appended
|
||||||
{
|
[string[]] $features_matrix = @(
|
||||||
Write-Host "Building crate: $crate"
|
# "--no-default-features",
|
||||||
Write-Host "Features: $env:FEATURES"
|
# "--features=v1_18,",
|
||||||
$env:LocalFeatures = $env:FEATURES
|
# "--features=v1_20,",
|
||||||
|
"",
|
||||||
|
"--features=v1_22,"
|
||||||
|
)
|
||||||
|
|
||||||
# Don't append feature flags if the string is null/empty
|
foreach($features in $features_matrix) {
|
||||||
# Or when we want to build without default features
|
foreach($crate in $crates)
|
||||||
if ($env:LocalFeatures -and ($env:LocalFeatures -ne '--no-default-features')) {
|
{
|
||||||
if ($crate -eq 'gstreamer') {
|
Write-Host "Building crate: $crate"
|
||||||
$env:LocalFeatures += "serde,"
|
Write-Host "Features: $features"
|
||||||
|
$env:LocalFeatures = $features
|
||||||
|
|
||||||
|
# Don't append feature flags if the string is null/empty
|
||||||
|
# Or when we want to build without default features
|
||||||
|
if ($env:LocalFeatures -and ($env:LocalFeatures -ne '--no-default-features')) {
|
||||||
|
if ($crate -eq 'gstreamer') {
|
||||||
|
$env:LocalFeatures += "serde,"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($crate -eq 'examples') {
|
||||||
|
# FIXME: We can do --all-features for examples once we have gtk installed in the image
|
||||||
|
$env:LocalFeatures = "--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($crate -eq 'tutorials') {
|
||||||
|
$env:LocalFeatures = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($crate -eq 'examples') {
|
Write-Host "with features: $env:LocalFeatures"
|
||||||
# FIXME: We can do --all-features for examples once we have gtk installed in the image
|
cargo build --color=always --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures
|
||||||
$env:LocalFeatures = "--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition"
|
|
||||||
|
if (!$?) {
|
||||||
|
Write-Host "Failed to build crate: $crate"
|
||||||
|
Exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($crate -eq 'tutorials') {
|
if (($crate -eq "gstreamer-tag/sys") -or ($crate -eq "gstreamer-mpegts/sys")) {
|
||||||
$env:LocalFeatures = ''
|
Write-Host "Skipping tests for $crate"
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "with features: $env:LocalFeatures"
|
$env:G_DEBUG="fatal_warnings"
|
||||||
cargo build --color=always --manifest-path $crate/Cargo.toml --all-targets $env:LocalFeatures
|
cargo test --no-fail-fast --color=always --manifest-path $crate/Cargo.toml $env:LocalFeatures
|
||||||
|
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
Write-Host "Failed to build crate: $crate"
|
Write-Host "Tests failed to for crate: $crate"
|
||||||
Exit 1
|
Exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($crate -eq "gstreamer-tag/sys") -or ($crate -eq "gstreamer-mpegts/sys")) {
|
|
||||||
Write-Host "Skipping tests for $crate"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
$env:G_DEBUG="fatal_warnings"
|
|
||||||
cargo test --no-fail-fast --color=always --manifest-path $crate/Cargo.toml $env:LocalFeatures
|
|
||||||
|
|
||||||
if (!$?) {
|
|
||||||
Write-Host "Tests failed to for crate: $crate"
|
|
||||||
Exit 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
# escape=`
|
# escape=`
|
||||||
|
|
||||||
FROM "registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2022-09-23.0-main"
|
FROM "registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2022-12-10.0-main"
|
||||||
|
|
||||||
# Make sure any failure in PowerShell is fatal
|
# Make sure any failure in PowerShell is fatal
|
||||||
ENV ErrorActionPreference='Stop'
|
ENV ErrorActionPreference='Stop'
|
||||||
SHELL ["powershell","-NoLogo", "-NonInteractive", "-Command"]
|
SHELL ["powershell","-NoLogo", "-NonInteractive", "-Command"]
|
||||||
|
|
||||||
ARG DEFAULT_BRANCH="main"
|
ARG DEFAULT_BRANCH="1.22"
|
||||||
ARG RUST_VERSION="invalid"
|
ARG RUST_VERSION="invalid"
|
||||||
|
|
||||||
RUN choco install -y pkgconfiglite nasm llvm
|
RUN choco install -y pkgconfiglite nasm llvm
|
||||||
|
|
|
@ -33,6 +33,7 @@ $env:MESON_ARGS = "--prefix=C:\gst-install\ " +
|
||||||
"-Dffmpeg:tests=disabled " +
|
"-Dffmpeg:tests=disabled " +
|
||||||
"-Dopenh264:tests=disabled " +
|
"-Dopenh264:tests=disabled " +
|
||||||
"-Dpygobject:tests=false " +
|
"-Dpygobject:tests=false " +
|
||||||
|
"-Dgpl=enabled " +
|
||||||
"-Dugly=enabled " +
|
"-Dugly=enabled " +
|
||||||
"-Dbad=enabled " +
|
"-Dbad=enabled " +
|
||||||
"-Dges=enabled " +
|
"-Dges=enabled " +
|
||||||
|
@ -44,10 +45,10 @@ $env:MESON_ARGS = "--prefix=C:\gst-install\ " +
|
||||||
"-Dvaapi=disabled " +
|
"-Dvaapi=disabled " +
|
||||||
"-Dgst-plugins-base:pango=enabled " +
|
"-Dgst-plugins-base:pango=enabled " +
|
||||||
"-Dgst-plugins-good:cairo=enabled " +
|
"-Dgst-plugins-good:cairo=enabled " +
|
||||||
"-Dgpl=enabled "
|
"-Dgst-plugins-good:lame=disabled "
|
||||||
|
|
||||||
Write-Output "Building gst"
|
Write-Output "Building gst"
|
||||||
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson _build $env:MESON_ARGS && meson compile -C _build && ninja -C _build install"
|
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && meson setup _build $env:MESON_ARGS && meson compile -C _build && meson install -C _build"
|
||||||
|
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
Write-Host "Failed to build and install gst"
|
Write-Host "Failed to build and install gst"
|
||||||
|
|
|
@ -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.1 --depth 1 https://gitlab.gnome.org/gnome/gtk.git C:\gtk
|
git clone -b 4.8.3 --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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
|
||||||
|
|
||||||
$env:MESON_ARGS = "--prefix=C:\gst-install\"
|
$env:MESON_ARGS = "--prefix=C:\gst-install\ -Dharfbuzz:freetype=enabled -Dfreetype:harfbuzz=disabled"
|
||||||
|
|
||||||
# Download pango all its subprojects
|
# Download pango all its subprojects
|
||||||
git clone -b main --depth 1 https://gitlab.gnome.org/gnome/pango.git C:\pango
|
git clone -b main --depth 1 https://gitlab.gnome.org/gnome/pango.git C:\pango
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
[package]
|
[package]
|
||||||
name = "examples"
|
name = "examples"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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.63"
|
rust-version = "1.63"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
gst-gl = { package = "gstreamer-gl", path = "../gstreamer-gl", optional = true }
|
gst-gl = { package = "gstreamer-gl", version = "0.19", path = "../gstreamer-gl", optional = true }
|
||||||
gst-gl-egl = { package = "gstreamer-gl-egl", path = "../gstreamer-gl/egl", optional = true }
|
gst-gl-egl = { package = "gstreamer-gl-egl", version = "0.19", path = "../gstreamer-gl/egl", optional = true }
|
||||||
gst-gl-wayland = { package = "gstreamer-gl-wayland", path = "../gstreamer-gl/wayland", optional = true }
|
gst-gl-wayland = { package = "gstreamer-gl-wayland", version = "0.19", path = "../gstreamer-gl/wayland", optional = true }
|
||||||
gst-gl-x11 = { package = "gstreamer-gl-x11", path = "../gstreamer-gl/x11", optional = true }
|
gst-gl-x11 = { package = "gstreamer-gl-x11", version = "0.19", path = "../gstreamer-gl/x11", optional = true }
|
||||||
gst-app = { package = "gstreamer-app", path = "../gstreamer-app" }
|
gst-app = { package = "gstreamer-app", version = "0.19", path = "../gstreamer-app" }
|
||||||
gst-audio = { package = "gstreamer-audio", path = "../gstreamer-audio" }
|
gst-audio = { package = "gstreamer-audio", version = "0.19", path = "../gstreamer-audio" }
|
||||||
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" }
|
gst-base = { package = "gstreamer-base", version = "0.19", path = "../gstreamer-base" }
|
||||||
gst-video = { package = "gstreamer-video", path = "../gstreamer-video" }
|
gst-video = { package = "gstreamer-video", version = "0.19", path = "../gstreamer-video" }
|
||||||
gst-pbutils = { package = "gstreamer-pbutils", path = "../gstreamer-pbutils" }
|
gst-pbutils = { package = "gstreamer-pbutils", version = "0.19", path = "../gstreamer-pbutils" }
|
||||||
gst-play = { package = "gstreamer-play", path = "../gstreamer-play", optional = true }
|
gst-play = { package = "gstreamer-play", version = "0.19", path = "../gstreamer-play", optional = true }
|
||||||
gst-player = { package = "gstreamer-player", path = "../gstreamer-player", optional = true }
|
gst-player = { package = "gstreamer-player", version = "0.19", path = "../gstreamer-player", optional = true }
|
||||||
ges = { package = "gstreamer-editing-services", path = "../gstreamer-editing-services", optional = true }
|
ges = { package = "gstreamer-editing-services", version = "0.19", path = "../gstreamer-editing-services", optional = true }
|
||||||
gst-sdp = { package = "gstreamer-sdp", path = "../gstreamer-sdp", optional = true }
|
gst-sdp = { package = "gstreamer-sdp", version = "0.19", path = "../gstreamer-sdp", optional = true }
|
||||||
gst-rtsp = { package = "gstreamer-rtsp", path = "../gstreamer-rtsp", optional = true }
|
gst-rtsp = { package = "gstreamer-rtsp", version = "0.19", path = "../gstreamer-rtsp", optional = true }
|
||||||
gst-rtsp-server = { package = "gstreamer-rtsp-server", path = "../gstreamer-rtsp-server", optional = true }
|
gst-rtsp-server = { package = "gstreamer-rtsp-server", version = "0.19", path = "../gstreamer-rtsp-server", optional = true }
|
||||||
gst-allocators = { package = "gstreamer-allocators", path = "../gstreamer-allocators", optional = true }
|
gst-allocators = { package = "gstreamer-allocators", version = "0.19", path = "../gstreamer-allocators", optional = true }
|
||||||
gtk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
|
gtk = { git = "https://github.com/gtk-rs/gtk3-rs", branch = "0.16", version = "0.16", optional = true }
|
||||||
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", optional = true }
|
gdk = { git = "https://github.com/gtk-rs/gtk3-rs", branch = "0.16", version = "0.16", 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.16", version = "0.16", 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.16", version = "0.16", 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.16", version = "0.16", 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.16", version = "0.16", 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 }
|
||||||
|
@ -59,6 +59,9 @@ rtsp-server-record = ["gst-rtsp-server", "gst-rtsp", "gio"]
|
||||||
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
|
pango-cairo = ["pango", "pangocairo", "cairo-rs"]
|
||||||
overlay-composition = ["pango", "pangocairo", "cairo-rs"]
|
overlay-composition = ["pango", "pangocairo", "cairo-rs"]
|
||||||
gl = ["gst-gl", "gl_generator", "glutin"]
|
gl = ["gst-gl", "gl_generator", "glutin"]
|
||||||
|
gst-gl-x11 = ["dep:gst-gl-x11"]
|
||||||
|
gst-gl-egl = ["dep:gst-gl-egl"]
|
||||||
|
gst-gl-wayland = ["dep:gst-gl-wayland"]
|
||||||
allocators = ["gst-allocators", "memmap2", "memfd", "uds"]
|
allocators = ["gst-allocators", "memmap2", "memfd", "uds"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#[cfg(feature = "gl")]
|
#[cfg(feature = "gl")]
|
||||||
fn generate_gl_bindings() {
|
fn generate_gl_bindings() {
|
||||||
let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap());
|
let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap());
|
||||||
let mut file = std::fs::File::create(&dest.join("test_gl_bindings.rs")).unwrap();
|
let mut file = std::fs::File::create(dest.join("test_gl_bindings.rs")).unwrap();
|
||||||
gl_generator::Registry::new(
|
gl_generator::Registry::new(
|
||||||
gl_generator::Api::Gles2,
|
gl_generator::Api::Gles2,
|
||||||
(3, 0),
|
(3, 0),
|
||||||
|
|
|
@ -69,7 +69,7 @@ mod cairo_compositor {
|
||||||
.build()]
|
.build()]
|
||||||
});
|
});
|
||||||
|
|
||||||
&*PROPERTIES
|
&PROPERTIES
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by the application whenever the value of a property should be changed.
|
// Called by the application whenever the value of a property should be changed.
|
||||||
|
@ -164,14 +164,14 @@ mod cairo_compositor {
|
||||||
name: Option<&str>,
|
name: Option<&str>,
|
||||||
caps: Option<&gst::Caps>,
|
caps: Option<&gst::Caps>,
|
||||||
) -> Option<gst::Pad> {
|
) -> Option<gst::Pad> {
|
||||||
let element = self.instance();
|
let element = self.obj();
|
||||||
let pad = self.parent_request_new_pad(templ, name, caps)?;
|
let pad = self.parent_request_new_pad(templ, name, caps)?;
|
||||||
element.child_added(&pad, &pad.name());
|
element.child_added(&pad, &pad.name());
|
||||||
Some(pad)
|
Some(pad)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn release_pad(&self, pad: &gst::Pad) {
|
fn release_pad(&self, pad: &gst::Pad) {
|
||||||
let element = self.instance();
|
let element = self.obj();
|
||||||
element.child_removed(pad, &pad.name());
|
element.child_removed(pad, &pad.name());
|
||||||
self.parent_release_pad(pad);
|
self.parent_release_pad(pad);
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ mod cairo_compositor {
|
||||||
token: &gst_video::subclass::AggregateFramesToken,
|
token: &gst_video::subclass::AggregateFramesToken,
|
||||||
outbuf: &mut gst::BufferRef,
|
outbuf: &mut gst::BufferRef,
|
||||||
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
||||||
let element = self.instance();
|
let element = self.obj();
|
||||||
let pads = element.sink_pads();
|
let pads = element.sink_pads();
|
||||||
|
|
||||||
// Map the output frame writable.
|
// Map the output frame writable.
|
||||||
|
@ -306,12 +306,12 @@ mod cairo_compositor {
|
||||||
// This allows accessing the pads and their properties from e.g. gst-launch.
|
// This allows accessing the pads and their properties from e.g. gst-launch.
|
||||||
impl ChildProxyImpl for CairoCompositor {
|
impl ChildProxyImpl for CairoCompositor {
|
||||||
fn children_count(&self) -> u32 {
|
fn children_count(&self) -> u32 {
|
||||||
let object = self.instance();
|
let object = self.obj();
|
||||||
object.num_pads() as u32
|
object.num_pads() as u32
|
||||||
}
|
}
|
||||||
|
|
||||||
fn child_by_name(&self, name: &str) -> Option<glib::Object> {
|
fn child_by_name(&self, name: &str) -> Option<glib::Object> {
|
||||||
let object = self.instance();
|
let object = self.obj();
|
||||||
object
|
object
|
||||||
.pads()
|
.pads()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -320,7 +320,7 @@ mod cairo_compositor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn child_by_index(&self, index: u32) -> Option<glib::Object> {
|
fn child_by_index(&self, index: u32) -> Option<glib::Object> {
|
||||||
let object = self.instance();
|
let object = self.obj();
|
||||||
object
|
object
|
||||||
.pads()
|
.pads()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
@ -21,7 +21,7 @@ impl ExampleCustomEvent {
|
||||||
#[allow(clippy::new_ret_no_self)]
|
#[allow(clippy::new_ret_no_self)]
|
||||||
pub fn new(send_eos: bool) -> gst::Event {
|
pub fn new(send_eos: bool) -> gst::Event {
|
||||||
let s = gst::Structure::builder(Self::EVENT_NAME)
|
let s = gst::Structure::builder(Self::EVENT_NAME)
|
||||||
.field("send_eos", &send_eos)
|
.field("send_eos", send_eos)
|
||||||
.build();
|
.build();
|
||||||
gst::event::CustomDownstream::new(s)
|
gst::event::CustomDownstream::new(s)
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,7 +370,7 @@ mod video_filter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mod imp {
|
mod imp {
|
||||||
use std::{cmp, mem::ManuallyDrop, os::unix::prelude::FromRawFd};
|
use std::{mem::ManuallyDrop, os::unix::prelude::FromRawFd};
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use gst::{subclass::prelude::*, PadDirection, PadPresence, PadTemplate};
|
use gst::{subclass::prelude::*, PadDirection, PadPresence, PadTemplate};
|
||||||
|
@ -430,9 +430,9 @@ mod video_filter {
|
||||||
let mut mmap = MmapMut::map_mut(mfd.as_file())?;
|
let mut mmap = MmapMut::map_mut(mfd.as_file())?;
|
||||||
|
|
||||||
for pixel in mmap.chunks_exact_mut(4) {
|
for pixel in mmap.chunks_exact_mut(4) {
|
||||||
pixel[0] = cmp::max(0, cmp::min(255, (pixel[0] as f64 * factor) as u8));
|
pixel[0] = (pixel[0] as f64 * factor).clamp(0.0, 255.0) as u8;
|
||||||
pixel[1] = cmp::max(0, cmp::min(255, (pixel[1] as f64 * factor) as u8));
|
pixel[1] = (pixel[1] as f64 * factor).clamp(0.0, 255.0) as u8;
|
||||||
pixel[2] = cmp::max(0, cmp::min(255, (pixel[2] as f64 * factor) as u8));
|
pixel[2] = (pixel[2] as f64 * factor).clamp(0.0, 255.0) as u8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ mod mirror {
|
||||||
}
|
}
|
||||||
impl GLBaseFilterImpl for GLMirrorFilter {
|
impl GLBaseFilterImpl for GLMirrorFilter {
|
||||||
fn gl_start(&self) -> Result<(), gst::LoggableError> {
|
fn gl_start(&self) -> Result<(), gst::LoggableError> {
|
||||||
let filter = self.instance();
|
let filter = self.obj();
|
||||||
|
|
||||||
// Create a shader when GL is started, knowing that the OpenGL context is
|
// Create a shader when GL is started, knowing that the OpenGL context is
|
||||||
// available.
|
// available.
|
||||||
|
@ -141,7 +141,7 @@ mod mirror {
|
||||||
input: &gst_gl::GLMemory,
|
input: &gst_gl::GLMemory,
|
||||||
output: &gst_gl::GLMemory,
|
output: &gst_gl::GLMemory,
|
||||||
) -> Result<(), gst::LoggableError> {
|
) -> Result<(), gst::LoggableError> {
|
||||||
let filter = self.instance();
|
let filter = self.obj();
|
||||||
|
|
||||||
let shader = self.shader.lock().unwrap();
|
let shader = self.shader.lock().unwrap();
|
||||||
// Use the underlying filter implementation to transform the input texture into
|
// Use the underlying filter implementation to transform the input texture into
|
||||||
|
|
|
@ -178,7 +178,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
||||||
// Update the text layout. This function is only updating pango's internal state.
|
// Update the text layout. This function is only updating pango's internal state.
|
||||||
// So e.g. that after a 90 degree rotation it knows that what was previously going
|
// So e.g. that after a 90 degree rotation it knows that what was previously going
|
||||||
// to end up as a 200x100 rectangle would now be 100x200.
|
// to end up as a 200x100 rectangle would now be 100x200.
|
||||||
pangocairo::functions::update_layout(&cr, &**layout);
|
pangocairo::functions::update_layout(&cr, layout);
|
||||||
let (width, _height) = layout.size();
|
let (width, _height) = layout.size();
|
||||||
// Using width and height of the text, we can properly possition it within
|
// Using width and height of the text, we can properly possition it within
|
||||||
// our canvas.
|
// our canvas.
|
||||||
|
@ -188,7 +188,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
||||||
);
|
);
|
||||||
// After telling the layout object where to draw itself, we actually tell
|
// After telling the layout object where to draw itself, we actually tell
|
||||||
// it to draw itself into our cairo context.
|
// it to draw itself into our cairo context.
|
||||||
pangocairo::functions::show_layout(&cr, &**layout);
|
pangocairo::functions::show_layout(&cr, layout);
|
||||||
|
|
||||||
// Here we go one step up in our stack of transformations, removing any
|
// Here we go one step up in our stack of transformations, removing any
|
||||||
// changes we did to them since the last call to cr.save();
|
// changes we did to them since the last call to cr.save();
|
||||||
|
|
|
@ -162,7 +162,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
||||||
// Update the text layout. This function is only updating pango's internal state.
|
// Update the text layout. This function is only updating pango's internal state.
|
||||||
// So e.g. that after a 90 degree rotation it knows that what was previously going
|
// So e.g. that after a 90 degree rotation it knows that what was previously going
|
||||||
// to end up as a 200x100 rectangle would now be 100x200.
|
// to end up as a 200x100 rectangle would now be 100x200.
|
||||||
pangocairo::functions::update_layout(&cr, &**layout);
|
pangocairo::functions::update_layout(&cr, layout);
|
||||||
let (width, _height) = layout.size();
|
let (width, _height) = layout.size();
|
||||||
// Using width and height of the text, we can properly possition it within
|
// Using width and height of the text, we can properly possition it within
|
||||||
// our canvas.
|
// our canvas.
|
||||||
|
@ -172,7 +172,7 @@ fn create_pipeline() -> Result<gst::Pipeline, Error> {
|
||||||
);
|
);
|
||||||
// After telling the layout object where to draw itself, we actually tell
|
// After telling the layout object where to draw itself, we actually tell
|
||||||
// it to draw itself into our cairo context.
|
// it to draw itself into our cairo context.
|
||||||
pangocairo::functions::show_layout(&cr, &**layout);
|
pangocairo::functions::show_layout(&cr, layout);
|
||||||
|
|
||||||
// Here we go one step up in our stack of transformations, removing any
|
// Here we go one step up in our stack of transformations, removing any
|
||||||
// changes we did to them since the last call to cr.save();
|
// changes we did to them since the last call to cr.save();
|
||||||
|
|
|
@ -108,7 +108,7 @@ mod media_factory {
|
||||||
fn constructed(&self) {
|
fn constructed(&self) {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
|
|
||||||
let factory = self.instance();
|
let factory = self.obj();
|
||||||
// All media created by this factory are our custom media type. This would
|
// All media created by this factory are our custom media type. This would
|
||||||
// not require a media factory subclass and can also be called on the normal
|
// not require a media factory subclass and can also be called on the normal
|
||||||
// RTSPMediaFactory.
|
// RTSPMediaFactory.
|
||||||
|
@ -239,7 +239,7 @@ mod server {
|
||||||
// Implementation of gst_rtsp_server::RTSPServer virtual methods
|
// Implementation of gst_rtsp_server::RTSPServer virtual methods
|
||||||
impl RTSPServerImpl for Server {
|
impl RTSPServerImpl for Server {
|
||||||
fn create_client(&self) -> Option<gst_rtsp_server::RTSPClient> {
|
fn create_client(&self) -> Option<gst_rtsp_server::RTSPClient> {
|
||||||
let server = self.instance();
|
let server = self.obj();
|
||||||
let client = super::client::Client::default();
|
let client = super::client::Client::default();
|
||||||
|
|
||||||
// Duplicated from the default implementation
|
// Duplicated from the default implementation
|
||||||
|
@ -300,7 +300,7 @@ mod client {
|
||||||
// Implementation of gst_rtsp_server::RTSPClient virtual methods
|
// Implementation of gst_rtsp_server::RTSPClient virtual methods
|
||||||
impl RTSPClientImpl for Client {
|
impl RTSPClientImpl for Client {
|
||||||
fn closed(&self) {
|
fn closed(&self) {
|
||||||
let client = self.instance();
|
let client = self.obj();
|
||||||
self.parent_closed();
|
self.parent_closed();
|
||||||
println!("Client {:?} closed", client);
|
println!("Client {:?} closed", client);
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,14 +308,13 @@ fn load(gl_context: &glutin::WindowedContext<glutin::PossiblyCurrent>) -> Gl {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Message {
|
enum Message {
|
||||||
Sample(gst::Sample),
|
Frame(gst_video::VideoInfo, gst::Buffer),
|
||||||
BusEvent,
|
BusEvent,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) struct App {
|
pub(crate) struct App {
|
||||||
pipeline: gst::Pipeline,
|
pipeline: gst::Pipeline,
|
||||||
appsink: gst_app::AppSink,
|
appsink: gst_app::AppSink,
|
||||||
glupload: gst::Element,
|
|
||||||
bus: gst::Bus,
|
bus: gst::Bus,
|
||||||
event_loop: glutin::event_loop::EventLoop<Message>,
|
event_loop: glutin::event_loop::EventLoop<Message>,
|
||||||
windowed_context: glutin::WindowedContext<glutin::PossiblyCurrent>,
|
windowed_context: glutin::WindowedContext<glutin::PossiblyCurrent>,
|
||||||
|
@ -326,7 +325,7 @@ impl App {
|
||||||
pub(crate) fn new(gl_element: Option<&gst::Element>) -> Result<App, Error> {
|
pub(crate) fn new(gl_element: Option<&gst::Element>) -> Result<App, Error> {
|
||||||
gst::init()?;
|
gst::init()?;
|
||||||
|
|
||||||
let (pipeline, appsink, glupload) = App::create_pipeline(gl_element)?;
|
let (pipeline, appsink) = App::create_pipeline(gl_element)?;
|
||||||
let bus = pipeline
|
let bus = pipeline
|
||||||
.bus()
|
.bus()
|
||||||
.expect("Pipeline without bus. Shouldn't happen!");
|
.expect("Pipeline without bus. Shouldn't happen!");
|
||||||
|
@ -458,7 +457,6 @@ impl App {
|
||||||
Ok(App {
|
Ok(App {
|
||||||
pipeline,
|
pipeline,
|
||||||
appsink,
|
appsink,
|
||||||
glupload,
|
|
||||||
bus,
|
bus,
|
||||||
event_loop,
|
event_loop,
|
||||||
windowed_context,
|
windowed_context,
|
||||||
|
@ -473,33 +471,49 @@ impl App {
|
||||||
.new_sample(move |appsink| {
|
.new_sample(move |appsink| {
|
||||||
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
|
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
|
||||||
|
|
||||||
{
|
let info = sample
|
||||||
let _buffer = sample.buffer().ok_or_else(|| {
|
.caps()
|
||||||
|
.and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok())
|
||||||
|
.ok_or_else(|| {
|
||||||
element_error!(
|
element_error!(
|
||||||
appsink,
|
appsink,
|
||||||
gst::ResourceError::Failed,
|
gst::ResourceError::Failed,
|
||||||
("Failed to get buffer from appsink")
|
("Failed to get video info from sample")
|
||||||
);
|
);
|
||||||
|
|
||||||
gst::FlowError::Error
|
gst::FlowError::NotNegotiated
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let _info = sample
|
let mut buffer = sample.buffer_owned().unwrap();
|
||||||
.caps()
|
{
|
||||||
.and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok())
|
let context = match (buffer.n_memory() > 0)
|
||||||
.ok_or_else(|| {
|
.then(|| buffer.peek_memory(0))
|
||||||
|
.and_then(|m| m.downcast_memory_ref::<gst_gl::GLBaseMemory>())
|
||||||
|
.map(|m| m.context())
|
||||||
|
{
|
||||||
|
Some(context) => context.clone(),
|
||||||
|
None => {
|
||||||
element_error!(
|
element_error!(
|
||||||
appsink,
|
appsink,
|
||||||
gst::ResourceError::Failed,
|
gst::ResourceError::Failed,
|
||||||
("Failed to get video info from sample")
|
("Failed to get GL context from buffer")
|
||||||
);
|
);
|
||||||
|
|
||||||
gst::FlowError::Error
|
return Err(gst::FlowError::Error);
|
||||||
})?;
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(meta) = buffer.meta::<gst_gl::GLSyncMeta>() {
|
||||||
|
meta.set_sync_point(&context);
|
||||||
|
} else {
|
||||||
|
let buffer = buffer.make_mut();
|
||||||
|
let meta = gst_gl::GLSyncMeta::add(buffer, &context);
|
||||||
|
meta.set_sync_point(&context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
event_proxy
|
event_proxy
|
||||||
.send_event(Message::Sample(sample))
|
.send_event(Message::Frame(info, buffer))
|
||||||
.map(|()| gst::FlowSuccess::Ok)
|
.map(|()| gst::FlowSuccess::Ok)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
element_error!(
|
element_error!(
|
||||||
|
@ -529,7 +543,7 @@ impl App {
|
||||||
|
|
||||||
fn create_pipeline(
|
fn create_pipeline(
|
||||||
gl_element: Option<&gst::Element>,
|
gl_element: Option<&gst::Element>,
|
||||||
) -> Result<(gst::Pipeline, gst_app::AppSink, gst::Element), Error> {
|
) -> Result<(gst::Pipeline, gst_app::AppSink), Error> {
|
||||||
let pipeline = gst::Pipeline::default();
|
let pipeline = gst::Pipeline::default();
|
||||||
let src = gst::ElementFactory::make("videotestsrc").build()?;
|
let src = gst::ElementFactory::make("videotestsrc").build()?;
|
||||||
|
|
||||||
|
@ -556,7 +570,7 @@ impl App {
|
||||||
glupload.link(gl_element)?;
|
glupload.link(gl_element)?;
|
||||||
gl_element.link(&appsink)?;
|
gl_element.link(&appsink)?;
|
||||||
|
|
||||||
Ok((pipeline, appsink, glupload))
|
Ok((pipeline, appsink))
|
||||||
} else {
|
} else {
|
||||||
let sink = gst::ElementFactory::make("glsinkbin")
|
let sink = gst::ElementFactory::make("glsinkbin")
|
||||||
.property("sink", &appsink)
|
.property("sink", &appsink)
|
||||||
|
@ -565,21 +579,7 @@ impl App {
|
||||||
pipeline.add_many(&[&src, &sink])?;
|
pipeline.add_many(&[&src, &sink])?;
|
||||||
src.link(&sink)?;
|
src.link(&sink)?;
|
||||||
|
|
||||||
// get the glupload element to extract later the used context in it
|
Ok((pipeline, appsink))
|
||||||
let mut iter = sink.dynamic_cast::<gst::Bin>().unwrap().iterate_elements();
|
|
||||||
let glupload = loop {
|
|
||||||
match iter.next() {
|
|
||||||
Ok(Some(element)) => {
|
|
||||||
if "glupload" == element.factory().unwrap().name() {
|
|
||||||
break Some(element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(gst::IteratorError::Resync) => iter.resync(),
|
|
||||||
_ => break None,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok((pipeline, appsink, glupload.unwrap()))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,12 +620,10 @@ pub(crate) fn main_loop(app: App) -> Result<(), Error> {
|
||||||
let gl = load(&app.windowed_context);
|
let gl = load(&app.windowed_context);
|
||||||
|
|
||||||
let mut curr_frame: Option<gst_video::VideoFrame<gst_video::video_frame::Readable>> = None;
|
let mut curr_frame: Option<gst_video::VideoFrame<gst_video::video_frame::Readable>> = None;
|
||||||
let mut gst_gl_context: Option<gst_gl::GLContext> = None;
|
|
||||||
|
|
||||||
let App {
|
let App {
|
||||||
bus,
|
bus,
|
||||||
event_loop,
|
event_loop,
|
||||||
glupload,
|
|
||||||
pipeline,
|
pipeline,
|
||||||
shared_context,
|
shared_context,
|
||||||
windowed_context,
|
windowed_context,
|
||||||
|
@ -660,22 +658,7 @@ pub(crate) fn main_loop(app: App) -> Result<(), Error> {
|
||||||
},
|
},
|
||||||
glutin::event::Event::RedrawRequested(_) => needs_redraw = true,
|
glutin::event::Event::RedrawRequested(_) => needs_redraw = true,
|
||||||
// Receive a frame
|
// Receive a frame
|
||||||
glutin::event::Event::UserEvent(Message::Sample(sample)) => {
|
glutin::event::Event::UserEvent(Message::Frame(info, buffer)) => {
|
||||||
let buffer = sample.buffer_owned().unwrap();
|
|
||||||
let info = sample
|
|
||||||
.caps()
|
|
||||||
.and_then(|caps| gst_video::VideoInfo::from_caps(caps).ok())
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
{
|
|
||||||
if gst_gl_context.is_none() {
|
|
||||||
gst_gl_context = glupload.property::<Option<gst_gl::GLContext>>("context");
|
|
||||||
}
|
|
||||||
|
|
||||||
let sync_meta = buffer.meta::<gst_gl::GLSyncMeta>().unwrap();
|
|
||||||
sync_meta.set_sync_point(gst_gl_context.as_ref().unwrap());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Ok(frame) = gst_video::VideoFrame::from_buffer_readable_gl(buffer, &info) {
|
if let Ok(frame) = gst_video::VideoFrame::from_buffer_readable_gl(buffer, &info) {
|
||||||
curr_frame = Some(frame);
|
curr_frame = Some(frame);
|
||||||
needs_redraw = true;
|
needs_redraw = true;
|
||||||
|
|
2
gir
2
gir
|
@ -1 +1 @@
|
||||||
Subproject commit 952ff416b5997f50b9261c62c7589100e35a1459
|
Subproject commit 92965146f2fbeacbcb0a6dc414769b48a1897b59
|
|
@ -1 +1 @@
|
||||||
Subproject commit 15396abcca88607bc1c5e14b97a9cf925d23492c
|
Subproject commit ae0d1447f5204ddf882ff08d2163b299db5da228
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gstreamer-allocators"
|
name = "gstreamer-allocators"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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.63"
|
||||||
[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", version = "0.19", path = "sys" }
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -66,6 +66,26 @@ You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
|
||||||
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
||||||
provided by the GStreamer project.
|
provided by the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over Homebrew, especially
|
||||||
|
as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964).
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||||
|
install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and
|
||||||
|
`gstreamer-1.0-devel-1.20.4-universal.pkg`.
|
||||||
|
|
||||||
|
After installation, you also need to set the `PATH` environment variable as
|
||||||
|
follows
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Also note that the `pkg-config` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### Homebrew
|
#### Homebrew
|
||||||
|
|
||||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||||
|
@ -81,19 +101,6 @@ $ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||||
|
|
||||||
Make sure the version of these libraries is >= 1.14.
|
Make sure the version of these libraries is >= 1.14.
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
|
||||||
install them, e.g. `gstreamer-1.0-1.14.0-x86_64.pkg` and
|
|
||||||
`gstreamer-1.0-devel-1.14.0-x86_64.pkg`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="installation-windows"/>
|
<a name="installation-windows"/>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -103,6 +110,32 @@ with `pacman` or by installing the
|
||||||
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
||||||
the GStreamer project.
|
the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over MSYS2.
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.msi` files for your platform from the
|
||||||
|
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and
|
||||||
|
`gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that
|
||||||
|
matches your Rust toolchain, i.e. MinGW or MSVC.
|
||||||
|
|
||||||
|
After installation set the ``PATH` environment variable as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# For a UNIX-style shell:
|
||||||
|
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"
|
||||||
|
|
||||||
|
# For cmd.exe:
|
||||||
|
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to update the path to where you have actually installed GStreamer
|
||||||
|
and for the corresponding toolchain.
|
||||||
|
|
||||||
|
Also note that the `pkg-config.exe` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### MSYS2 / pacman
|
#### MSYS2 / pacman
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -120,20 +153,6 @@ Note that the version of `pkg-config` included in `MSYS2` is
|
||||||
compiling GStreamer, so you may need to install another version. One option
|
compiling GStreamer, so you may need to install another version. One option
|
||||||
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.msi` files for your platform from the
|
|
||||||
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.14.0.msi` and
|
|
||||||
`gstreamer-1.0-devel-x86_64-1.14.0.msi`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
|
||||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="getting-started"/>
|
<a name="getting-started"/>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
|
@ -10,13 +10,13 @@ bitflags! {
|
||||||
#[doc(alias = "GstFdMemoryFlags")]
|
#[doc(alias = "GstFdMemoryFlags")]
|
||||||
pub struct FdMemoryFlags: u32 {
|
pub struct FdMemoryFlags: u32 {
|
||||||
#[doc(alias = "GST_FD_MEMORY_FLAG_NONE")]
|
#[doc(alias = "GST_FD_MEMORY_FLAG_NONE")]
|
||||||
const NONE = ffi::GST_FD_MEMORY_FLAG_NONE as u32;
|
const NONE = ffi::GST_FD_MEMORY_FLAG_NONE as _;
|
||||||
#[doc(alias = "GST_FD_MEMORY_FLAG_KEEP_MAPPED")]
|
#[doc(alias = "GST_FD_MEMORY_FLAG_KEEP_MAPPED")]
|
||||||
const KEEP_MAPPED = ffi::GST_FD_MEMORY_FLAG_KEEP_MAPPED as u32;
|
const KEEP_MAPPED = ffi::GST_FD_MEMORY_FLAG_KEEP_MAPPED as _;
|
||||||
#[doc(alias = "GST_FD_MEMORY_FLAG_MAP_PRIVATE")]
|
#[doc(alias = "GST_FD_MEMORY_FLAG_MAP_PRIVATE")]
|
||||||
const MAP_PRIVATE = ffi::GST_FD_MEMORY_FLAG_MAP_PRIVATE as u32;
|
const MAP_PRIVATE = ffi::GST_FD_MEMORY_FLAG_MAP_PRIVATE as _;
|
||||||
#[doc(alias = "GST_FD_MEMORY_FLAG_DONT_CLOSE")]
|
#[doc(alias = "GST_FD_MEMORY_FLAG_DONT_CLOSE")]
|
||||||
const DONT_CLOSE = ffi::GST_FD_MEMORY_FLAG_DONT_CLOSE as u32;
|
const DONT_CLOSE = ffi::GST_FD_MEMORY_FLAG_DONT_CLOSE as _;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -57,3 +57,5 @@ pub mod prelude {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use gst::prelude::*;
|
pub use gst::prelude::*;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub mod subclass;
|
||||||
|
|
6
gstreamer-allocators/src/subclass/dma_buf_allocator.rs
Normal file
6
gstreamer-allocators/src/subclass/dma_buf_allocator.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
use glib::subclass::prelude::*;
|
||||||
|
|
||||||
|
use crate::{subclass::fd_allocator::FdAllocatorImpl, DmaBufAllocator};
|
||||||
|
|
||||||
|
pub trait DmaBufAllocatorImpl: FdAllocatorImpl {}
|
||||||
|
unsafe impl<T: DmaBufAllocatorImpl> IsSubclassable<T> for DmaBufAllocator {}
|
7
gstreamer-allocators/src/subclass/fd_allocator.rs
Normal file
7
gstreamer-allocators/src/subclass/fd_allocator.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
use glib::subclass::prelude::*;
|
||||||
|
|
||||||
|
use crate::FdAllocator;
|
||||||
|
use gst::subclass::prelude::AllocatorImpl;
|
||||||
|
|
||||||
|
pub trait FdAllocatorImpl: AllocatorImpl {}
|
||||||
|
unsafe impl<T: FdAllocatorImpl> IsSubclassable<T> for FdAllocator {}
|
14
gstreamer-allocators/src/subclass/mod.rs
Normal file
14
gstreamer-allocators/src/subclass/mod.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#[cfg(any(target_os = "linux", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(target_os = "linux")))]
|
||||||
|
mod dma_buf_allocator;
|
||||||
|
mod fd_allocator;
|
||||||
|
|
||||||
|
pub mod prelude {
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use gst::subclass::prelude::*;
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(target_os = "linux")))]
|
||||||
|
pub use super::dma_buf_allocator::DmaBufAllocatorImpl;
|
||||||
|
pub use super::fd_allocator::FdAllocatorImpl;
|
||||||
|
}
|
|
@ -6,14 +6,19 @@ 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.16"
|
||||||
|
version = "0.16"
|
||||||
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.16"
|
||||||
|
version = "0.16"
|
||||||
package = "gobject-sys"
|
package = "gobject-sys"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
package = "gstreamer-sys"
|
package = "gstreamer-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer/sys"
|
path = "../../gstreamer/sys"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -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.63"
|
rust-version = "1.63"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["dox"]
|
features = ["dox"]
|
||||||
[package.metadata.system-deps.gstreamer_allocators_1_0]
|
[package.metadata.system-deps.gstreamer_allocators_1_0]
|
||||||
|
|
|
@ -7,6 +7,7 @@ work_mode = "sys"
|
||||||
single_version_file = true
|
single_version_file = true
|
||||||
|
|
||||||
extra_versions = [
|
extra_versions = [
|
||||||
|
"1.22",
|
||||||
"1.20",
|
"1.20",
|
||||||
"1.18",
|
"1.18",
|
||||||
"1.16",
|
"1.16",
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn main() {} // prevent linking libraries to avoid documentation failure
|
||||||
#[cfg(not(feature = "dox"))]
|
#[cfg(not(feature = "dox"))]
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(s) = system_deps::Config::new().probe() {
|
if let Err(s) = system_deps::Config::new().probe() {
|
||||||
println!("cargo:warning={}", s);
|
println!("cargo:warning={s}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub struct GstDmaBufAllocatorClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDmaBufAllocatorClass {
|
impl ::std::fmt::Debug for GstDmaBufAllocatorClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDmaBufAllocatorClass @ {:p}", self))
|
f.debug_struct(&format!("GstDmaBufAllocatorClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ pub struct GstFdAllocatorClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstFdAllocatorClass {
|
impl ::std::fmt::Debug for GstFdAllocatorClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstFdAllocatorClass @ {:p}", self))
|
f.debug_struct(&format!("GstFdAllocatorClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ pub struct GstPhysMemoryAllocatorInterface {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstPhysMemoryAllocatorInterface {
|
impl ::std::fmt::Debug for GstPhysMemoryAllocatorInterface {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstPhysMemoryAllocatorInterface @ {:p}", self))
|
f.debug_struct(&format!("GstPhysMemoryAllocatorInterface @ {self:p}"))
|
||||||
.field("get_phys_addr", &self.get_phys_addr)
|
.field("get_phys_addr", &self.get_phys_addr)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ pub struct GstDmaBufAllocator {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDmaBufAllocator {
|
impl ::std::fmt::Debug for GstDmaBufAllocator {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDmaBufAllocator @ {:p}", self))
|
f.debug_struct(&format!("GstDmaBufAllocator @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ pub struct GstFdAllocator {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstFdAllocator {
|
impl ::std::fmt::Debug for GstFdAllocator {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstFdAllocator @ {:p}", self))
|
f.debug_struct(&format!("GstFdAllocator @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ pub struct GstPhysMemoryAllocator {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstPhysMemoryAllocator {
|
impl ::std::fmt::Debug for GstPhysMemoryAllocator {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
write!(f, "GstPhysMemoryAllocator @ {:p}", self)
|
write!(f, "GstPhysMemoryAllocator @ {self:p}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Compiler {
|
||||||
cmd.arg(out);
|
cmd.arg(out);
|
||||||
let status = cmd.spawn()?.wait()?;
|
let status = cmd.spawn()?.wait()?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
return Err(format!("compilation command {cmd:?} failed, {status}").into());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
match env::var(name) {
|
match env::var(name) {
|
||||||
Ok(value) => Ok(shell_words::split(&value)?),
|
Ok(value) => Ok(shell_words::split(&value)?),
|
||||||
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
||||||
Err(err) => Err(format!("{} {}", name, err).into()),
|
Err(err) => Err(format!("{name} {err}").into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
cmd.args(packages);
|
cmd.args(packages);
|
||||||
let out = cmd.output()?;
|
let out = cmd.output()?;
|
||||||
if !out.status.success() {
|
if !out.status.success() {
|
||||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
return Err(format!("command {cmd:?} returned {}", out.status).into());
|
||||||
}
|
}
|
||||||
let stdout = str::from_utf8(&out.stdout)?;
|
let stdout = str::from_utf8(&out.stdout)?;
|
||||||
Ok(shell_words::split(stdout.trim())?)
|
Ok(shell_words::split(stdout.trim())?)
|
||||||
|
@ -127,15 +127,14 @@ fn cross_validate_constants_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_value != c_value {
|
if rust_value != c_value {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
|
||||||
rust_name, rust_value, &c_value
|
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -165,16 +164,13 @@ fn cross_validate_layout_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_layout != c_layout {
|
if rust_layout != c_layout {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
|
||||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
|
||||||
rust_name, rust_layout, &c_layout
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +191,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||||
let mut abi_cmd = Command::new(exe);
|
let mut abi_cmd = Command::new(exe);
|
||||||
let output = abi_cmd.output()?;
|
let output = abi_cmd.output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(String::from_utf8(output.stdout)?)
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gstreamer-app"
|
name = "gstreamer-app"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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", version = "0.19", path = "sys" }
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" }
|
gst-base = { package = "gstreamer-base", version = "0.19", path = "../gstreamer-base" }
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -66,6 +66,26 @@ You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
|
||||||
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
||||||
provided by the GStreamer project.
|
provided by the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over Homebrew, especially
|
||||||
|
as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964).
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||||
|
install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and
|
||||||
|
`gstreamer-1.0-devel-1.20.4-universal.pkg`.
|
||||||
|
|
||||||
|
After installation, you also need to set the `PATH` environment variable as
|
||||||
|
follows
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Also note that the `pkg-config` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### Homebrew
|
#### Homebrew
|
||||||
|
|
||||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||||
|
@ -81,19 +101,6 @@ $ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||||
|
|
||||||
Make sure the version of these libraries is >= 1.14.
|
Make sure the version of these libraries is >= 1.14.
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
|
||||||
install them, e.g. `gstreamer-1.0-1.14.0-x86_64.pkg` and
|
|
||||||
`gstreamer-1.0-devel-1.14.0-x86_64.pkg`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="installation-windows"/>
|
<a name="installation-windows"/>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -103,6 +110,32 @@ with `pacman` or by installing the
|
||||||
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
||||||
the GStreamer project.
|
the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over MSYS2.
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.msi` files for your platform from the
|
||||||
|
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and
|
||||||
|
`gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that
|
||||||
|
matches your Rust toolchain, i.e. MinGW or MSVC.
|
||||||
|
|
||||||
|
After installation set the ``PATH` environment variable as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# For a UNIX-style shell:
|
||||||
|
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"
|
||||||
|
|
||||||
|
# For cmd.exe:
|
||||||
|
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to update the path to where you have actually installed GStreamer
|
||||||
|
and for the corresponding toolchain.
|
||||||
|
|
||||||
|
Also note that the `pkg-config.exe` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### MSYS2 / pacman
|
#### MSYS2 / pacman
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -120,20 +153,6 @@ Note that the version of `pkg-config` included in `MSYS2` is
|
||||||
compiling GStreamer, so you may need to install another version. One option
|
compiling GStreamer, so you may need to install another version. One option
|
||||||
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.msi` files for your platform from the
|
|
||||||
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.14.0.msi` and
|
|
||||||
`gstreamer-1.0-devel-x86_64-1.14.0.msi`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
|
||||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="getting-started"/>
|
<a name="getting-started"/>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
|
@ -273,6 +273,7 @@ impl AppSink {
|
||||||
///
|
///
|
||||||
/// This method returns an instance of [`AppSinkBuilder`](crate::builders::AppSinkBuilder) which can be used to create [`AppSink`] objects.
|
/// This method returns an instance of [`AppSinkBuilder`](crate::builders::AppSinkBuilder) which can be used to create [`AppSink`] objects.
|
||||||
pub fn builder() -> AppSinkBuilder {
|
pub fn builder() -> AppSinkBuilder {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
AppSinkBuilder::default()
|
AppSinkBuilder::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,7 @@ impl AppSrc {
|
||||||
///
|
///
|
||||||
/// This method returns an instance of [`AppSrcBuilder`](crate::builders::AppSrcBuilder) which can be used to create [`AppSrc`] objects.
|
/// This method returns an instance of [`AppSrcBuilder`](crate::builders::AppSrcBuilder) which can be used to create [`AppSrc`] objects.
|
||||||
pub fn builder() -> AppSrcBuilder {
|
pub fn builder() -> AppSrcBuilder {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
AppSrcBuilder::default()
|
AppSrcBuilder::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -10,6 +10,19 @@ pub use glib;
|
||||||
pub use gst;
|
pub use gst;
|
||||||
pub use gst_base;
|
pub use gst_base;
|
||||||
|
|
||||||
|
macro_rules! assert_initialized_main_thread {
|
||||||
|
() => {
|
||||||
|
if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
|
||||||
|
#[allow(unused_unsafe)]
|
||||||
|
if unsafe { gst::ffi::gst_is_initialized() } != glib::ffi::GTRUE {
|
||||||
|
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
||||||
|
} else {
|
||||||
|
gst::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
macro_rules! skip_assert_initialized {
|
macro_rules! skip_assert_initialized {
|
||||||
() => {};
|
() => {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,17 @@ 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.16"
|
||||||
|
version = "0.16"
|
||||||
|
|
||||||
[dependencies.gst_base]
|
[dependencies.gst_base]
|
||||||
package = "gstreamer-base-sys"
|
package = "gstreamer-base-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer-base/sys"
|
path = "../../gstreamer-base/sys"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
package = "gstreamer-sys"
|
package = "gstreamer-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer/sys"
|
path = "../../gstreamer/sys"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -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.19.0"
|
version = "0.19.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.63"
|
rust-version = "1.63"
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
|
|
|
@ -11,6 +11,7 @@ external_libraries = [
|
||||||
]
|
]
|
||||||
|
|
||||||
extra_versions = [
|
extra_versions = [
|
||||||
|
"1.22",
|
||||||
"1.20",
|
"1.20",
|
||||||
"1.18",
|
"1.18",
|
||||||
"1.16",
|
"1.16",
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn main() {} // prevent linking libraries to avoid documentation failure
|
||||||
#[cfg(not(feature = "dox"))]
|
#[cfg(not(feature = "dox"))]
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(s) = system_deps::Config::new().probe() {
|
if let Err(s) = system_deps::Config::new().probe() {
|
||||||
println!("cargo:warning={}", s);
|
println!("cargo:warning={s}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub struct GstAppSinkCallbacks {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSinkCallbacks {
|
impl ::std::fmt::Debug for GstAppSinkCallbacks {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSinkCallbacks @ {:p}", self))
|
f.debug_struct(&format!("GstAppSinkCallbacks @ {self:p}"))
|
||||||
.field("eos", &self.eos)
|
.field("eos", &self.eos)
|
||||||
.field("new_preroll", &self.new_preroll)
|
.field("new_preroll", &self.new_preroll)
|
||||||
.field("new_sample", &self.new_sample)
|
.field("new_sample", &self.new_sample)
|
||||||
|
@ -74,7 +74,7 @@ pub struct GstAppSinkClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSinkClass {
|
impl ::std::fmt::Debug for GstAppSinkClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSinkClass @ {:p}", self))
|
f.debug_struct(&format!("GstAppSinkClass @ {self:p}"))
|
||||||
.field("basesink_class", &self.basesink_class)
|
.field("basesink_class", &self.basesink_class)
|
||||||
.field("eos", &self.eos)
|
.field("eos", &self.eos)
|
||||||
.field("new_preroll", &self.new_preroll)
|
.field("new_preroll", &self.new_preroll)
|
||||||
|
@ -107,7 +107,7 @@ pub struct GstAppSrcCallbacks {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSrcCallbacks {
|
impl ::std::fmt::Debug for GstAppSrcCallbacks {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSrcCallbacks @ {:p}", self))
|
f.debug_struct(&format!("GstAppSrcCallbacks @ {self:p}"))
|
||||||
.field("need_data", &self.need_data)
|
.field("need_data", &self.need_data)
|
||||||
.field("enough_data", &self.enough_data)
|
.field("enough_data", &self.enough_data)
|
||||||
.field("seek_data", &self.seek_data)
|
.field("seek_data", &self.seek_data)
|
||||||
|
@ -134,7 +134,7 @@ pub struct GstAppSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSrcClass {
|
impl ::std::fmt::Debug for GstAppSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstAppSrcClass @ {self:p}"))
|
||||||
.field("basesrc_class", &self.basesrc_class)
|
.field("basesrc_class", &self.basesrc_class)
|
||||||
.field("need_data", &self.need_data)
|
.field("need_data", &self.need_data)
|
||||||
.field("enough_data", &self.enough_data)
|
.field("enough_data", &self.enough_data)
|
||||||
|
@ -166,7 +166,7 @@ pub struct GstAppSink {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSink {
|
impl ::std::fmt::Debug for GstAppSink {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSink @ {:p}", self))
|
f.debug_struct(&format!("GstAppSink @ {self:p}"))
|
||||||
.field("basesink", &self.basesink)
|
.field("basesink", &self.basesink)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ pub struct GstAppSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAppSrc {
|
impl ::std::fmt::Debug for GstAppSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAppSrc @ {:p}", self))
|
f.debug_struct(&format!("GstAppSrc @ {self:p}"))
|
||||||
.field("basesrc", &self.basesrc)
|
.field("basesrc", &self.basesrc)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Compiler {
|
||||||
cmd.arg(out);
|
cmd.arg(out);
|
||||||
let status = cmd.spawn()?.wait()?;
|
let status = cmd.spawn()?.wait()?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
return Err(format!("compilation command {cmd:?} failed, {status}").into());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
match env::var(name) {
|
match env::var(name) {
|
||||||
Ok(value) => Ok(shell_words::split(&value)?),
|
Ok(value) => Ok(shell_words::split(&value)?),
|
||||||
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
||||||
Err(err) => Err(format!("{} {}", name, err).into()),
|
Err(err) => Err(format!("{name} {err}").into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
cmd.args(packages);
|
cmd.args(packages);
|
||||||
let out = cmd.output()?;
|
let out = cmd.output()?;
|
||||||
if !out.status.success() {
|
if !out.status.success() {
|
||||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
return Err(format!("command {cmd:?} returned {}", out.status).into());
|
||||||
}
|
}
|
||||||
let stdout = str::from_utf8(&out.stdout)?;
|
let stdout = str::from_utf8(&out.stdout)?;
|
||||||
Ok(shell_words::split(stdout.trim())?)
|
Ok(shell_words::split(stdout.trim())?)
|
||||||
|
@ -127,15 +127,14 @@ fn cross_validate_constants_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_value != c_value {
|
if rust_value != c_value {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
|
||||||
rust_name, rust_value, &c_value
|
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -165,16 +164,13 @@ fn cross_validate_layout_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_layout != c_layout {
|
if rust_layout != c_layout {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
|
||||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
|
||||||
rust_name, rust_layout, &c_layout
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +191,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||||
let mut abi_cmd = Command::new(exe);
|
let mut abi_cmd = Command::new(exe);
|
||||||
let output = abi_cmd.output()?;
|
let output = abi_cmd.output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(String::from_utf8(output.stdout)?)
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gstreamer-audio"
|
name = "gstreamer-audio"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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,10 +17,10 @@ rust-version = "1.63"
|
||||||
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", version = "0.19", path = "sys" }
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
gst-base = { package = "gstreamer-base", path = "../gstreamer-base" }
|
gst-base = { package = "gstreamer-base", version = "0.19", path = "../gstreamer-base" }
|
||||||
once_cell = "1.0"
|
once_cell = "1.0"
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ generate = [
|
||||||
"GstAudio.AudioBaseSrc",
|
"GstAudio.AudioBaseSrc",
|
||||||
"GstAudio.AudioChannelPosition",
|
"GstAudio.AudioChannelPosition",
|
||||||
"GstAudio.AudioDitherMethod",
|
"GstAudio.AudioDitherMethod",
|
||||||
|
"GstAudio.AudioFilter",
|
||||||
"GstAudio.AudioFormatFlags",
|
"GstAudio.AudioFormatFlags",
|
||||||
"GstAudio.AudioLayout",
|
"GstAudio.AudioLayout",
|
||||||
"GstAudio.AudioNoiseShapingMethod",
|
"GstAudio.AudioNoiseShapingMethod",
|
||||||
|
@ -53,6 +54,7 @@ manual = [
|
||||||
"GstBase.AggregatorPad",
|
"GstBase.AggregatorPad",
|
||||||
"GstBase.BaseSink",
|
"GstBase.BaseSink",
|
||||||
"GstBase.BaseSrc",
|
"GstBase.BaseSrc",
|
||||||
|
"GstBase.BaseTransform",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
|
@ -95,6 +97,11 @@ status = "generate"
|
||||||
# getter/setter exists in base class
|
# getter/setter exists in base class
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|
||||||
|
[[object.property]]
|
||||||
|
name = "force-live"
|
||||||
|
# getter/setter exists in base class
|
||||||
|
ignore = true
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstAudio.AudioBaseSink"
|
name = "GstAudio.AudioBaseSink"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
|
|
|
@ -66,6 +66,26 @@ You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
|
||||||
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
||||||
provided by the GStreamer project.
|
provided by the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over Homebrew, especially
|
||||||
|
as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964).
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||||
|
install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and
|
||||||
|
`gstreamer-1.0-devel-1.20.4-universal.pkg`.
|
||||||
|
|
||||||
|
After installation, you also need to set the `PATH` environment variable as
|
||||||
|
follows
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Also note that the `pkg-config` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### Homebrew
|
#### Homebrew
|
||||||
|
|
||||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||||
|
@ -81,19 +101,6 @@ $ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||||
|
|
||||||
Make sure the version of these libraries is >= 1.14.
|
Make sure the version of these libraries is >= 1.14.
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
|
||||||
install them, e.g. `gstreamer-1.0-1.14.0-x86_64.pkg` and
|
|
||||||
`gstreamer-1.0-devel-1.14.0-x86_64.pkg`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="installation-windows"/>
|
<a name="installation-windows"/>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -103,6 +110,32 @@ with `pacman` or by installing the
|
||||||
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
||||||
the GStreamer project.
|
the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over MSYS2.
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.msi` files for your platform from the
|
||||||
|
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and
|
||||||
|
`gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that
|
||||||
|
matches your Rust toolchain, i.e. MinGW or MSVC.
|
||||||
|
|
||||||
|
After installation set the ``PATH` environment variable as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# For a UNIX-style shell:
|
||||||
|
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"
|
||||||
|
|
||||||
|
# For cmd.exe:
|
||||||
|
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to update the path to where you have actually installed GStreamer
|
||||||
|
and for the corresponding toolchain.
|
||||||
|
|
||||||
|
Also note that the `pkg-config.exe` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### MSYS2 / pacman
|
#### MSYS2 / pacman
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -120,20 +153,6 @@ Note that the version of `pkg-config` included in `MSYS2` is
|
||||||
compiling GStreamer, so you may need to install another version. One option
|
compiling GStreamer, so you may need to install another version. One option
|
||||||
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.msi` files for your platform from the
|
|
||||||
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.14.0.msi` and
|
|
||||||
`gstreamer-1.0-devel-x86_64-1.14.0.msi`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
|
||||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="getting-started"/>
|
<a name="getting-started"/>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
|
@ -92,7 +92,7 @@ impl<T> AudioBuffer<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn plane_size(&self) -> usize {
|
pub fn plane_size(&self) -> usize {
|
||||||
(self.n_samples() as usize * self.sample_stride() as usize * self.channels() as usize)
|
(self.n_samples() * self.sample_stride() as usize * self.channels() as usize)
|
||||||
/ self.n_planes() as usize
|
/ self.n_planes() as usize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ impl<T> AudioBufferRef<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn plane_size(&self) -> usize {
|
pub fn plane_size(&self) -> usize {
|
||||||
(self.n_samples() as usize * self.sample_stride() as usize * self.channels() as usize)
|
(self.n_samples() * self.sample_stride() as usize * self.channels() as usize)
|
||||||
/ self.n_planes() as usize
|
/ self.n_planes() as usize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ impl AudioChannelPosition {
|
||||||
}
|
}
|
||||||
|
|
||||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= len as usize {
|
if i >= len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].into_glib()
|
positions[i].into_glib()
|
||||||
|
@ -95,7 +95,7 @@ impl AudioChannelPosition {
|
||||||
|
|
||||||
let len = positions.len();
|
let len = positions.len();
|
||||||
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= len as usize {
|
if i >= len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].into_glib()
|
positions[i].into_glib()
|
||||||
|
@ -139,7 +139,7 @@ impl AudioChannelPosition {
|
||||||
|
|
||||||
let len = positions.len();
|
let len = positions.len();
|
||||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= len as usize {
|
if i >= len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].into_glib()
|
positions[i].into_glib()
|
||||||
|
@ -174,7 +174,7 @@ pub fn buffer_reorder_channels(
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= from_len as usize {
|
if i >= from_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].into_glib()
|
from[i].into_glib()
|
||||||
|
@ -182,7 +182,7 @@ pub fn buffer_reorder_channels(
|
||||||
});
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= to_len as usize {
|
if i >= to_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].into_glib()
|
to[i].into_glib()
|
||||||
|
@ -224,7 +224,7 @@ pub fn reorder_channels(
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= from_len as usize {
|
if i >= from_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].into_glib()
|
from[i].into_glib()
|
||||||
|
@ -232,7 +232,7 @@ pub fn reorder_channels(
|
||||||
});
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= to_len as usize {
|
if i >= to_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].into_glib()
|
to[i].into_glib()
|
||||||
|
@ -274,7 +274,7 @@ pub fn channel_reorder_map(
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= from_len as usize {
|
if i >= from_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].into_glib()
|
from[i].into_glib()
|
||||||
|
@ -282,7 +282,7 @@ pub fn channel_reorder_map(
|
||||||
});
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| {
|
||||||
if i >= to_len as usize {
|
if i >= to_len {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].into_glib()
|
to[i].into_glib()
|
||||||
|
|
|
@ -74,7 +74,7 @@ impl AudioConverterConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_dither_method(&mut self, v: crate::AudioDitherMethod) {
|
pub fn set_dither_method(&mut self, v: crate::AudioDitherMethod) {
|
||||||
self.0.set("GstAudioConverter.dither-method", &v);
|
self.0.set("GstAudioConverter.dither-method", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_dither_method")]
|
#[doc(alias = "get_dither_method")]
|
||||||
|
@ -86,7 +86,7 @@ impl AudioConverterConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_noise_shaping_method(&mut self, v: crate::AudioNoiseShapingMethod) {
|
pub fn set_noise_shaping_method(&mut self, v: crate::AudioNoiseShapingMethod) {
|
||||||
self.0.set("GstAudioConverter.noise-shaping-method", &v);
|
self.0.set("GstAudioConverter.noise-shaping-method", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_noise_shaping_method")]
|
#[doc(alias = "get_noise_shaping_method")]
|
||||||
|
@ -98,7 +98,7 @@ impl AudioConverterConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_quantization(&mut self, v: u32) {
|
pub fn set_quantization(&mut self, v: u32) {
|
||||||
self.0.set("GstAudioConverter.quantization", &v);
|
self.0.set("GstAudioConverter.quantization", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_quantization")]
|
#[doc(alias = "get_quantization")]
|
||||||
|
@ -110,7 +110,7 @@ impl AudioConverterConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_resampler_method(&mut self, v: crate::AudioResamplerMethod) {
|
pub fn set_resampler_method(&mut self, v: crate::AudioResamplerMethod) {
|
||||||
self.0.set("GstAudioConverter.resampler-method", &v);
|
self.0.set("GstAudioConverter.resampler-method", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_resampler_method")]
|
#[doc(alias = "get_resampler_method")]
|
||||||
|
@ -128,7 +128,7 @@ impl AudioConverterConfig {
|
||||||
assert_eq!(val.len(), length);
|
assert_eq!(val.len(), length);
|
||||||
gst::Array::from_values(val.iter().map(|val| val.to_send_value())).to_send_value()
|
gst::Array::from_values(val.iter().map(|val| val.to_send_value())).to_send_value()
|
||||||
}));
|
}));
|
||||||
self.0.set("GstAudioConverter.mix-matrix", &array);
|
self.0.set("GstAudioConverter.mix-matrix", array);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "get_mix_matrix")]
|
#[doc(alias = "get_mix_matrix")]
|
||||||
|
@ -157,7 +157,7 @@ impl AudioConverterConfig {
|
||||||
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
pub fn set_dither_threshold(&mut self, v: u32) {
|
pub fn set_dither_threshold(&mut self, v: u32) {
|
||||||
self.0.set("GstAudioConverter.dither-threshold", &v);
|
self.0.set("GstAudioConverter.dither-threshold", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
|
|
@ -255,7 +255,7 @@ impl AudioInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn bps(&self) -> u32 {
|
pub fn bps(&self) -> u32 {
|
||||||
(self.format_info().depth() as u32) >> 3
|
self.format_info().depth() >> 3
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn depth(&self) -> u32 {
|
pub fn depth(&self) -> u32 {
|
||||||
|
@ -401,6 +401,17 @@ impl<'a> glib::translate::ToGlibPtr<'a, *const ffi::GstAudioInfo> for AudioInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
impl glib::translate::FromGlibPtrNone<*const ffi::GstAudioInfo> for AudioInfo {
|
||||||
|
#[inline]
|
||||||
|
unsafe fn from_glib_none(ptr: *const ffi::GstAudioInfo) -> Self {
|
||||||
|
Self(
|
||||||
|
ptr::read(ptr),
|
||||||
|
std::array::from_fn(|i| from_glib((*ptr).position[i])),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
impl glib::translate::FromGlibPtrNone<*mut ffi::GstAudioInfo> for AudioInfo {
|
impl glib::translate::FromGlibPtrNone<*mut ffi::GstAudioInfo> for AudioInfo {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
20
gstreamer-audio/src/auto/audio_filter.rs
Normal file
20
gstreamer-audio/src/auto/audio_filter.rs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||||
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||||
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||||
|
// DO NOT EDIT
|
||||||
|
|
||||||
|
glib::wrapper! {
|
||||||
|
#[doc(alias = "GstAudioFilter")]
|
||||||
|
pub struct AudioFilter(Object<ffi::GstAudioFilter, ffi::GstAudioFilterClass>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
|
||||||
|
|
||||||
|
match fn {
|
||||||
|
type_ => || ffi::gst_audio_filter_get_type(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AudioFilter {
|
||||||
|
pub const NONE: Option<&'static AudioFilter> = None;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for AudioFilter {}
|
||||||
|
unsafe impl Sync for AudioFilter {}
|
|
@ -14,7 +14,7 @@ bitflags! {
|
||||||
#[doc(alias = "GstAudioFlags")]
|
#[doc(alias = "GstAudioFlags")]
|
||||||
pub struct AudioFlags: u32 {
|
pub struct AudioFlags: u32 {
|
||||||
#[doc(alias = "GST_AUDIO_FLAG_UNPOSITIONED")]
|
#[doc(alias = "GST_AUDIO_FLAG_UNPOSITIONED")]
|
||||||
const UNPOSITIONED = ffi::GST_AUDIO_FLAG_UNPOSITIONED as u32;
|
const UNPOSITIONED = ffi::GST_AUDIO_FLAG_UNPOSITIONED as _;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,15 +72,15 @@ bitflags! {
|
||||||
#[doc(alias = "GstAudioFormatFlags")]
|
#[doc(alias = "GstAudioFormatFlags")]
|
||||||
pub struct AudioFormatFlags: u32 {
|
pub struct AudioFormatFlags: u32 {
|
||||||
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_INTEGER")]
|
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_INTEGER")]
|
||||||
const INTEGER = ffi::GST_AUDIO_FORMAT_FLAG_INTEGER as u32;
|
const INTEGER = ffi::GST_AUDIO_FORMAT_FLAG_INTEGER as _;
|
||||||
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_FLOAT")]
|
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_FLOAT")]
|
||||||
const FLOAT = ffi::GST_AUDIO_FORMAT_FLAG_FLOAT as u32;
|
const FLOAT = ffi::GST_AUDIO_FORMAT_FLAG_FLOAT as _;
|
||||||
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_SIGNED")]
|
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_SIGNED")]
|
||||||
const SIGNED = ffi::GST_AUDIO_FORMAT_FLAG_SIGNED as u32;
|
const SIGNED = ffi::GST_AUDIO_FORMAT_FLAG_SIGNED as _;
|
||||||
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_COMPLEX")]
|
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_COMPLEX")]
|
||||||
const COMPLEX = ffi::GST_AUDIO_FORMAT_FLAG_COMPLEX as u32;
|
const COMPLEX = ffi::GST_AUDIO_FORMAT_FLAG_COMPLEX as _;
|
||||||
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_UNPACK")]
|
#[doc(alias = "GST_AUDIO_FORMAT_FLAG_UNPACK")]
|
||||||
const UNPACK = ffi::GST_AUDIO_FORMAT_FLAG_UNPACK as u32;
|
const UNPACK = ffi::GST_AUDIO_FORMAT_FLAG_UNPACK as _;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ bitflags! {
|
||||||
#[doc(alias = "GstAudioPackFlags")]
|
#[doc(alias = "GstAudioPackFlags")]
|
||||||
pub struct AudioPackFlags: u32 {
|
pub struct AudioPackFlags: u32 {
|
||||||
#[doc(alias = "GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE")]
|
#[doc(alias = "GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE")]
|
||||||
const TRUNCATE_RANGE = ffi::GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE as u32;
|
const TRUNCATE_RANGE = ffi::GST_AUDIO_PACK_FLAG_TRUNCATE_RANGE as _;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@ pub use self::audio_decoder::AudioDecoder;
|
||||||
mod audio_encoder;
|
mod audio_encoder;
|
||||||
pub use self::audio_encoder::AudioEncoder;
|
pub use self::audio_encoder::AudioEncoder;
|
||||||
|
|
||||||
|
mod audio_filter;
|
||||||
|
pub use self::audio_filter::AudioFilter;
|
||||||
|
|
||||||
mod audio_sink;
|
mod audio_sink;
|
||||||
pub use self::audio_sink::AudioSink;
|
pub use self::audio_sink::AudioSink;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -82,7 +82,7 @@ mod tests {
|
||||||
|
|
||||||
#[cfg(feature = "v1_18")]
|
#[cfg(feature = "v1_18")]
|
||||||
{
|
{
|
||||||
use glib::translate::{from_glib_full, IntoGlib};
|
use glib::translate::IntoGlib;
|
||||||
|
|
||||||
/* audio_make_raw_caps() is a re-implementation so ensure it returns the same caps as the C API */
|
/* audio_make_raw_caps() is a re-implementation so ensure it returns the same caps as the C API */
|
||||||
let c_caps = unsafe {
|
let c_caps = unsafe {
|
||||||
|
@ -96,7 +96,7 @@ mod tests {
|
||||||
formats.len() as u32,
|
formats.len() as u32,
|
||||||
ffi::GST_AUDIO_LAYOUT_INTERLEAVED,
|
ffi::GST_AUDIO_LAYOUT_INTERLEAVED,
|
||||||
);
|
);
|
||||||
from_glib_full(caps)
|
gst::Caps::from_glib_full(caps)
|
||||||
};
|
};
|
||||||
assert_eq!(caps, c_caps);
|
assert_eq!(caps, c_caps);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
|
||||||
.expect("Missing parent function `create_output_buffer`");
|
.expect("Missing parent function `create_output_buffer`");
|
||||||
|
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioAggregator>()
|
.unsafe_cast_ref::<AudioAggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -80,7 +80,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
|
||||||
.expect("Missing parent function `aggregate_one_buffer`");
|
.expect("Missing parent function `aggregate_one_buffer`");
|
||||||
|
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioAggregator>()
|
.unsafe_cast_ref::<AudioAggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
|
|
@ -44,7 +44,7 @@ impl<T: AudioAggregatorPadImpl> AudioAggregatorPadImplExt for T {
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioAggregatorPadClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioAggregatorPadClass;
|
||||||
if let Some(f) = (*parent_class).update_conversion_info {
|
if let Some(f) = (*parent_class).update_conversion_info {
|
||||||
f(self
|
f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioAggregatorPad>()
|
.unsafe_cast_ref::<AudioAggregatorPad>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0);
|
.0);
|
||||||
|
@ -65,7 +65,7 @@ impl<T: AudioAggregatorPadImpl> AudioAggregatorPadImplExt for T {
|
||||||
.convert_buffer
|
.convert_buffer
|
||||||
.expect("Missing parent function `convert_buffer`");
|
.expect("Missing parent function `convert_buffer`");
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioAggregatorPad>()
|
.unsafe_cast_ref::<AudioAggregatorPad>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
|
|
@ -144,7 +144,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.open
|
.open
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -169,7 +169,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.close
|
.close
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -194,7 +194,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -219,7 +219,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -245,7 +245,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -269,7 +269,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
let mut offset = mem::MaybeUninit::uninit();
|
let mut offset = mem::MaybeUninit::uninit();
|
||||||
let mut len = mem::MaybeUninit::uninit();
|
let mut len = mem::MaybeUninit::uninit();
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -300,7 +300,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.handle_frame
|
.handle_frame
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -320,7 +320,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
if let Some(f) = (*parent_class).pre_push {
|
if let Some(f) = (*parent_class).pre_push {
|
||||||
let mut buffer = buffer.into_glib_ptr();
|
let mut buffer = buffer.into_glib_ptr();
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -341,7 +341,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.flush
|
.flush
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -361,7 +361,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0),
|
.0),
|
||||||
|
@ -381,7 +381,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.getcaps
|
.getcaps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -389,7 +389,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.proxy_getcaps(None, filter)
|
.proxy_getcaps(None, filter)
|
||||||
})
|
})
|
||||||
|
@ -404,7 +404,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.sink_event
|
.sink_event
|
||||||
.expect("Missing parent function `sink_event`");
|
.expect("Missing parent function `sink_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -421,7 +421,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.sink_query
|
.sink_query
|
||||||
.expect("Missing parent function `sink_query`");
|
.expect("Missing parent function `sink_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -438,7 +438,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.src_event
|
.src_event
|
||||||
.expect("Missing parent function `src_event`");
|
.expect("Missing parent function `src_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -455,7 +455,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.src_query
|
.src_query
|
||||||
.expect("Missing parent function `src_query`");
|
.expect("Missing parent function `src_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -476,7 +476,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -502,7 +502,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioDecoder>()
|
.unsafe_cast_ref::<AudioDecoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
|
|
@ -138,7 +138,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.open
|
.open
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -163,7 +163,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.close
|
.close
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -188,7 +188,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -213,7 +213,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -239,7 +239,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -264,7 +264,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.handle_frame
|
.handle_frame
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -284,7 +284,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
if let Some(f) = (*parent_class).pre_push {
|
if let Some(f) = (*parent_class).pre_push {
|
||||||
let mut buffer = buffer.into_glib_ptr();
|
let mut buffer = buffer.into_glib_ptr();
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -305,7 +305,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.flush
|
.flush
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
f(self
|
f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0)
|
.0)
|
||||||
|
@ -323,7 +323,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0),
|
.0),
|
||||||
|
@ -343,7 +343,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.getcaps
|
.getcaps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -351,7 +351,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.proxy_getcaps(None, filter)
|
.proxy_getcaps(None, filter)
|
||||||
})
|
})
|
||||||
|
@ -366,7 +366,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.sink_event
|
.sink_event
|
||||||
.expect("Missing parent function `sink_event`");
|
.expect("Missing parent function `sink_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -383,7 +383,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.sink_query
|
.sink_query
|
||||||
.expect("Missing parent function `sink_query`");
|
.expect("Missing parent function `sink_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -400,7 +400,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.src_event
|
.src_event
|
||||||
.expect("Missing parent function `src_event`");
|
.expect("Missing parent function `src_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -417,7 +417,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.src_query
|
.src_query
|
||||||
.expect("Missing parent function `src_query`");
|
.expect("Missing parent function `src_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -438,7 +438,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -464,7 +464,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AudioEncoder>()
|
.unsafe_cast_ref::<AudioEncoder>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
|
78
gstreamer-audio/src/subclass/audio_filter.rs
Normal file
78
gstreamer-audio/src/subclass/audio_filter.rs
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||||
|
|
||||||
|
use glib::translate::*;
|
||||||
|
|
||||||
|
use gst_base::prelude::*;
|
||||||
|
use gst_base::subclass::prelude::*;
|
||||||
|
|
||||||
|
use crate::AudioFilter;
|
||||||
|
use crate::AudioInfo;
|
||||||
|
|
||||||
|
pub trait AudioFilterImpl: AudioFilterImplExt + BaseTransformImpl {
|
||||||
|
fn allowed_caps() -> &'static gst::Caps;
|
||||||
|
|
||||||
|
fn setup(&self, info: &AudioInfo) -> Result<(), gst::LoggableError> {
|
||||||
|
self.parent_setup(info)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait AudioFilterImplExt: ObjectSubclass {
|
||||||
|
fn parent_setup(&self, info: &AudioInfo) -> Result<(), gst::LoggableError>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T: AudioFilterImpl> AudioFilterImplExt for T {
|
||||||
|
fn parent_setup(&self, info: &AudioInfo) -> Result<(), gst::LoggableError> {
|
||||||
|
unsafe {
|
||||||
|
let data = Self::type_data();
|
||||||
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioFilterClass;
|
||||||
|
(*parent_class)
|
||||||
|
.setup
|
||||||
|
.map(|f| {
|
||||||
|
gst::result_from_gboolean!(
|
||||||
|
f(
|
||||||
|
self.obj().unsafe_cast_ref::<AudioFilter>().to_glib_none().0,
|
||||||
|
info.to_glib_none().0,
|
||||||
|
),
|
||||||
|
gst::CAT_RUST,
|
||||||
|
"Parent function `setup` failed"
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.unwrap_or(Ok(()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe impl<T: AudioFilterImpl> IsSubclassable<T> for AudioFilter {
|
||||||
|
fn class_init(klass: &mut glib::Class<Self>) {
|
||||||
|
Self::parent_class_init::<T>(klass);
|
||||||
|
|
||||||
|
let klass = klass.as_mut();
|
||||||
|
klass.setup = Some(audio_filter_setup::<T>);
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
ffi::gst_audio_filter_class_add_pad_templates(
|
||||||
|
&mut *klass,
|
||||||
|
T::allowed_caps().to_glib_none().0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe extern "C" fn audio_filter_setup<T: AudioFilterImpl>(
|
||||||
|
ptr: *mut ffi::GstAudioFilter,
|
||||||
|
info: *const ffi::GstAudioInfo,
|
||||||
|
) -> glib::ffi::gboolean {
|
||||||
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
|
let imp = instance.imp();
|
||||||
|
|
||||||
|
gst::panic_to_error!(imp, false, {
|
||||||
|
match imp.setup(&from_glib_none(info)) {
|
||||||
|
Ok(()) => true,
|
||||||
|
Err(err) => {
|
||||||
|
err.log_with_imp(imp);
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.into_glib()
|
||||||
|
}
|
|
@ -60,11 +60,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
Some(f) => f,
|
Some(f) => f,
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to close element using the parent function"
|
"Failed to close element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -79,11 +75,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
Some(f) => f,
|
Some(f) => f,
|
||||||
None => return 0,
|
None => return 0,
|
||||||
};
|
};
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0)
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,11 +88,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to open element using the parent function"
|
"Failed to open element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -117,10 +105,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
&mut spec.0
|
&mut spec.0
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -143,11 +128,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to unprepare element using the parent function"
|
"Failed to unprepare element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -164,10 +145,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
};
|
};
|
||||||
let buffer_ptr = buffer.as_ptr() as *const _ as *mut _;
|
let buffer_ptr = buffer.as_ptr() as *const _ as *mut _;
|
||||||
let ret = f(
|
let ret = f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer_ptr,
|
buffer_ptr,
|
||||||
buffer.len() as u32,
|
buffer.len() as u32,
|
||||||
);
|
);
|
||||||
|
@ -187,11 +165,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
|
||||||
let data = Self::type_data();
|
let data = Self::type_data();
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
|
||||||
if let Some(f) = (*parent_class).reset {
|
if let Some(f) = (*parent_class).reset {
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0)
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,11 +65,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
Some(f) => f,
|
Some(f) => f,
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to close element using the parent function"
|
"Failed to close element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -84,11 +80,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
Some(f) => f,
|
Some(f) => f,
|
||||||
None => return 0,
|
None => return 0,
|
||||||
};
|
};
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0)
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,11 +93,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
None => return Ok(()),
|
None => return Ok(()),
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to open element using the parent function"
|
"Failed to open element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -122,10 +110,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
&mut spec.0
|
&mut spec.0
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -148,11 +133,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Failed to unprepare element using the parent function"
|
"Failed to unprepare element using the parent function"
|
||||||
)
|
)
|
||||||
|
@ -173,10 +154,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
let buffer_ptr = buffer.as_mut_ptr() as *mut _;
|
let buffer_ptr = buffer.as_mut_ptr() as *mut _;
|
||||||
let mut timestamp = mem::MaybeUninit::uninit();
|
let mut timestamp = mem::MaybeUninit::uninit();
|
||||||
let ret = f(
|
let ret = f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer_ptr,
|
buffer_ptr,
|
||||||
buffer.len() as u32,
|
buffer.len() as u32,
|
||||||
timestamp.as_mut_ptr(),
|
timestamp.as_mut_ptr(),
|
||||||
|
@ -197,11 +175,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
|
||||||
let data = Self::type_data();
|
let data = Self::type_data();
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
|
||||||
if let Some(f) = (*parent_class).reset {
|
if let Some(f) = (*parent_class).reset {
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0)
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<AudioSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ mod audio_base_sink;
|
||||||
mod audio_base_src;
|
mod audio_base_src;
|
||||||
mod audio_decoder;
|
mod audio_decoder;
|
||||||
mod audio_encoder;
|
mod audio_encoder;
|
||||||
|
mod audio_filter;
|
||||||
mod audio_sink;
|
mod audio_sink;
|
||||||
mod audio_src;
|
mod audio_src;
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ pub mod prelude {
|
||||||
pub use super::audio_base_src::AudioBaseSrcImpl;
|
pub use super::audio_base_src::AudioBaseSrcImpl;
|
||||||
pub use super::audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt};
|
pub use super::audio_decoder::{AudioDecoderImpl, AudioDecoderImplExt};
|
||||||
pub use super::audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt};
|
pub use super::audio_encoder::{AudioEncoderImpl, AudioEncoderImplExt};
|
||||||
|
pub use super::audio_filter::{AudioFilterImpl, AudioFilterImplExt};
|
||||||
pub use super::audio_sink::{AudioSinkImpl, AudioSinkImplExt};
|
pub use super::audio_sink::{AudioSinkImpl, AudioSinkImplExt};
|
||||||
pub use super::audio_src::{AudioSrcImpl, AudioSrcImplExt};
|
pub use super::audio_src::{AudioSrcImpl, AudioSrcImplExt};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,17 +7,23 @@ 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.16"
|
||||||
|
version = "0.16"
|
||||||
|
|
||||||
[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.16"
|
||||||
|
version = "0.16"
|
||||||
|
|
||||||
[dependencies.gst_base]
|
[dependencies.gst_base]
|
||||||
package = "gstreamer-base-sys"
|
package = "gstreamer-base-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer-base/sys"
|
path = "../../gstreamer-base/sys"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
package = "gstreamer-sys"
|
package = "gstreamer-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer/sys"
|
path = "../../gstreamer/sys"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -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.19.0"
|
version = "0.19.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.63"
|
rust-version = "1.63"
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
|
|
|
@ -7,6 +7,7 @@ work_mode = "sys"
|
||||||
single_version_file = true
|
single_version_file = true
|
||||||
|
|
||||||
extra_versions = [
|
extra_versions = [
|
||||||
|
"1.22",
|
||||||
"1.20",
|
"1.20",
|
||||||
"1.18",
|
"1.18",
|
||||||
"1.16",
|
"1.16",
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn main() {} // prevent linking libraries to avoid documentation failure
|
||||||
#[cfg(not(feature = "dox"))]
|
#[cfg(not(feature = "dox"))]
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(s) = system_deps::Config::new().probe() {
|
if let Err(s) = system_deps::Config::new().probe() {
|
||||||
println!("cargo:warning={}", s);
|
println!("cargo:warning={s}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -204,7 +204,7 @@ pub const GST_AUDIO_CONVERTER_OPT_QUANTIZATION: *const c_char =
|
||||||
b"GstAudioConverter.quantization\0" as *const u8 as *const c_char;
|
b"GstAudioConverter.quantization\0" as *const u8 as *const c_char;
|
||||||
pub const GST_AUDIO_CONVERTER_OPT_RESAMPLER_METHOD: *const c_char =
|
pub const GST_AUDIO_CONVERTER_OPT_RESAMPLER_METHOD: *const c_char =
|
||||||
b"GstAudioConverter.resampler-method\0" as *const u8 as *const c_char;
|
b"GstAudioConverter.resampler-method\0" as *const u8 as *const c_char;
|
||||||
pub const GST_AUDIO_DECODER_MAX_ERRORS: c_int = 10;
|
pub const GST_AUDIO_DECODER_MAX_ERRORS: c_int = -1;
|
||||||
pub const GST_AUDIO_DECODER_SINK_NAME: *const c_char = b"sink\0" as *const u8 as *const c_char;
|
pub const GST_AUDIO_DECODER_SINK_NAME: *const c_char = b"sink\0" as *const u8 as *const c_char;
|
||||||
pub const GST_AUDIO_DECODER_SRC_NAME: *const c_char = b"src\0" as *const u8 as *const c_char;
|
pub const GST_AUDIO_DECODER_SRC_NAME: *const c_char = b"src\0" as *const u8 as *const c_char;
|
||||||
pub const GST_AUDIO_DEF_CHANNELS: c_int = 2;
|
pub const GST_AUDIO_DEF_CHANNELS: c_int = 2;
|
||||||
|
@ -338,7 +338,7 @@ pub struct GstAudioAggregatorClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregatorClass {
|
impl ::std::fmt::Debug for GstAudioAggregatorClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregatorClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregatorClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("create_output_buffer", &self.create_output_buffer)
|
.field("create_output_buffer", &self.create_output_buffer)
|
||||||
.field("aggregate_one_buffer", &self.aggregate_one_buffer)
|
.field("aggregate_one_buffer", &self.aggregate_one_buffer)
|
||||||
|
@ -355,7 +355,7 @@ pub struct GstAudioAggregatorConvertPadClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregatorConvertPadClass {
|
impl ::std::fmt::Debug for GstAudioAggregatorConvertPadClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregatorConvertPadClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregatorConvertPadClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ pub struct GstAudioAggregatorPadClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregatorPadClass {
|
impl ::std::fmt::Debug for GstAudioAggregatorPadClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregatorPadClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregatorPadClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("convert_buffer", &self.convert_buffer)
|
.field("convert_buffer", &self.convert_buffer)
|
||||||
.field("update_conversion_info", &self.update_conversion_info)
|
.field("update_conversion_info", &self.update_conversion_info)
|
||||||
|
@ -425,7 +425,7 @@ pub struct GstAudioBaseSinkClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioBaseSinkClass {
|
impl ::std::fmt::Debug for GstAudioBaseSinkClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioBaseSinkClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioBaseSinkClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("create_ringbuffer", &self.create_ringbuffer)
|
.field("create_ringbuffer", &self.create_ringbuffer)
|
||||||
.field("payload", &self.payload)
|
.field("payload", &self.payload)
|
||||||
|
@ -452,7 +452,7 @@ pub struct GstAudioBaseSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioBaseSrcClass {
|
impl ::std::fmt::Debug for GstAudioBaseSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioBaseSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioBaseSrcClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("create_ringbuffer", &self.create_ringbuffer)
|
.field("create_ringbuffer", &self.create_ringbuffer)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -483,7 +483,7 @@ pub struct GstAudioBuffer {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioBuffer {
|
impl ::std::fmt::Debug for GstAudioBuffer {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioBuffer @ {:p}", self))
|
f.debug_struct(&format!("GstAudioBuffer @ {self:p}"))
|
||||||
.field("info", &self.info)
|
.field("info", &self.info)
|
||||||
.field("n_samples", &self.n_samples)
|
.field("n_samples", &self.n_samples)
|
||||||
.field("n_planes", &self.n_planes)
|
.field("n_planes", &self.n_planes)
|
||||||
|
@ -505,7 +505,7 @@ pub struct GstAudioCdSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioCdSrcClass {
|
impl ::std::fmt::Debug for GstAudioCdSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioCdSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioCdSrcClass @ {self:p}"))
|
||||||
.field("pushsrc_class", &self.pushsrc_class)
|
.field("pushsrc_class", &self.pushsrc_class)
|
||||||
.field("open", &self.open)
|
.field("open", &self.open)
|
||||||
.field("close", &self.close)
|
.field("close", &self.close)
|
||||||
|
@ -536,7 +536,7 @@ pub struct GstAudioCdSrcTrack {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioCdSrcTrack {
|
impl ::std::fmt::Debug for GstAudioCdSrcTrack {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioCdSrcTrack @ {:p}", self))
|
f.debug_struct(&format!("GstAudioCdSrcTrack @ {self:p}"))
|
||||||
.field("is_audio", &self.is_audio)
|
.field("is_audio", &self.is_audio)
|
||||||
.field("num", &self.num)
|
.field("num", &self.num)
|
||||||
.field("start", &self.start)
|
.field("start", &self.start)
|
||||||
|
@ -565,7 +565,7 @@ pub struct GstAudioClippingMeta {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioClippingMeta {
|
impl ::std::fmt::Debug for GstAudioClippingMeta {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioClippingMeta @ {:p}", self))
|
f.debug_struct(&format!("GstAudioClippingMeta @ {self:p}"))
|
||||||
.field("meta", &self.meta)
|
.field("meta", &self.meta)
|
||||||
.field("format", &self.format)
|
.field("format", &self.format)
|
||||||
.field("start", &self.start)
|
.field("start", &self.start)
|
||||||
|
@ -583,7 +583,7 @@ pub struct GstAudioClockClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioClockClass {
|
impl ::std::fmt::Debug for GstAudioClockClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioClockClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioClockClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,7 @@ pub struct GstAudioConverter {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioConverter {
|
impl ::std::fmt::Debug for GstAudioConverter {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioConverter @ {:p}", self))
|
f.debug_struct(&format!("GstAudioConverter @ {self:p}"))
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -655,7 +655,7 @@ pub struct GstAudioDecoderClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioDecoderClass {
|
impl ::std::fmt::Debug for GstAudioDecoderClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioDecoderClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioDecoderClass @ {self:p}"))
|
||||||
.field("element_class", &self.element_class)
|
.field("element_class", &self.element_class)
|
||||||
.field("start", &self.start)
|
.field("start", &self.start)
|
||||||
.field("stop", &self.stop)
|
.field("stop", &self.stop)
|
||||||
|
@ -700,7 +700,7 @@ pub struct GstAudioDownmixMeta {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioDownmixMeta {
|
impl ::std::fmt::Debug for GstAudioDownmixMeta {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioDownmixMeta @ {:p}", self))
|
f.debug_struct(&format!("GstAudioDownmixMeta @ {self:p}"))
|
||||||
.field("meta", &self.meta)
|
.field("meta", &self.meta)
|
||||||
.field("from_position", &self.from_position)
|
.field("from_position", &self.from_position)
|
||||||
.field("to_position", &self.to_position)
|
.field("to_position", &self.to_position)
|
||||||
|
@ -756,7 +756,7 @@ pub struct GstAudioEncoderClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioEncoderClass {
|
impl ::std::fmt::Debug for GstAudioEncoderClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioEncoderClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioEncoderClass @ {self:p}"))
|
||||||
.field("element_class", &self.element_class)
|
.field("element_class", &self.element_class)
|
||||||
.field("start", &self.start)
|
.field("start", &self.start)
|
||||||
.field("stop", &self.stop)
|
.field("stop", &self.stop)
|
||||||
|
@ -797,7 +797,7 @@ pub struct GstAudioFilterClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioFilterClass {
|
impl ::std::fmt::Debug for GstAudioFilterClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioFilterClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioFilterClass @ {self:p}"))
|
||||||
.field("basetransformclass", &self.basetransformclass)
|
.field("basetransformclass", &self.basetransformclass)
|
||||||
.field("setup", &self.setup)
|
.field("setup", &self.setup)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -823,7 +823,7 @@ pub struct GstAudioFormatInfo {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioFormatInfo {
|
impl ::std::fmt::Debug for GstAudioFormatInfo {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioFormatInfo @ {:p}", self))
|
f.debug_struct(&format!("GstAudioFormatInfo @ {self:p}"))
|
||||||
.field("format", &self.format)
|
.field("format", &self.format)
|
||||||
.field("name", &self.name)
|
.field("name", &self.name)
|
||||||
.field("description", &self.description)
|
.field("description", &self.description)
|
||||||
|
@ -854,7 +854,7 @@ pub struct GstAudioInfo {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioInfo {
|
impl ::std::fmt::Debug for GstAudioInfo {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioInfo @ {:p}", self))
|
f.debug_struct(&format!("GstAudioInfo @ {self:p}"))
|
||||||
.field("finfo", &self.finfo)
|
.field("finfo", &self.finfo)
|
||||||
.field("flags", &self.flags)
|
.field("flags", &self.flags)
|
||||||
.field("layout", &self.layout)
|
.field("layout", &self.layout)
|
||||||
|
@ -875,7 +875,7 @@ pub struct GstAudioLevelMeta {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioLevelMeta {
|
impl ::std::fmt::Debug for GstAudioLevelMeta {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioLevelMeta @ {:p}", self))
|
f.debug_struct(&format!("GstAudioLevelMeta @ {self:p}"))
|
||||||
.field("meta", &self.meta)
|
.field("meta", &self.meta)
|
||||||
.field("level", &self.level)
|
.field("level", &self.level)
|
||||||
.field("voice_activity", &self.voice_activity)
|
.field("voice_activity", &self.voice_activity)
|
||||||
|
@ -896,7 +896,7 @@ pub struct GstAudioMeta {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioMeta {
|
impl ::std::fmt::Debug for GstAudioMeta {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioMeta @ {:p}", self))
|
f.debug_struct(&format!("GstAudioMeta @ {self:p}"))
|
||||||
.field("meta", &self.meta)
|
.field("meta", &self.meta)
|
||||||
.field("info", &self.info)
|
.field("info", &self.info)
|
||||||
.field("samples", &self.samples)
|
.field("samples", &self.samples)
|
||||||
|
@ -953,7 +953,7 @@ pub struct GstAudioRingBufferClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioRingBufferClass {
|
impl ::std::fmt::Debug for GstAudioRingBufferClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioRingBufferClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioRingBufferClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("open_device", &self.open_device)
|
.field("open_device", &self.open_device)
|
||||||
.field("acquire", &self.acquire)
|
.field("acquire", &self.acquire)
|
||||||
|
@ -987,7 +987,7 @@ pub struct GstAudioRingBufferSpec {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioRingBufferSpec {
|
impl ::std::fmt::Debug for GstAudioRingBufferSpec {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioRingBufferSpec @ {:p}", self))
|
f.debug_struct(&format!("GstAudioRingBufferSpec @ {self:p}"))
|
||||||
.field("caps", &self.caps)
|
.field("caps", &self.caps)
|
||||||
.field("type_", &self.type_)
|
.field("type_", &self.type_)
|
||||||
.field("info", &self.info)
|
.field("info", &self.info)
|
||||||
|
@ -1020,7 +1020,7 @@ pub struct GstAudioSinkClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioSinkClass {
|
impl ::std::fmt::Debug for GstAudioSinkClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioSinkClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioSinkClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("open", &self.open)
|
.field("open", &self.open)
|
||||||
.field("prepare", &self.prepare)
|
.field("prepare", &self.prepare)
|
||||||
|
@ -1045,7 +1045,7 @@ pub struct GstAudioSinkClassExtension {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioSinkClassExtension {
|
impl ::std::fmt::Debug for GstAudioSinkClassExtension {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioSinkClassExtension @ {:p}", self))
|
f.debug_struct(&format!("GstAudioSinkClassExtension @ {self:p}"))
|
||||||
.field("clear_all", &self.clear_all)
|
.field("clear_all", &self.clear_all)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1070,7 +1070,7 @@ pub struct GstAudioSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioSrcClass {
|
impl ::std::fmt::Debug for GstAudioSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstAudioSrcClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("open", &self.open)
|
.field("open", &self.open)
|
||||||
.field("prepare", &self.prepare)
|
.field("prepare", &self.prepare)
|
||||||
|
@ -1091,7 +1091,7 @@ pub struct GstAudioStreamAlign {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioStreamAlign {
|
impl ::std::fmt::Debug for GstAudioStreamAlign {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioStreamAlign @ {:p}", self))
|
f.debug_struct(&format!("GstAudioStreamAlign @ {self:p}"))
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1104,7 +1104,7 @@ pub struct GstStreamVolumeInterface {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstStreamVolumeInterface {
|
impl ::std::fmt::Debug for GstStreamVolumeInterface {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstStreamVolumeInterface @ {:p}", self))
|
f.debug_struct(&format!("GstStreamVolumeInterface @ {self:p}"))
|
||||||
.field("iface", &self.iface)
|
.field("iface", &self.iface)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1122,7 +1122,7 @@ pub struct GstAudioAggregator {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregator {
|
impl ::std::fmt::Debug for GstAudioAggregator {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregator @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregator @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.field("current_caps", &self.current_caps)
|
.field("current_caps", &self.current_caps)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1139,7 +1139,7 @@ pub struct GstAudioAggregatorConvertPad {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregatorConvertPad {
|
impl ::std::fmt::Debug for GstAudioAggregatorConvertPad {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregatorConvertPad @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregatorConvertPad @ {self:p}"))
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1155,7 +1155,7 @@ pub struct GstAudioAggregatorPad {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioAggregatorPad {
|
impl ::std::fmt::Debug for GstAudioAggregatorPad {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioAggregatorPad @ {:p}", self))
|
f.debug_struct(&format!("GstAudioAggregatorPad @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.field("info", &self.info)
|
.field("info", &self.info)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1178,7 +1178,7 @@ pub struct GstAudioBaseSink {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioBaseSink {
|
impl ::std::fmt::Debug for GstAudioBaseSink {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioBaseSink @ {:p}", self))
|
f.debug_struct(&format!("GstAudioBaseSink @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("ringbuffer", &self.ringbuffer)
|
.field("ringbuffer", &self.ringbuffer)
|
||||||
.field("buffer_time", &self.buffer_time)
|
.field("buffer_time", &self.buffer_time)
|
||||||
|
@ -1205,7 +1205,7 @@ pub struct GstAudioBaseSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioBaseSrc {
|
impl ::std::fmt::Debug for GstAudioBaseSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioBaseSrc @ {:p}", self))
|
f.debug_struct(&format!("GstAudioBaseSrc @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("ringbuffer", &self.ringbuffer)
|
.field("ringbuffer", &self.ringbuffer)
|
||||||
.field("buffer_time", &self.buffer_time)
|
.field("buffer_time", &self.buffer_time)
|
||||||
|
@ -1228,7 +1228,7 @@ pub struct GstAudioCdSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioCdSrc {
|
impl ::std::fmt::Debug for GstAudioCdSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioCdSrc @ {:p}", self))
|
f.debug_struct(&format!("GstAudioCdSrc @ {self:p}"))
|
||||||
.field("pushsrc", &self.pushsrc)
|
.field("pushsrc", &self.pushsrc)
|
||||||
.field("tags", &self.tags)
|
.field("tags", &self.tags)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1249,7 +1249,7 @@ pub struct GstAudioClock {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioClock {
|
impl ::std::fmt::Debug for GstAudioClock {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioClock @ {:p}", self))
|
f.debug_struct(&format!("GstAudioClock @ {self:p}"))
|
||||||
.field("clock", &self.clock)
|
.field("clock", &self.clock)
|
||||||
.field("func", &self.func)
|
.field("func", &self.func)
|
||||||
.field("user_data", &self.user_data)
|
.field("user_data", &self.user_data)
|
||||||
|
@ -1273,7 +1273,7 @@ pub struct GstAudioDecoder {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioDecoder {
|
impl ::std::fmt::Debug for GstAudioDecoder {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioDecoder @ {:p}", self))
|
f.debug_struct(&format!("GstAudioDecoder @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("sinkpad", &self.sinkpad)
|
.field("sinkpad", &self.sinkpad)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
|
@ -1299,7 +1299,7 @@ pub struct GstAudioEncoder {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioEncoder {
|
impl ::std::fmt::Debug for GstAudioEncoder {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioEncoder @ {:p}", self))
|
f.debug_struct(&format!("GstAudioEncoder @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("sinkpad", &self.sinkpad)
|
.field("sinkpad", &self.sinkpad)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
|
@ -1320,7 +1320,7 @@ pub struct GstAudioFilter {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioFilter {
|
impl ::std::fmt::Debug for GstAudioFilter {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioFilter @ {:p}", self))
|
f.debug_struct(&format!("GstAudioFilter @ {self:p}"))
|
||||||
.field("basetransform", &self.basetransform)
|
.field("basetransform", &self.basetransform)
|
||||||
.field("info", &self.info)
|
.field("info", &self.info)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1357,7 +1357,7 @@ pub struct GstAudioRingBuffer {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioRingBuffer {
|
impl ::std::fmt::Debug for GstAudioRingBuffer {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioRingBuffer @ {:p}", self))
|
f.debug_struct(&format!("GstAudioRingBuffer @ {self:p}"))
|
||||||
.field("object", &self.object)
|
.field("object", &self.object)
|
||||||
.field("cond", &self.cond)
|
.field("cond", &self.cond)
|
||||||
.field("open", &self.open)
|
.field("open", &self.open)
|
||||||
|
@ -1385,7 +1385,7 @@ pub struct GstAudioSink {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioSink {
|
impl ::std::fmt::Debug for GstAudioSink {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioSink @ {:p}", self))
|
f.debug_struct(&format!("GstAudioSink @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1401,7 +1401,7 @@ pub struct GstAudioSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAudioSrc {
|
impl ::std::fmt::Debug for GstAudioSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAudioSrc @ {:p}", self))
|
f.debug_struct(&format!("GstAudioSrc @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1416,7 +1416,7 @@ pub struct GstStreamVolume {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstStreamVolume {
|
impl ::std::fmt::Debug for GstStreamVolume {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
write!(f, "GstStreamVolume @ {:p}", self)
|
write!(f, "GstStreamVolume @ {self:p}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Compiler {
|
||||||
cmd.arg(out);
|
cmd.arg(out);
|
||||||
let status = cmd.spawn()?.wait()?;
|
let status = cmd.spawn()?.wait()?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
return Err(format!("compilation command {cmd:?} failed, {status}").into());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
match env::var(name) {
|
match env::var(name) {
|
||||||
Ok(value) => Ok(shell_words::split(&value)?),
|
Ok(value) => Ok(shell_words::split(&value)?),
|
||||||
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
||||||
Err(err) => Err(format!("{} {}", name, err).into()),
|
Err(err) => Err(format!("{name} {err}").into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
cmd.args(packages);
|
cmd.args(packages);
|
||||||
let out = cmd.output()?;
|
let out = cmd.output()?;
|
||||||
if !out.status.success() {
|
if !out.status.success() {
|
||||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
return Err(format!("command {cmd:?} returned {}", out.status).into());
|
||||||
}
|
}
|
||||||
let stdout = str::from_utf8(&out.stdout)?;
|
let stdout = str::from_utf8(&out.stdout)?;
|
||||||
Ok(shell_words::split(stdout.trim())?)
|
Ok(shell_words::split(stdout.trim())?)
|
||||||
|
@ -127,15 +127,14 @@ fn cross_validate_constants_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_value != c_value {
|
if rust_value != c_value {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
|
||||||
rust_name, rust_value, &c_value
|
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -165,16 +164,13 @@ fn cross_validate_layout_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_layout != c_layout {
|
if rust_layout != c_layout {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
|
||||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
|
||||||
rust_name, rust_layout, &c_layout
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +191,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||||
let mut abi_cmd = Command::new(exe);
|
let mut abi_cmd = Command::new(exe);
|
||||||
let output = abi_cmd.output()?;
|
let output = abi_cmd.output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(String::from_utf8(output.stdout)?)
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
|
@ -722,7 +718,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||||
"GST_AUDIO_CONVERTER_OPT_RESAMPLER_METHOD",
|
"GST_AUDIO_CONVERTER_OPT_RESAMPLER_METHOD",
|
||||||
"GstAudioConverter.resampler-method",
|
"GstAudioConverter.resampler-method",
|
||||||
),
|
),
|
||||||
("GST_AUDIO_DECODER_MAX_ERRORS", "10"),
|
("GST_AUDIO_DECODER_MAX_ERRORS", "-1"),
|
||||||
("GST_AUDIO_DECODER_SINK_NAME", "sink"),
|
("GST_AUDIO_DECODER_SINK_NAME", "sink"),
|
||||||
("GST_AUDIO_DECODER_SRC_NAME", "src"),
|
("GST_AUDIO_DECODER_SRC_NAME", "src"),
|
||||||
("GST_AUDIO_DEF_CHANNELS", "2"),
|
("GST_AUDIO_DEF_CHANNELS", "2"),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gstreamer-base"
|
name = "gstreamer-base"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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,9 +17,9 @@ rust-version = "1.63"
|
||||||
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", version = "0.19", path = "sys" }
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
atomic_refcell = "0.1"
|
atomic_refcell = "0.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -107,22 +107,37 @@ status = "generate"
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "type_find_helper_for_data"
|
name = "type_find_helper_for_data"
|
||||||
# broken return value
|
# broken return value
|
||||||
ignore = true
|
manual = true
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "type_find_helper_for_data_with_extension"
|
name = "type_find_helper_for_data_with_extension"
|
||||||
# broken return value
|
# broken return value
|
||||||
ignore = true
|
manual = true
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "type_find_helper_for_buffer"
|
name = "type_find_helper_for_buffer"
|
||||||
# broken return value
|
# broken return value
|
||||||
ignore = true
|
manual = true
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "type_find_helper_for_buffer_with_extension"
|
name = "type_find_helper_for_buffer_with_extension"
|
||||||
# broken return value
|
# broken return value
|
||||||
ignore = true
|
manual = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "type_find_helper_for_buffer_with_caps"
|
||||||
|
# broken return value
|
||||||
|
manual = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "type_find_helper_for_data_with_caps"
|
||||||
|
# broken return value
|
||||||
|
manual = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "type_find_list_factories_for_caps"
|
||||||
|
# broken return value
|
||||||
|
manual = true
|
||||||
|
|
||||||
[[object.function]]
|
[[object.function]]
|
||||||
name = "type_find_helper"
|
name = "type_find_helper"
|
||||||
|
|
|
@ -66,6 +66,26 @@ You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
|
||||||
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
||||||
provided by the GStreamer project.
|
provided by the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over Homebrew, especially
|
||||||
|
as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964).
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||||
|
install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and
|
||||||
|
`gstreamer-1.0-devel-1.20.4-universal.pkg`.
|
||||||
|
|
||||||
|
After installation, you also need to set the `PATH` environment variable as
|
||||||
|
follows
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Also note that the `pkg-config` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### Homebrew
|
#### Homebrew
|
||||||
|
|
||||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||||
|
@ -81,19 +101,6 @@ $ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||||
|
|
||||||
Make sure the version of these libraries is >= 1.14.
|
Make sure the version of these libraries is >= 1.14.
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
|
||||||
install them, e.g. `gstreamer-1.0-1.14.0-x86_64.pkg` and
|
|
||||||
`gstreamer-1.0-devel-1.14.0-x86_64.pkg`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="installation-windows"/>
|
<a name="installation-windows"/>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -103,6 +110,32 @@ with `pacman` or by installing the
|
||||||
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
||||||
the GStreamer project.
|
the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over MSYS2.
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.msi` files for your platform from the
|
||||||
|
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and
|
||||||
|
`gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that
|
||||||
|
matches your Rust toolchain, i.e. MinGW or MSVC.
|
||||||
|
|
||||||
|
After installation set the ``PATH` environment variable as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# For a UNIX-style shell:
|
||||||
|
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"
|
||||||
|
|
||||||
|
# For cmd.exe:
|
||||||
|
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to update the path to where you have actually installed GStreamer
|
||||||
|
and for the corresponding toolchain.
|
||||||
|
|
||||||
|
Also note that the `pkg-config.exe` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### MSYS2 / pacman
|
#### MSYS2 / pacman
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -120,20 +153,6 @@ Note that the version of `pkg-config` included in `MSYS2` is
|
||||||
compiling GStreamer, so you may need to install another version. One option
|
compiling GStreamer, so you may need to install another version. One option
|
||||||
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.msi` files for your platform from the
|
|
||||||
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.14.0.msi` and
|
|
||||||
`gstreamer-1.0-devel-x86_64-1.14.0.msi`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
|
||||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="getting-started"/>
|
<a name="getting-started"/>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
|
@ -40,6 +40,12 @@ pub trait AggregatorExt: 'static {
|
||||||
#[doc(alias = "get_buffer_pool")]
|
#[doc(alias = "get_buffer_pool")]
|
||||||
fn buffer_pool(&self) -> Option<gst::BufferPool>;
|
fn buffer_pool(&self) -> Option<gst::BufferPool>;
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
#[doc(alias = "gst_aggregator_get_force_live")]
|
||||||
|
#[doc(alias = "get_force_live")]
|
||||||
|
fn is_force_live(&self) -> bool;
|
||||||
|
|
||||||
#[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_aggregator_get_ignore_inactive_pads")]
|
#[doc(alias = "gst_aggregator_get_ignore_inactive_pads")]
|
||||||
|
@ -60,6 +66,11 @@ pub trait AggregatorExt: 'static {
|
||||||
#[doc(alias = "gst_aggregator_peek_next_sample")]
|
#[doc(alias = "gst_aggregator_peek_next_sample")]
|
||||||
fn peek_next_sample(&self, pad: &impl IsA<AggregatorPad>) -> Option<gst::Sample>;
|
fn peek_next_sample(&self, pad: &impl IsA<AggregatorPad>) -> Option<gst::Sample>;
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
#[doc(alias = "gst_aggregator_set_force_live")]
|
||||||
|
fn set_force_live(&self, force_live: bool);
|
||||||
|
|
||||||
#[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_aggregator_set_ignore_inactive_pads")]
|
#[doc(alias = "gst_aggregator_set_ignore_inactive_pads")]
|
||||||
|
@ -142,6 +153,16 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
fn is_force_live(&self) -> bool {
|
||||||
|
unsafe {
|
||||||
|
from_glib(ffi::gst_aggregator_get_force_live(
|
||||||
|
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 ignores_inactive_pads(&self) -> bool {
|
fn ignores_inactive_pads(&self) -> bool {
|
||||||
|
@ -181,6 +202,17 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
fn set_force_live(&self, force_live: bool) {
|
||||||
|
unsafe {
|
||||||
|
ffi::gst_aggregator_set_force_live(
|
||||||
|
self.as_ref().to_glib_none().0,
|
||||||
|
force_live.into_glib(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[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 set_ignore_inactive_pads(&self, ignore: bool) {
|
fn set_ignore_inactive_pads(&self, ignore: bool) {
|
||||||
|
|
|
@ -10,15 +10,15 @@ bitflags! {
|
||||||
#[doc(alias = "GstBaseParseFrameFlags")]
|
#[doc(alias = "GstBaseParseFrameFlags")]
|
||||||
pub struct BaseParseFrameFlags: u32 {
|
pub struct BaseParseFrameFlags: u32 {
|
||||||
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME")]
|
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME")]
|
||||||
const NEW_FRAME = ffi::GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME as u32;
|
const NEW_FRAME = ffi::GST_BASE_PARSE_FRAME_FLAG_NEW_FRAME as _;
|
||||||
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_NO_FRAME")]
|
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_NO_FRAME")]
|
||||||
const NO_FRAME = ffi::GST_BASE_PARSE_FRAME_FLAG_NO_FRAME as u32;
|
const NO_FRAME = ffi::GST_BASE_PARSE_FRAME_FLAG_NO_FRAME as _;
|
||||||
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_CLIP")]
|
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_CLIP")]
|
||||||
const CLIP = ffi::GST_BASE_PARSE_FRAME_FLAG_CLIP as u32;
|
const CLIP = ffi::GST_BASE_PARSE_FRAME_FLAG_CLIP as _;
|
||||||
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_DROP")]
|
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_DROP")]
|
||||||
const DROP = ffi::GST_BASE_PARSE_FRAME_FLAG_DROP as u32;
|
const DROP = ffi::GST_BASE_PARSE_FRAME_FLAG_DROP as _;
|
||||||
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_QUEUE")]
|
#[doc(alias = "GST_BASE_PARSE_FRAME_FLAG_QUEUE")]
|
||||||
const QUEUE = ffi::GST_BASE_PARSE_FRAME_FLAG_QUEUE as u32;
|
const QUEUE = ffi::GST_BASE_PARSE_FRAME_FLAG_QUEUE as _;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -101,3 +101,63 @@ pub fn type_find_helper_for_buffer_with_extension<P: IsA<gst::Object>>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
#[doc(alias = "gst_type_find_helper_for_buffer_with_caps")]
|
||||||
|
pub fn type_find_helper_for_buffer_with_caps(
|
||||||
|
obj: Option<&impl IsA<gst::Object>>,
|
||||||
|
buf: &gst::BufferRef,
|
||||||
|
caps: &gst::CapsRef,
|
||||||
|
) -> (Option<gst::Caps>, gst::TypeFindProbability) {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
|
unsafe {
|
||||||
|
let mut prob = mem::MaybeUninit::uninit();
|
||||||
|
let ret = from_glib_full(ffi::gst_type_find_helper_for_buffer_with_caps(
|
||||||
|
obj.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
|
mut_override(buf.as_ptr()),
|
||||||
|
mut_override(caps.as_ptr()),
|
||||||
|
prob.as_mut_ptr(),
|
||||||
|
));
|
||||||
|
(ret, from_glib(prob.assume_init()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
#[doc(alias = "gst_type_find_helper_for_data_with_caps")]
|
||||||
|
pub fn type_find_helper_for_data_with_caps(
|
||||||
|
obj: Option<&impl IsA<gst::Object>>,
|
||||||
|
data: &[u8],
|
||||||
|
caps: &gst::CapsRef,
|
||||||
|
) -> (Option<gst::Caps>, gst::TypeFindProbability) {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
|
let size = data.len() as _;
|
||||||
|
unsafe {
|
||||||
|
let mut prob = mem::MaybeUninit::uninit();
|
||||||
|
let ret = from_glib_full(ffi::gst_type_find_helper_for_data_with_caps(
|
||||||
|
obj.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
|
data.to_glib_none().0,
|
||||||
|
size,
|
||||||
|
mut_override(caps.as_ptr()),
|
||||||
|
prob.as_mut_ptr(),
|
||||||
|
));
|
||||||
|
(ret, from_glib(prob.assume_init()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
#[doc(alias = "gst_type_find_list_factories_for_caps")]
|
||||||
|
pub fn type_find_list_factories_for_caps(
|
||||||
|
obj: Option<&impl IsA<gst::Object>>,
|
||||||
|
caps: &gst::CapsRef,
|
||||||
|
) -> glib::List<gst::TypeFindFactory> {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
|
unsafe {
|
||||||
|
glib::collections::List::from_glib_full(ffi::gst_type_find_list_factories_for_caps(
|
||||||
|
obj.map(|p| p.as_ref()).to_glib_none().0,
|
||||||
|
mut_override(caps.as_ptr()),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -238,7 +238,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.flush
|
.flush
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(self
|
try_from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
.unsafe_cast_ref::<Aggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -258,10 +258,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
match (*parent_class).clip {
|
match (*parent_class).clip {
|
||||||
None => Some(buffer),
|
None => Some(buffer),
|
||||||
Some(ref func) => from_glib_full(func(
|
Some(ref func) => from_glib_full(func(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
aggregator_pad.to_glib_none().0,
|
aggregator_pad.to_glib_none().0,
|
||||||
buffer.into_glib_ptr(),
|
buffer.into_glib_ptr(),
|
||||||
)),
|
)),
|
||||||
|
@ -280,10 +277,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.finish_buffer
|
.finish_buffer
|
||||||
.expect("Missing parent function `finish_buffer`");
|
.expect("Missing parent function `finish_buffer`");
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer.into_glib_ptr(),
|
buffer.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -302,10 +296,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.finish_buffer_list
|
.finish_buffer_list
|
||||||
.expect("Missing parent function `finish_buffer_list`");
|
.expect("Missing parent function `finish_buffer_list`");
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer_list.into_glib_ptr(),
|
buffer_list.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -319,10 +310,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.sink_event
|
.sink_event
|
||||||
.expect("Missing parent function `sink_event`");
|
.expect("Missing parent function `sink_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
aggregator_pad.to_glib_none().0,
|
aggregator_pad.to_glib_none().0,
|
||||||
event.into_glib_ptr(),
|
event.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -343,10 +331,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.sink_event_pre_queue
|
.sink_event_pre_queue
|
||||||
.expect("Missing parent function `sink_event_pre_queue`");
|
.expect("Missing parent function `sink_event_pre_queue`");
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
aggregator_pad.to_glib_none().0,
|
aggregator_pad.to_glib_none().0,
|
||||||
event.into_glib_ptr(),
|
event.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -361,10 +346,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.sink_query
|
.sink_query
|
||||||
.expect("Missing parent function `sink_query`");
|
.expect("Missing parent function `sink_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
aggregator_pad.to_glib_none().0,
|
aggregator_pad.to_glib_none().0,
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -385,10 +367,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.sink_query_pre_queue
|
.sink_query_pre_queue
|
||||||
.expect("Missing parent function `sink_query`");
|
.expect("Missing parent function `sink_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
aggregator_pad.to_glib_none().0,
|
aggregator_pad.to_glib_none().0,
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
|
@ -403,10 +382,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.src_event
|
.src_event
|
||||||
.expect("Missing parent function `src_event`");
|
.expect("Missing parent function `src_event`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
event.into_glib_ptr(),
|
event.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -420,10 +396,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.src_query
|
.src_query
|
||||||
.expect("Missing parent function `src_query`");
|
.expect("Missing parent function `src_query`");
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -441,10 +414,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
None => Ok(()),
|
None => Ok(()),
|
||||||
Some(f) => gst::result_from_gboolean!(
|
Some(f) => gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
mode.into_glib(),
|
mode.into_glib(),
|
||||||
active.into_glib()
|
active.into_glib()
|
||||||
),
|
),
|
||||||
|
@ -463,10 +433,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.aggregate
|
.aggregate
|
||||||
.expect("Missing parent function `aggregate`");
|
.expect("Missing parent function `aggregate`");
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
timeout.into_glib(),
|
timeout.into_glib(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -480,7 +447,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
.unsafe_cast_ref::<Aggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -505,7 +472,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
.unsafe_cast_ref::<Aggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -530,7 +497,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.get_next_time
|
.get_next_time
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(self
|
from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
.unsafe_cast_ref::<Aggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -552,10 +519,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.create_new_pad
|
.create_new_pad
|
||||||
.expect("Missing parent function `create_new_pad`");
|
.expect("Missing parent function `create_new_pad`");
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
templ.to_glib_none().0,
|
templ.to_glib_none().0,
|
||||||
req_name.to_glib_none().0,
|
req_name.to_glib_none().0,
|
||||||
caps.to_glib_none().0,
|
caps.to_glib_none().0,
|
||||||
|
@ -573,10 +537,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
|
|
||||||
let mut out_caps = ptr::null_mut();
|
let mut out_caps = ptr::null_mut();
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.as_mut_ptr(),
|
caps.as_mut_ptr(),
|
||||||
&mut out_caps,
|
&mut out_caps,
|
||||||
))
|
))
|
||||||
|
@ -593,10 +554,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.fixate_src_caps
|
.fixate_src_caps
|
||||||
.expect("Missing parent function `fixate_src_caps`");
|
.expect("Missing parent function `fixate_src_caps`");
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.into_glib_ptr(),
|
caps.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -611,10 +569,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.to_glib_none().0
|
caps.to_glib_none().0
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -639,10 +594,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
pad.to_glib_none().0,
|
pad.to_glib_none().0,
|
||||||
decide_query
|
decide_query
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
@ -670,10 +622,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -694,7 +643,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.negotiate
|
.negotiate
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(self
|
from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
.unsafe_cast_ref::<Aggregator>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -713,10 +662,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
||||||
.peek_next_sample
|
.peek_next_sample
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<Aggregator>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
pad.to_glib_none().0,
|
pad.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
|
|
@ -33,7 +33,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
|
||||||
.flush
|
.flush
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AggregatorPad>()
|
.unsafe_cast_ref::<AggregatorPad>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -52,7 +52,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
|
||||||
.skip_buffer
|
.skip_buffer
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<AggregatorPad>()
|
.unsafe_cast_ref::<AggregatorPad>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
|
|
@ -67,7 +67,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<BaseParse>()
|
.unsafe_cast_ref::<BaseParse>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -92,7 +92,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<BaseParse>()
|
.unsafe_cast_ref::<BaseParse>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -118,10 +118,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseParse>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.to_glib_none().0,
|
caps.to_glib_none().0,
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -144,10 +141,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
||||||
.handle_frame
|
.handle_frame
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let res = try_from_glib(f(
|
let res = try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseParse>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
frame.to_glib_none().0,
|
frame.to_glib_none().0,
|
||||||
&mut skipsize,
|
&mut skipsize,
|
||||||
));
|
));
|
||||||
|
@ -169,10 +163,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
|
||||||
let mut dest_val = mem::MaybeUninit::uninit();
|
let mut dest_val = mem::MaybeUninit::uninit();
|
||||||
|
|
||||||
let res = from_glib(f(
|
let res = from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseParse>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
src_val.format().into_glib(),
|
src_val.format().into_glib(),
|
||||||
src_val.into_raw_value(),
|
src_val.into_raw_value(),
|
||||||
dest_format.into_glib(),
|
dest_format.into_glib(),
|
||||||
|
@ -267,7 +258,7 @@ unsafe extern "C" fn base_parse_handle_frame<T: BaseParseImpl>(
|
||||||
) -> gst::ffi::GstFlowReturn {
|
) -> gst::ffi::GstFlowReturn {
|
||||||
let instance = &*(ptr as *mut T::Instance);
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.imp();
|
let imp = instance.imp();
|
||||||
let instance = imp.instance();
|
let instance = imp.obj();
|
||||||
let instance = instance.unsafe_cast_ref::<BaseParse>();
|
let instance = instance.unsafe_cast_ref::<BaseParse>();
|
||||||
let wrap_frame = BaseParseFrame::new(frame, instance);
|
let wrap_frame = BaseParseFrame::new(frame, instance);
|
||||||
|
|
||||||
|
|
|
@ -117,12 +117,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -142,12 +137,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -168,10 +158,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.render
|
.render
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer.to_glib_none().0,
|
buffer.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -187,10 +174,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.prepare
|
.prepare
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer.to_glib_none().0,
|
buffer.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -209,10 +193,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.render_list
|
.render_list
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
list.to_glib_none().0,
|
list.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -236,10 +217,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.prepare_list
|
.prepare_list
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
list.to_glib_none().0,
|
list.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -260,10 +238,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.query
|
.query
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -279,10 +254,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.event
|
.event
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
event.into_glib_ptr(),
|
event.into_glib_ptr(),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -299,10 +271,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.get_caps
|
.get_caps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
filter.to_glib_none().0,
|
filter.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -319,10 +288,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.to_glib_none().0
|
caps.to_glib_none().0
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -340,10 +306,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
|
|
||||||
match (*parent_class).fixate {
|
match (*parent_class).fixate {
|
||||||
Some(fixate) => from_glib_full(fixate(
|
Some(fixate) => from_glib_full(fixate(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.into_glib_ptr(),
|
caps.into_glib_ptr(),
|
||||||
)),
|
)),
|
||||||
None => caps,
|
None => caps,
|
||||||
|
@ -358,12 +321,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.unlock
|
.unlock
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -383,12 +341,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.unlock_stop
|
.unlock_stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -413,10 +366,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSink>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
|
|
@ -176,12 +176,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -201,12 +196,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -225,13 +215,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.is_seekable
|
.is_seekable
|
||||||
.map(|f| {
|
.map(|f| from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)))
|
||||||
from_glib(f(self
|
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
})
|
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,10 +229,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let mut size = mem::MaybeUninit::uninit();
|
let mut size = mem::MaybeUninit::uninit();
|
||||||
if from_glib(f(
|
if from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
size.as_mut_ptr(),
|
size.as_mut_ptr(),
|
||||||
)) {
|
)) {
|
||||||
Some(size.assume_init())
|
Some(size.assume_init())
|
||||||
|
@ -273,10 +254,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
let mut start = mem::MaybeUninit::uninit();
|
let mut start = mem::MaybeUninit::uninit();
|
||||||
let mut stop = mem::MaybeUninit::uninit();
|
let mut stop = mem::MaybeUninit::uninit();
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer.as_mut_ptr(),
|
buffer.as_mut_ptr(),
|
||||||
start.as_mut_ptr(),
|
start.as_mut_ptr(),
|
||||||
stop.as_mut_ptr(),
|
stop.as_mut_ptr(),
|
||||||
|
@ -303,10 +281,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.fill
|
.fill
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
offset,
|
offset,
|
||||||
length,
|
length,
|
||||||
buffer.as_mut_ptr(),
|
buffer.as_mut_ptr(),
|
||||||
|
@ -330,10 +305,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
|
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
|
||||||
|
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
offset,
|
offset,
|
||||||
length,
|
length,
|
||||||
buffer_ref,
|
buffer_ref,
|
||||||
|
@ -356,7 +328,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.create
|
.create
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let instance = self.instance();
|
let instance = self.obj();
|
||||||
let instance = instance.unsafe_cast_ref::<BaseSrc>();
|
let instance = instance.unsafe_cast_ref::<BaseSrc>();
|
||||||
let orig_buffer_ptr = buffer
|
let orig_buffer_ptr = buffer
|
||||||
.as_mut()
|
.as_mut()
|
||||||
|
@ -428,7 +400,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let copied_size = new_buffer.copy_to_slice(0, &mut *map);
|
let copied_size = new_buffer.copy_to_slice(0, &mut map);
|
||||||
drop(map);
|
drop(map);
|
||||||
|
|
||||||
if let Err(copied_size) = copied_size {
|
if let Err(copied_size) = copied_size {
|
||||||
|
@ -468,10 +440,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.do_seek
|
.do_seek
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
segment.to_glib_none_mut().0,
|
segment.to_glib_none_mut().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -487,10 +456,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.query
|
.query
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -506,10 +472,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.event
|
.event
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
event.to_glib_none().0,
|
event.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -526,10 +489,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.get_caps
|
.get_caps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
filter.to_glib_none().0,
|
filter.to_glib_none().0,
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -545,11 +505,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.negotiate
|
.negotiate
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(self
|
f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0),
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0),
|
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
"Parent function `negotiate` failed"
|
"Parent function `negotiate` failed"
|
||||||
)
|
)
|
||||||
|
@ -567,10 +523,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.to_glib_none().0
|
caps.to_glib_none().0
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -588,10 +541,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
|
|
||||||
match (*parent_class).fixate {
|
match (*parent_class).fixate {
|
||||||
Some(fixate) => from_glib_full(fixate(
|
Some(fixate) => from_glib_full(fixate(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
caps.into_glib_ptr(),
|
caps.into_glib_ptr(),
|
||||||
)),
|
)),
|
||||||
None => caps,
|
None => caps,
|
||||||
|
@ -606,12 +556,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.unlock
|
.unlock
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -631,12 +576,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.unlock_stop
|
.unlock_stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0))
|
|
||||||
{
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(gst::error_msg!(
|
Err(gst::error_msg!(
|
||||||
|
@ -661,10 +601,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<BaseSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
query.as_mut_ptr(),
|
query.as_mut_ptr(),
|
||||||
),
|
),
|
||||||
gst::CAT_RUST,
|
gst::CAT_RUST,
|
||||||
|
@ -840,7 +777,7 @@ unsafe extern "C" fn base_src_create<T: BaseSrcImpl>(
|
||||||
) -> gst::ffi::GstFlowReturn {
|
) -> gst::ffi::GstFlowReturn {
|
||||||
let instance = &*(ptr as *mut T::Instance);
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.imp();
|
let imp = instance.imp();
|
||||||
let instance = imp.instance();
|
let instance = imp.obj();
|
||||||
let instance = instance.unsafe_cast_ref::<BaseSrc>();
|
let instance = instance.unsafe_cast_ref::<BaseSrc>();
|
||||||
// FIXME: Wrong signature in -sys bindings
|
// FIXME: Wrong signature in -sys bindings
|
||||||
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
|
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3
|
||||||
|
@ -884,7 +821,7 @@ unsafe extern "C" fn base_src_create<T: BaseSrcImpl>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let copied_size = new_buffer.copy_to_slice(0, &mut *map);
|
let copied_size = new_buffer.copy_to_slice(0, &mut map);
|
||||||
drop(map);
|
drop(map);
|
||||||
|
|
||||||
if let Err(copied_size) = copied_size {
|
if let Err(copied_size) = copied_size {
|
||||||
|
|
|
@ -277,7 +277,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.start
|
.start
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -302,7 +302,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.stop
|
.stop
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
if from_glib(f(self
|
if from_glib(f(self
|
||||||
.instance()
|
.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0))
|
.0))
|
||||||
|
@ -332,7 +332,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.transform_caps
|
.transform_caps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib_full(f(
|
from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -356,7 +356,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
||||||
match (*parent_class).fixate_caps {
|
match (*parent_class).fixate_caps {
|
||||||
Some(f) => from_glib_full(f(
|
Some(f) => from_glib_full(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -382,7 +382,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -405,7 +405,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.accept_caps
|
.accept_caps
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -425,7 +425,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.query
|
.query
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -452,7 +452,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let mut othersize = mem::MaybeUninit::uninit();
|
let mut othersize = mem::MaybeUninit::uninit();
|
||||||
let res: bool = from_glib(f(
|
let res: bool = from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -477,11 +477,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let data = Self::type_data();
|
let data = Self::type_data();
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
||||||
let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
|
let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
|
||||||
if !self
|
if !self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
|
||||||
.is_in_place()
|
|
||||||
{
|
|
||||||
unimplemented!(concat!(
|
unimplemented!(concat!(
|
||||||
"Missing parent function `get_unit_size`. Required because ",
|
"Missing parent function `get_unit_size`. Required because ",
|
||||||
"transform doesn't operate in-place"
|
"transform doesn't operate in-place"
|
||||||
|
@ -495,7 +491,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
|
|
||||||
let mut size = mem::MaybeUninit::uninit();
|
let mut size = mem::MaybeUninit::uninit();
|
||||||
if from_glib(f(
|
if from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -517,7 +513,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.sink_event
|
.sink_event
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -536,7 +532,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.src_event
|
.src_event
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -564,7 +560,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let mut outbuf: *mut gst::ffi::GstBuffer = ptr::null_mut();
|
let mut outbuf: *mut gst::ffi::GstBuffer = ptr::null_mut();
|
||||||
// FIXME: Wrong signature in FFI
|
// FIXME: Wrong signature in FFI
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -595,7 +591,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.transform
|
.transform
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -604,11 +600,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
if !self
|
if !self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
|
||||||
.is_in_place()
|
|
||||||
{
|
|
||||||
Err(gst::FlowError::NotSupported)
|
Err(gst::FlowError::NotSupported)
|
||||||
} else {
|
} else {
|
||||||
unreachable!(concat!(
|
unreachable!(concat!(
|
||||||
|
@ -627,11 +619,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let data = Self::type_data();
|
let data = Self::type_data();
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
||||||
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
||||||
if self
|
if self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
|
||||||
.is_in_place()
|
|
||||||
{
|
|
||||||
panic!(concat!(
|
panic!(concat!(
|
||||||
"Missing parent function `transform_ip`. Required because ",
|
"Missing parent function `transform_ip`. Required because ",
|
||||||
"transform operates in-place"
|
"transform operates in-place"
|
||||||
|
@ -644,7 +632,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
});
|
});
|
||||||
|
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -661,11 +649,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let data = Self::type_data();
|
let data = Self::type_data();
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
||||||
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
|
||||||
if self
|
if self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
|
||||||
.instance()
|
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
|
||||||
.is_in_place()
|
|
||||||
{
|
|
||||||
panic!(concat!(
|
panic!(concat!(
|
||||||
"Missing parent function `transform_ip`. Required because ",
|
"Missing parent function `transform_ip`. Required because ",
|
||||||
"transform operates in-place (passthrough mode)"
|
"transform operates in-place (passthrough mode)"
|
||||||
|
@ -681,7 +665,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
// FIXME: Wrong signature in FFI
|
// FIXME: Wrong signature in FFI
|
||||||
let buf: *mut gst::ffi::GstBuffer = buf.to_glib_none().0;
|
let buf: *mut gst::ffi::GstBuffer = buf.to_glib_none().0;
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -703,7 +687,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -733,7 +717,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -758,7 +742,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
if let Some(ref f) = (*parent_class).copy_metadata {
|
if let Some(ref f) = (*parent_class).copy_metadata {
|
||||||
gst::result_from_gboolean!(
|
gst::result_from_gboolean!(
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -787,7 +771,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.transform_meta
|
.transform_meta
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
from_glib(f(
|
from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -806,7 +790,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
|
||||||
if let Some(ref f) = (*parent_class).before_transform {
|
if let Some(ref f) = (*parent_class).before_transform {
|
||||||
f(
|
f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -829,7 +813,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
.expect("Missing parent function `submit_input_buffer`");
|
.expect("Missing parent function `submit_input_buffer`");
|
||||||
|
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -849,7 +833,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
|
|
||||||
let mut outbuf = ptr::null_mut();
|
let mut outbuf = ptr::null_mut();
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj()
|
||||||
.unsafe_cast_ref::<BaseTransform>()
|
.unsafe_cast_ref::<BaseTransform>()
|
||||||
.to_glib_none()
|
.to_glib_none()
|
||||||
.0,
|
.0,
|
||||||
|
@ -873,7 +857,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
|
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let instance = self.instance();
|
let instance = self.obj();
|
||||||
let ptr: *mut ffi::GstBaseTransform =
|
let ptr: *mut ffi::GstBaseTransform =
|
||||||
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
|
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
|
||||||
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
|
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
|
||||||
|
@ -890,7 +874,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
|
||||||
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
|
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let instance = self.instance();
|
let instance = self.obj();
|
||||||
let ptr: *mut ffi::GstBaseTransform =
|
let ptr: *mut ffi::GstBaseTransform =
|
||||||
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
|
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
|
||||||
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
|
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
|
||||||
|
@ -1328,12 +1312,9 @@ unsafe extern "C" fn base_transform_copy_metadata<T: BaseTransformImpl>(
|
||||||
let imp = instance.imp();
|
let imp = instance.imp();
|
||||||
|
|
||||||
if gst::ffi::gst_mini_object_is_writable(outbuf as *mut _) == glib::ffi::GFALSE {
|
if gst::ffi::gst_mini_object_is_writable(outbuf as *mut _) == glib::ffi::GFALSE {
|
||||||
gst::warning!(
|
let instance = imp.obj();
|
||||||
gst::CAT_RUST,
|
let obj = instance.unsafe_cast_ref::<BaseTransform>();
|
||||||
obj: imp.instance().unsafe_cast_ref::<BaseTransform>(),
|
gst::warning!(gst::CAT_RUST, obj: obj, "buffer {:?} not writable", outbuf);
|
||||||
"buffer {:?} not writable",
|
|
||||||
outbuf
|
|
||||||
);
|
|
||||||
return glib::ffi::GFALSE;
|
return glib::ffi::GFALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
|
||||||
.fill
|
.fill
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
try_from_glib(f(
|
try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<PushSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<PushSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer.as_mut_ptr(),
|
buffer.as_mut_ptr(),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
@ -70,10 +67,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
|
||||||
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
|
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
|
||||||
|
|
||||||
gst::FlowSuccess::try_from_glib(f(
|
gst::FlowSuccess::try_from_glib(f(
|
||||||
self.instance()
|
self.obj().unsafe_cast_ref::<PushSrc>().to_glib_none().0,
|
||||||
.unsafe_cast_ref::<PushSrc>()
|
|
||||||
.to_glib_none()
|
|
||||||
.0,
|
|
||||||
buffer_ref,
|
buffer_ref,
|
||||||
))
|
))
|
||||||
.map(|_| from_glib_full(buffer_ref))
|
.map(|_| from_glib_full(buffer_ref))
|
||||||
|
@ -92,7 +86,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
|
||||||
(*parent_class)
|
(*parent_class)
|
||||||
.create
|
.create
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let instance = self.instance();
|
let instance = self.obj();
|
||||||
let instance = instance.unsafe_cast_ref::<PushSrc>();
|
let instance = instance.unsafe_cast_ref::<PushSrc>();
|
||||||
let orig_buffer_ptr = buffer
|
let orig_buffer_ptr = buffer
|
||||||
.as_mut()
|
.as_mut()
|
||||||
|
@ -162,7 +156,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let copied_size = new_buffer.copy_to_slice(0, &mut *map);
|
let copied_size = new_buffer.copy_to_slice(0, &mut map);
|
||||||
drop(map);
|
drop(map);
|
||||||
|
|
||||||
if let Err(copied_size) = copied_size {
|
if let Err(copied_size) = copied_size {
|
||||||
|
@ -288,7 +282,7 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let copied_size = new_buffer.copy_to_slice(0, &mut *map);
|
let copied_size = new_buffer.copy_to_slice(0, &mut map);
|
||||||
drop(map);
|
drop(map);
|
||||||
|
|
||||||
if let Err(copied_size) = copied_size {
|
if let Err(copied_size) = copied_size {
|
||||||
|
@ -322,8 +316,7 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
|
||||||
}
|
}
|
||||||
Ok(CreateSuccess::NewBufferList(new_buffer_list)) => {
|
Ok(CreateSuccess::NewBufferList(new_buffer_list)) => {
|
||||||
if buffer.is_some()
|
if buffer.is_some()
|
||||||
|| imp.instance().unsafe_cast_ref::<PushSrc>().src_pad().mode()
|
|| imp.obj().unsafe_cast_ref::<PushSrc>().src_pad().mode() == gst::PadMode::Pull
|
||||||
== gst::PadMode::Pull
|
|
||||||
{
|
{
|
||||||
panic!("Buffer lists can only be returned in push mode");
|
panic!("Buffer lists can only be returned in push mode");
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +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.16"
|
||||||
|
version = "0.16"
|
||||||
|
|
||||||
[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.16"
|
||||||
|
version = "0.16"
|
||||||
|
|
||||||
[dependencies.gst]
|
[dependencies.gst]
|
||||||
package = "gstreamer-sys"
|
package = "gstreamer-sys"
|
||||||
|
version = "0.19"
|
||||||
path = "../../gstreamer/sys"
|
path = "../../gstreamer/sys"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -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.19.0"
|
version = "0.19.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.63"
|
rust-version = "1.63"
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
|
|
|
@ -7,6 +7,7 @@ work_mode = "sys"
|
||||||
single_version_file = true
|
single_version_file = true
|
||||||
|
|
||||||
extra_versions = [
|
extra_versions = [
|
||||||
|
"1.22",
|
||||||
"1.20",
|
"1.20",
|
||||||
"1.18",
|
"1.18",
|
||||||
"1.16",
|
"1.16",
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn main() {} // prevent linking libraries to avoid documentation failure
|
||||||
#[cfg(not(feature = "dox"))]
|
#[cfg(not(feature = "dox"))]
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(s) = system_deps::Config::new().probe() {
|
if let Err(s) = system_deps::Config::new().probe() {
|
||||||
println!("cargo:warning={}", s);
|
println!("cargo:warning={s}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Generated by gir (https://github.com/gtk-rs/gir @ 952ff416b599)
|
Generated by gir (https://github.com/gtk-rs/gir @ 92965146f2fb)
|
||||||
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
|
||||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 15396abcca88)
|
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ ae0d1447f520)
|
||||||
|
|
|
@ -64,7 +64,7 @@ pub union GstCollectData_ABI {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstCollectData_ABI {
|
impl ::std::fmt::Debug for GstCollectData_ABI {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstCollectData_ABI @ {:p}", self))
|
f.debug_struct(&format!("GstCollectData_ABI @ {self:p}"))
|
||||||
.field("abi", unsafe { &self.abi })
|
.field("abi", unsafe { &self.abi })
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ pub struct GstAggregatorClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAggregatorClass {
|
impl ::std::fmt::Debug for GstAggregatorClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAggregatorClass @ {:p}", self))
|
f.debug_struct(&format!("GstAggregatorClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("flush", &self.flush)
|
.field("flush", &self.flush)
|
||||||
.field("clip", &self.clip)
|
.field("clip", &self.clip)
|
||||||
|
@ -280,7 +280,7 @@ pub struct GstAggregatorPadClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAggregatorPadClass {
|
impl ::std::fmt::Debug for GstAggregatorPadClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAggregatorPadClass @ {:p}", self))
|
f.debug_struct(&format!("GstAggregatorPadClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("flush", &self.flush)
|
.field("flush", &self.flush)
|
||||||
.field("skip_buffer", &self.skip_buffer)
|
.field("skip_buffer", &self.skip_buffer)
|
||||||
|
@ -344,7 +344,7 @@ pub struct GstBaseParseClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseParseClass {
|
impl ::std::fmt::Debug for GstBaseParseClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseParseClass @ {:p}", self))
|
f.debug_struct(&format!("GstBaseParseClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("start", &self.start)
|
.field("start", &self.start)
|
||||||
.field("stop", &self.stop)
|
.field("stop", &self.stop)
|
||||||
|
@ -378,7 +378,7 @@ pub struct GstBaseParseFrame {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseParseFrame {
|
impl ::std::fmt::Debug for GstBaseParseFrame {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseParseFrame @ {:p}", self))
|
f.debug_struct(&format!("GstBaseParseFrame @ {self:p}"))
|
||||||
.field("buffer", &self.buffer)
|
.field("buffer", &self.buffer)
|
||||||
.field("out_buffer", &self.out_buffer)
|
.field("out_buffer", &self.out_buffer)
|
||||||
.field("flags", &self.flags)
|
.field("flags", &self.flags)
|
||||||
|
@ -441,7 +441,7 @@ pub struct GstBaseSinkClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseSinkClass {
|
impl ::std::fmt::Debug for GstBaseSinkClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseSinkClass @ {:p}", self))
|
f.debug_struct(&format!("GstBaseSinkClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("get_caps", &self.get_caps)
|
.field("get_caps", &self.get_caps)
|
||||||
.field("set_caps", &self.set_caps)
|
.field("set_caps", &self.set_caps)
|
||||||
|
@ -534,7 +534,7 @@ pub struct GstBaseSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseSrcClass {
|
impl ::std::fmt::Debug for GstBaseSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstBaseSrcClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("get_caps", &self.get_caps)
|
.field("get_caps", &self.get_caps)
|
||||||
.field("negotiate", &self.negotiate)
|
.field("negotiate", &self.negotiate)
|
||||||
|
@ -694,7 +694,7 @@ pub struct GstBaseTransformClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseTransformClass {
|
impl ::std::fmt::Debug for GstBaseTransformClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseTransformClass @ {:p}", self))
|
f.debug_struct(&format!("GstBaseTransformClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("passthrough_on_same_caps", &self.passthrough_on_same_caps)
|
.field("passthrough_on_same_caps", &self.passthrough_on_same_caps)
|
||||||
.field(
|
.field(
|
||||||
|
@ -747,7 +747,7 @@ pub struct GstBitReader {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBitReader {
|
impl ::std::fmt::Debug for GstBitReader {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBitReader @ {:p}", self))
|
f.debug_struct(&format!("GstBitReader @ {self:p}"))
|
||||||
.field("data", &self.data)
|
.field("data", &self.data)
|
||||||
.field("size", &self.size)
|
.field("size", &self.size)
|
||||||
.field("byte", &self.byte)
|
.field("byte", &self.byte)
|
||||||
|
@ -769,7 +769,7 @@ pub struct GstBitWriter {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBitWriter {
|
impl ::std::fmt::Debug for GstBitWriter {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBitWriter @ {:p}", self))
|
f.debug_struct(&format!("GstBitWriter @ {self:p}"))
|
||||||
.field("data", &self.data)
|
.field("data", &self.data)
|
||||||
.field("bit_size", &self.bit_size)
|
.field("bit_size", &self.bit_size)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -787,7 +787,7 @@ pub struct GstByteReader {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstByteReader {
|
impl ::std::fmt::Debug for GstByteReader {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstByteReader @ {:p}", self))
|
f.debug_struct(&format!("GstByteReader @ {self:p}"))
|
||||||
.field("data", &self.data)
|
.field("data", &self.data)
|
||||||
.field("size", &self.size)
|
.field("size", &self.size)
|
||||||
.field("byte", &self.byte)
|
.field("byte", &self.byte)
|
||||||
|
@ -807,7 +807,7 @@ pub struct GstByteWriter {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstByteWriter {
|
impl ::std::fmt::Debug for GstByteWriter {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstByteWriter @ {:p}", self))
|
f.debug_struct(&format!("GstByteWriter @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.field("alloc_size", &self.alloc_size)
|
.field("alloc_size", &self.alloc_size)
|
||||||
.field("fixed", &self.fixed)
|
.field("fixed", &self.fixed)
|
||||||
|
@ -831,7 +831,7 @@ pub struct GstCollectData {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstCollectData {
|
impl ::std::fmt::Debug for GstCollectData {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstCollectData @ {:p}", self))
|
f.debug_struct(&format!("GstCollectData @ {self:p}"))
|
||||||
.field("collect", &self.collect)
|
.field("collect", &self.collect)
|
||||||
.field("pad", &self.pad)
|
.field("pad", &self.pad)
|
||||||
.field("buffer", &self.buffer)
|
.field("buffer", &self.buffer)
|
||||||
|
@ -858,7 +858,7 @@ pub struct GstCollectData_ABI_abi {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstCollectData_ABI_abi {
|
impl ::std::fmt::Debug for GstCollectData_ABI_abi {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstCollectData_ABI_abi @ {:p}", self))
|
f.debug_struct(&format!("GstCollectData_ABI_abi @ {self:p}"))
|
||||||
.field("dts", &self.dts)
|
.field("dts", &self.dts)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -873,7 +873,7 @@ pub struct GstCollectPadsClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstCollectPadsClass {
|
impl ::std::fmt::Debug for GstCollectPadsClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstCollectPadsClass @ {:p}", self))
|
f.debug_struct(&format!("GstCollectPadsClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ pub struct GstDataQueueClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDataQueueClass {
|
impl ::std::fmt::Debug for GstDataQueueClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDataQueueClass @ {:p}", self))
|
f.debug_struct(&format!("GstDataQueueClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("empty", &self.empty)
|
.field("empty", &self.empty)
|
||||||
.field("full", &self.full)
|
.field("full", &self.full)
|
||||||
|
@ -920,7 +920,7 @@ pub struct GstDataQueueItem {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDataQueueItem {
|
impl ::std::fmt::Debug for GstDataQueueItem {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDataQueueItem @ {:p}", self))
|
f.debug_struct(&format!("GstDataQueueItem @ {self:p}"))
|
||||||
.field("object", &self.object)
|
.field("object", &self.object)
|
||||||
.field("size", &self.size)
|
.field("size", &self.size)
|
||||||
.field("duration", &self.duration)
|
.field("duration", &self.duration)
|
||||||
|
@ -948,7 +948,7 @@ pub struct GstDataQueueSize {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDataQueueSize {
|
impl ::std::fmt::Debug for GstDataQueueSize {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDataQueueSize @ {:p}", self))
|
f.debug_struct(&format!("GstDataQueueSize @ {self:p}"))
|
||||||
.field("visible", &self.visible)
|
.field("visible", &self.visible)
|
||||||
.field("bytes", &self.bytes)
|
.field("bytes", &self.bytes)
|
||||||
.field("time", &self.time)
|
.field("time", &self.time)
|
||||||
|
@ -964,7 +964,7 @@ pub struct GstFlowCombiner {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstFlowCombiner {
|
impl ::std::fmt::Debug for GstFlowCombiner {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstFlowCombiner @ {:p}", self))
|
f.debug_struct(&format!("GstFlowCombiner @ {self:p}"))
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -984,7 +984,7 @@ pub struct GstPushSrcClass {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstPushSrcClass {
|
impl ::std::fmt::Debug for GstPushSrcClass {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstPushSrcClass @ {:p}", self))
|
f.debug_struct(&format!("GstPushSrcClass @ {self:p}"))
|
||||||
.field("parent_class", &self.parent_class)
|
.field("parent_class", &self.parent_class)
|
||||||
.field("create", &self.create)
|
.field("create", &self.create)
|
||||||
.field("alloc", &self.alloc)
|
.field("alloc", &self.alloc)
|
||||||
|
@ -1001,6 +1001,14 @@ pub struct _GstQueueArray {
|
||||||
|
|
||||||
pub type GstQueueArray = *mut _GstQueueArray;
|
pub type GstQueueArray = *mut _GstQueueArray;
|
||||||
|
|
||||||
|
#[repr(C)]
|
||||||
|
pub struct _GstTypeFindData {
|
||||||
|
_data: [u8; 0],
|
||||||
|
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type GstTypeFindData = *mut _GstTypeFindData;
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct GstAdapter {
|
pub struct GstAdapter {
|
||||||
|
@ -1010,7 +1018,7 @@ pub struct GstAdapter {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAdapter {
|
impl ::std::fmt::Debug for GstAdapter {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAdapter @ {:p}", self)).finish()
|
f.debug_struct(&format!("GstAdapter @ {self:p}")).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1025,7 +1033,7 @@ pub struct GstAggregator {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAggregator {
|
impl ::std::fmt::Debug for GstAggregator {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAggregator @ {:p}", self))
|
f.debug_struct(&format!("GstAggregator @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1043,7 +1051,7 @@ pub struct GstAggregatorPad {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstAggregatorPad {
|
impl ::std::fmt::Debug for GstAggregatorPad {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstAggregatorPad @ {:p}", self))
|
f.debug_struct(&format!("GstAggregatorPad @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.field("segment", &self.segment)
|
.field("segment", &self.segment)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1064,7 +1072,7 @@ pub struct GstBaseParse {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseParse {
|
impl ::std::fmt::Debug for GstBaseParse {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseParse @ {:p}", self))
|
f.debug_struct(&format!("GstBaseParse @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("sinkpad", &self.sinkpad)
|
.field("sinkpad", &self.sinkpad)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
|
@ -1102,7 +1110,7 @@ pub struct GstBaseSink {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseSink {
|
impl ::std::fmt::Debug for GstBaseSink {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseSink @ {:p}", self))
|
f.debug_struct(&format!("GstBaseSink @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("sinkpad", &self.sinkpad)
|
.field("sinkpad", &self.sinkpad)
|
||||||
.field("pad_mode", &self.pad_mode)
|
.field("pad_mode", &self.pad_mode)
|
||||||
|
@ -1147,7 +1155,7 @@ pub struct GstBaseSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseSrc {
|
impl ::std::fmt::Debug for GstBaseSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseSrc @ {:p}", self))
|
f.debug_struct(&format!("GstBaseSrc @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
.field("live_lock", &self.live_lock)
|
.field("live_lock", &self.live_lock)
|
||||||
|
@ -1185,7 +1193,7 @@ pub struct GstBaseTransform {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstBaseTransform {
|
impl ::std::fmt::Debug for GstBaseTransform {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstBaseTransform @ {:p}", self))
|
f.debug_struct(&format!("GstBaseTransform @ {self:p}"))
|
||||||
.field("element", &self.element)
|
.field("element", &self.element)
|
||||||
.field("sinkpad", &self.sinkpad)
|
.field("sinkpad", &self.sinkpad)
|
||||||
.field("srcpad", &self.srcpad)
|
.field("srcpad", &self.srcpad)
|
||||||
|
@ -1208,7 +1216,7 @@ pub struct GstCollectPads {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstCollectPads {
|
impl ::std::fmt::Debug for GstCollectPads {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstCollectPads @ {:p}", self))
|
f.debug_struct(&format!("GstCollectPads @ {self:p}"))
|
||||||
.field("object", &self.object)
|
.field("object", &self.object)
|
||||||
.field("data", &self.data)
|
.field("data", &self.data)
|
||||||
.finish()
|
.finish()
|
||||||
|
@ -1225,7 +1233,7 @@ pub struct GstDataQueue {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstDataQueue {
|
impl ::std::fmt::Debug for GstDataQueue {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstDataQueue @ {:p}", self))
|
f.debug_struct(&format!("GstDataQueue @ {self:p}"))
|
||||||
.field("object", &self.object)
|
.field("object", &self.object)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1240,7 +1248,7 @@ pub struct GstPushSrc {
|
||||||
|
|
||||||
impl ::std::fmt::Debug for GstPushSrc {
|
impl ::std::fmt::Debug for GstPushSrc {
|
||||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||||
f.debug_struct(&format!("GstPushSrc @ {:p}", self))
|
f.debug_struct(&format!("GstPushSrc @ {self:p}"))
|
||||||
.field("parent", &self.parent)
|
.field("parent", &self.parent)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
@ -1712,6 +1720,31 @@ extern "C" {
|
||||||
initial_size: c_uint,
|
initial_size: c_uint,
|
||||||
) -> *mut GstQueueArray;
|
) -> *mut GstQueueArray;
|
||||||
|
|
||||||
|
//=========================================================================
|
||||||
|
// GstTypeFindData
|
||||||
|
//=========================================================================
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_data_free(data: *mut GstTypeFindData);
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_data_get_caps(data: *mut GstTypeFindData) -> *mut gst::GstCaps;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_data_get_probability(
|
||||||
|
data: *mut GstTypeFindData,
|
||||||
|
) -> gst::GstTypeFindProbability;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_data_get_typefind(data: *mut GstTypeFindData) -> *mut gst::GstTypeFind;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_data_new(
|
||||||
|
obj: *mut gst::GstObject,
|
||||||
|
data: *const u8,
|
||||||
|
size: size_t,
|
||||||
|
) -> *mut GstTypeFindData;
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// GstAdapter
|
// GstAdapter
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@ -1805,6 +1838,9 @@ extern "C" {
|
||||||
params: *mut gst::GstAllocationParams,
|
params: *mut gst::GstAllocationParams,
|
||||||
);
|
);
|
||||||
pub fn gst_aggregator_get_buffer_pool(self_: *mut GstAggregator) -> *mut gst::GstBufferPool;
|
pub fn gst_aggregator_get_buffer_pool(self_: *mut GstAggregator) -> *mut gst::GstBufferPool;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_aggregator_get_force_live(self_: *mut GstAggregator) -> gboolean;
|
||||||
#[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")))]
|
||||||
pub fn gst_aggregator_get_ignore_inactive_pads(self_: *mut GstAggregator) -> gboolean;
|
pub fn gst_aggregator_get_ignore_inactive_pads(self_: *mut GstAggregator) -> gboolean;
|
||||||
|
@ -1827,6 +1863,9 @@ extern "C" {
|
||||||
duration: gst::GstClockTime,
|
duration: gst::GstClockTime,
|
||||||
info: *mut gst::GstStructure,
|
info: *mut gst::GstStructure,
|
||||||
);
|
);
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_aggregator_set_force_live(self_: *mut GstAggregator, force_live: gboolean);
|
||||||
#[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")))]
|
||||||
pub fn gst_aggregator_set_ignore_inactive_pads(self_: *mut GstAggregator, ignore: gboolean);
|
pub fn gst_aggregator_set_ignore_inactive_pads(self_: *mut GstAggregator, ignore: gboolean);
|
||||||
|
@ -2233,6 +2272,14 @@ extern "C" {
|
||||||
buf: *mut gst::GstBuffer,
|
buf: *mut gst::GstBuffer,
|
||||||
prob: *mut gst::GstTypeFindProbability,
|
prob: *mut gst::GstTypeFindProbability,
|
||||||
) -> *mut gst::GstCaps;
|
) -> *mut gst::GstCaps;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_helper_for_buffer_with_caps(
|
||||||
|
obj: *mut gst::GstObject,
|
||||||
|
buf: *mut gst::GstBuffer,
|
||||||
|
caps: *mut gst::GstCaps,
|
||||||
|
prob: *mut gst::GstTypeFindProbability,
|
||||||
|
) -> *mut gst::GstCaps;
|
||||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||||
pub fn gst_type_find_helper_for_buffer_with_extension(
|
pub fn gst_type_find_helper_for_buffer_with_extension(
|
||||||
|
@ -2247,6 +2294,15 @@ extern "C" {
|
||||||
size: size_t,
|
size: size_t,
|
||||||
prob: *mut gst::GstTypeFindProbability,
|
prob: *mut gst::GstTypeFindProbability,
|
||||||
) -> *mut gst::GstCaps;
|
) -> *mut gst::GstCaps;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_helper_for_data_with_caps(
|
||||||
|
obj: *mut gst::GstObject,
|
||||||
|
data: *const u8,
|
||||||
|
size: size_t,
|
||||||
|
caps: *mut gst::GstCaps,
|
||||||
|
prob: *mut gst::GstTypeFindProbability,
|
||||||
|
) -> *mut gst::GstCaps;
|
||||||
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||||
pub fn gst_type_find_helper_for_data_with_extension(
|
pub fn gst_type_find_helper_for_data_with_extension(
|
||||||
|
@ -2279,5 +2335,11 @@ extern "C" {
|
||||||
caps: *mut *mut gst::GstCaps,
|
caps: *mut *mut gst::GstCaps,
|
||||||
prob: *mut gst::GstTypeFindProbability,
|
prob: *mut gst::GstTypeFindProbability,
|
||||||
) -> gst::GstFlowReturn;
|
) -> gst::GstFlowReturn;
|
||||||
|
#[cfg(any(feature = "v1_22", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
|
||||||
|
pub fn gst_type_find_list_factories_for_caps(
|
||||||
|
obj: *mut gst::GstObject,
|
||||||
|
caps: *mut gst::GstCaps,
|
||||||
|
) -> *mut glib::GList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Compiler {
|
||||||
cmd.arg(out);
|
cmd.arg(out);
|
||||||
let status = cmd.spawn()?.wait()?;
|
let status = cmd.spawn()?.wait()?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
return Err(format!("compilation command {cmd:?} failed, {status}").into());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
match env::var(name) {
|
match env::var(name) {
|
||||||
Ok(value) => Ok(shell_words::split(&value)?),
|
Ok(value) => Ok(shell_words::split(&value)?),
|
||||||
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
||||||
Err(err) => Err(format!("{} {}", name, err).into()),
|
Err(err) => Err(format!("{name} {err}").into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||||
cmd.args(packages);
|
cmd.args(packages);
|
||||||
let out = cmd.output()?;
|
let out = cmd.output()?;
|
||||||
if !out.status.success() {
|
if !out.status.success() {
|
||||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
return Err(format!("command {cmd:?} returned {}", out.status).into());
|
||||||
}
|
}
|
||||||
let stdout = str::from_utf8(&out.stdout)?;
|
let stdout = str::from_utf8(&out.stdout)?;
|
||||||
Ok(shell_words::split(stdout.trim())?)
|
Ok(shell_words::split(stdout.trim())?)
|
||||||
|
@ -127,15 +127,14 @@ fn cross_validate_constants_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_value != c_value {
|
if rust_value != c_value {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
|
||||||
rust_name, rust_value, &c_value
|
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -165,16 +164,13 @@ fn cross_validate_layout_with_c() {
|
||||||
{
|
{
|
||||||
if rust_name != c_name {
|
if rust_name != c_name {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if rust_layout != c_layout {
|
if rust_layout != c_layout {
|
||||||
results.record_failed();
|
results.record_failed();
|
||||||
eprintln!(
|
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
|
||||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
|
||||||
rust_name, rust_layout, &c_layout
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +191,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||||
let mut abi_cmd = Command::new(exe);
|
let mut abi_cmd = Command::new(exe);
|
||||||
let output = abi_cmd.output()?;
|
let output = abi_cmd.output()?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(String::from_utf8(output.stdout)?)
|
Ok(String::from_utf8(output.stdout)?)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gstreamer-check"
|
name = "gstreamer-check"
|
||||||
version = "0.19.0"
|
version = "0.19.8"
|
||||||
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.63"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.0"
|
bitflags = "1.0"
|
||||||
ffi = { package = "gstreamer-check-sys", path = "sys" }
|
ffi = { package = "gstreamer-check-sys", version = "0.19", path = "sys" }
|
||||||
glib = { git = "https://github.com/gtk-rs/gtk-rs-core" }
|
glib = { git = "https://github.com/gtk-rs/gtk-rs-core", branch = "0.16", version = "0.16.2" }
|
||||||
gst = { package = "gstreamer", path = "../gstreamer" }
|
gst = { package = "gstreamer", version = "0.19", path = "../gstreamer" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gir-format-check = "0.1"
|
gir-format-check = "0.1"
|
||||||
|
|
|
@ -66,6 +66,26 @@ You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or
|
||||||
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/)
|
||||||
provided by the GStreamer project.
|
provided by the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over Homebrew, especially
|
||||||
|
as GStreamer in Homebrew is [currently broken](https://github.com/orgs/Homebrew/discussions/3740#discussioncomment-3804964).
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.pkg` files from the GStreamer website and
|
||||||
|
install them, e.g. `gstreamer-1.0-1.20.4-universal.pkg` and
|
||||||
|
`gstreamer-1.0-devel-1.20.4-universal.pkg`.
|
||||||
|
|
||||||
|
After installation, you also need to set the `PATH` environment variable as
|
||||||
|
follows
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin${PATH:+:$PATH}"
|
||||||
|
```
|
||||||
|
|
||||||
|
Also note that the `pkg-config` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### Homebrew
|
#### Homebrew
|
||||||
|
|
||||||
Homebrew only installs various plugins if explicitly enabled, so some extra
|
Homebrew only installs various plugins if explicitly enabled, so some extra
|
||||||
|
@ -81,19 +101,6 @@ $ brew install gstreamer gst-plugins-base gst-plugins-good \
|
||||||
|
|
||||||
Make sure the version of these libraries is >= 1.14.
|
Make sure the version of these libraries is >= 1.14.
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.pkg` files from the GStreamer website and
|
|
||||||
install them, e.g. `gstreamer-1.0-1.14.0-x86_64.pkg` and
|
|
||||||
`gstreamer-1.0-devel-1.14.0-x86_64.pkg`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via Homebrew)
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="installation-windows"/>
|
<a name="installation-windows"/>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -103,6 +110,32 @@ with `pacman` or by installing the
|
||||||
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by
|
||||||
the GStreamer project.
|
the GStreamer project.
|
||||||
|
|
||||||
|
We recommend using the official GStreamer binaries over MSYS2.
|
||||||
|
|
||||||
|
#### GStreamer Binaries
|
||||||
|
|
||||||
|
You need to download the *two* `.msi` files for your platform from the
|
||||||
|
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.20.4.msi` and
|
||||||
|
`gstreamer-1.0-devel-x86_64-1.20.4.msi`. Make sure to select the version that
|
||||||
|
matches your Rust toolchain, i.e. MinGW or MSVC.
|
||||||
|
|
||||||
|
After installation set the ``PATH` environment variable as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
# For a UNIX-style shell:
|
||||||
|
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"
|
||||||
|
|
||||||
|
# For cmd.exe:
|
||||||
|
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to update the path to where you have actually installed GStreamer
|
||||||
|
and for the corresponding toolchain.
|
||||||
|
|
||||||
|
Also note that the `pkg-config.exe` from GStreamer should be the first one in
|
||||||
|
the `PATH` as other versions have all kinds of quirks that will cause
|
||||||
|
problems.
|
||||||
|
|
||||||
#### MSYS2 / pacman
|
#### MSYS2 / pacman
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
@ -120,20 +153,6 @@ Note that the version of `pkg-config` included in `MSYS2` is
|
||||||
compiling GStreamer, so you may need to install another version. One option
|
compiling GStreamer, so you may need to install another version. One option
|
||||||
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
would be [`pkg-config-lite`](https://sourceforge.net/projects/pkgconfiglite/).
|
||||||
|
|
||||||
#### GStreamer Binaries
|
|
||||||
|
|
||||||
You need to download the *two* `.msi` files for your platform from the
|
|
||||||
GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.14.0.msi` and
|
|
||||||
`gstreamer-1.0-devel-x86_64-1.14.0.msi`.
|
|
||||||
|
|
||||||
After installation, you also need to install `pkg-config` (e.g. via MSYS2 or
|
|
||||||
from [here](https://sourceforge.net/projects/pkgconfiglite/))
|
|
||||||
and set the `PKG_CONFIG_PATH` environment variable
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
|
||||||
```
|
|
||||||
|
|
||||||
<a name="getting-started"/>
|
<a name="getting-started"/>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue