Update for new clone/closure macro syntax

Also fix various weak/strong references in the webrtc plugin, and make
sure to pass the object to debug log functions in every place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1625>
This commit is contained in:
Sebastian Dröge 2024-06-17 20:01:07 +03:00
parent 90e926def4
commit 47d62b6d78
8 changed files with 956 additions and 854 deletions

179
Cargo.lock generated
View file

@ -981,7 +981,7 @@ dependencies = [
[[package]] [[package]]
name = "cairo-rs" name = "cairo-rs"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"bitflags 2.5.0", "bitflags 2.5.0",
"cairo-sys-rs", "cairo-sys-rs",
@ -993,11 +993,11 @@ dependencies = [
[[package]] [[package]]
name = "cairo-sys-rs" name = "cairo-sys-rs"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -1497,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ecb1c5e8f4dc438eedc1b534a54672fb0e0a56035dae6b50162787bd2c50e95" checksum = "6ecb1c5e8f4dc438eedc1b534a54672fb0e0a56035dae6b50162787bd2c50e95"
dependencies = [ dependencies = [
"libc", "libc",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -1933,7 +1933,7 @@ dependencies = [
[[package]] [[package]]
name = "gdk-pixbuf" name = "gdk-pixbuf"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
"gio", "gio",
@ -1944,13 +1944,13 @@ dependencies = [
[[package]] [[package]]
name = "gdk-pixbuf-sys" name = "gdk-pixbuf-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"gio-sys", "gio-sys",
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -1980,7 +1980,7 @@ dependencies = [
"libc", "libc",
"pango-sys", "pango-sys",
"pkg-config", "pkg-config",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -2002,7 +2002,7 @@ source = "git+https://github.com/gtk-rs/gtk4-rs?branch=master#f7ff7a0c8f4b3b892e
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -2026,7 +2026,7 @@ dependencies = [
"gdk4-sys", "gdk4-sys",
"glib-sys", "glib-sys",
"libc", "libc",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -2049,7 +2049,7 @@ dependencies = [
"gdk4-sys", "gdk4-sys",
"glib-sys", "glib-sys",
"libc", "libc",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -2103,7 +2103,7 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
[[package]] [[package]]
name = "gio" name = "gio"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@ -2120,19 +2120,19 @@ dependencies = [
[[package]] [[package]]
name = "gio-sys" name = "gio-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"bitflags 2.5.0", "bitflags 2.5.0",
"futures-channel", "futures-channel",
@ -2153,7 +2153,7 @@ dependencies = [
[[package]] [[package]]
name = "glib-macros" name = "glib-macros"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro-crate", "proc-macro-crate",
@ -2165,10 +2165,10 @@ dependencies = [
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -2180,17 +2180,17 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "graphene-rs" name = "graphene-rs"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib", "glib",
"graphene-sys", "graphene-sys",
@ -2200,12 +2200,12 @@ dependencies = [
[[package]] [[package]]
name = "graphene-sys" name = "graphene-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
"pkg-config", "pkg-config",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -2245,7 +2245,7 @@ dependencies = [
"graphene-sys", "graphene-sys",
"libc", "libc",
"pango-sys", "pango-sys",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -3122,7 +3122,7 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer" name = "gstreamer"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-channel", "futures-channel",
@ -3148,7 +3148,7 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-allocators" name = "gstreamer-allocators"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3160,19 +3160,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-allocators-sys" name = "gstreamer-allocators-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-app" name = "gstreamer-app"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
@ -3186,19 +3186,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-app-sys" name = "gstreamer-app-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-base-sys", "gstreamer-base-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-audio" name = "gstreamer-audio"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"glib", "glib",
@ -3214,20 +3214,20 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-audio-sys" name = "gstreamer-audio-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"gstreamer-base-sys", "gstreamer-base-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-base" name = "gstreamer-base"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"atomic_refcell", "atomic_refcell",
"cfg-if", "cfg-if",
@ -3240,19 +3240,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-base-sys" name = "gstreamer-base-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-check" name = "gstreamer-check"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3262,19 +3262,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-check-sys" name = "gstreamer-check-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-gl" name = "gstreamer-gl"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3288,7 +3288,7 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-gl-egl" name = "gstreamer-gl-egl"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3300,18 +3300,18 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-gl-egl-sys" name = "gstreamer-gl-egl-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-gl-sys", "gstreamer-gl-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-gl-sys" name = "gstreamer-gl-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@ -3319,13 +3319,13 @@ dependencies = [
"gstreamer-sys", "gstreamer-sys",
"gstreamer-video-sys", "gstreamer-video-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-gl-wayland" name = "gstreamer-gl-wayland"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3337,18 +3337,18 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-gl-wayland-sys" name = "gstreamer-gl-wayland-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-gl-sys", "gstreamer-gl-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-gl-x11" name = "gstreamer-gl-x11"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3360,18 +3360,18 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-gl-x11-sys" name = "gstreamer-gl-x11-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-gl-sys", "gstreamer-gl-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-net" name = "gstreamer-net"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"gio", "gio",
"glib", "glib",
@ -3382,19 +3382,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-net-sys" name = "gstreamer-net-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"gio-sys", "gio-sys",
"glib-sys", "glib-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-pbutils" name = "gstreamer-pbutils"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3408,7 +3408,7 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-pbutils-sys" name = "gstreamer-pbutils-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@ -3416,13 +3416,13 @@ dependencies = [
"gstreamer-sys", "gstreamer-sys",
"gstreamer-video-sys", "gstreamer-video-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-rtp" name = "gstreamer-rtp"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3433,19 +3433,19 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-rtp-sys" name = "gstreamer-rtp-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-base-sys", "gstreamer-base-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-sdp" name = "gstreamer-sdp"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3455,29 +3455,29 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-sdp-sys" name = "gstreamer-sdp-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-sys" name = "gstreamer-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-utils" name = "gstreamer-utils"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"gstreamer", "gstreamer",
"gstreamer-app", "gstreamer-app",
@ -3489,7 +3489,7 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-video" name = "gstreamer-video"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures-channel", "futures-channel",
@ -3506,20 +3506,20 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-video-sys" name = "gstreamer-video-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"gstreamer-base-sys", "gstreamer-base-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "gstreamer-webrtc" name = "gstreamer-webrtc"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib", "glib",
"gstreamer", "gstreamer",
@ -3531,13 +3531,13 @@ dependencies = [
[[package]] [[package]]
name = "gstreamer-webrtc-sys" name = "gstreamer-webrtc-sys"
version = "0.23.0" version = "0.23.0"
source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#0be8b364f8ea871ca5bd1f4d2ad6fa5cee5e437a" source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#cfb0fe6a17254eef20abe2584f975ab9f4dc26a4"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gstreamer-sdp-sys", "gstreamer-sdp-sys",
"gstreamer-sys", "gstreamer-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -3586,7 +3586,7 @@ dependencies = [
"gsk4-sys", "gsk4-sys",
"libc", "libc",
"pango-sys", "pango-sys",
"system-deps", "system-deps 6.2.2",
] ]
[[package]] [[package]]
@ -4397,7 +4397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.5", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@ -5149,7 +5149,7 @@ dependencies = [
[[package]] [[package]]
name = "pango" name = "pango"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"gio", "gio",
"glib", "glib",
@ -5160,18 +5160,18 @@ dependencies = [
[[package]] [[package]]
name = "pango-sys" name = "pango-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
name = "pangocairo" name = "pangocairo"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"cairo-rs", "cairo-rs",
"glib", "glib",
@ -5183,13 +5183,13 @@ dependencies = [
[[package]] [[package]]
name = "pangocairo-sys" name = "pangocairo-sys"
version = "0.20.0" version = "0.20.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#d88a7c473e2af36a4718a648406b7894d288ec1b" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=master#dbfaebdf8c156f2af843479060e5c6fa08e0ad50"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"glib-sys", "glib-sys",
"libc", "libc",
"pango-sys", "pango-sys",
"system-deps", "system-deps 7.0.1",
] ]
[[package]] [[package]]
@ -5526,7 +5526,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4"
dependencies = [ dependencies = [
"bytes", "bytes",
"heck 0.5.0", "heck 0.4.1",
"itertools 0.12.1", "itertools 0.12.1",
"log", "log",
"multimap 0.10.0", "multimap 0.10.0",
@ -5747,7 +5747,7 @@ dependencies = [
"rand", "rand",
"rand_chacha", "rand_chacha",
"simd_helpers", "simd_helpers",
"system-deps", "system-deps 6.2.2",
"thiserror", "thiserror",
"v_frame", "v_frame",
] ]
@ -6741,6 +6741,19 @@ dependencies = [
"version-compare", "version-compare",
] ]
[[package]]
name = "system-deps"
version = "7.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922"
dependencies = [
"cfg-expr",
"heck 0.5.0",
"pkg-config",
"toml",
"version-compare",
]
[[package]] [[package]]
name = "target-lexicon" name = "target-lexicon"
version = "0.12.14" version = "0.12.14"

View file

@ -84,13 +84,16 @@ fn main() {
.property("signal-handoffs", true) .property("signal-handoffs", true)
.build() .build()
.unwrap(); .unwrap();
sink.connect( sink.connect_closure(
"handoff", "handoff",
true, true,
glib::clone!(@strong counter => move |_| { glib::closure!(
#[strong]
counter,
move |_fakesink: &gst::Element, _buffer: &gst::Buffer, _pad: &gst::Pad| {
let _ = counter.fetch_add(1, Ordering::SeqCst); let _ = counter.fetch_add(1, Ordering::SeqCst);
None }
}), ),
); );
let (source, context) = match source.as_str() { let (source, context) = match source.as_str() {

View file

@ -334,8 +334,10 @@ impl Signaller {
// 1000 is completely arbitrary, we simply don't want infinite piling // 1000 is completely arbitrary, we simply don't want infinite piling
// up of messages as with unbounded // up of messages as with unbounded
let (ws_sender, mut ws_receiver) = mpsc::channel::<OutgoingMessage>(1000); let (ws_sender, mut ws_receiver) = mpsc::channel::<OutgoingMessage>(1000);
let send_task_handle = let send_task_handle = RUNTIME.spawn(glib::clone!(
RUNTIME.spawn(glib::clone!(@weak-allow-none self as this => async move { #[to_owned(rename_to = this)]
self,
async move {
let mut res = Ok(()); let mut res = Ok(());
loop { loop {
tokio::select! { tokio::select! {
@ -349,7 +351,6 @@ impl Signaller {
None => break, None => break,
}, },
_ = tokio::time::sleep(Duration::from_secs(10)) => { _ = tokio::time::sleep(Duration::from_secs(10)) => {
if let Some(ref this) = this {
let (transaction, session_id, apisecret) = { let (transaction, session_id, apisecret) = {
let state = this.state.lock().unwrap(); let state = this.state.lock().unwrap();
let settings = this.settings.lock().unwrap(); let settings = this.settings.lock().unwrap();
@ -370,43 +371,35 @@ impl Signaller {
.await; .await;
} }
} }
}
if let Err(ref err) = res { if let Err(ref err) = res {
this.as_ref().map_or_else(|| gst::error!(CAT, "Quitting send task: {err}"), gst::error!(CAT, imp: this, "Quitting send task: {err}");
|this| gst::error!(CAT, imp: this, "Quitting send task: {err}")
);
break; break;
} }
} }
this.map_or_else(|| gst::debug!(CAT, "Done sending"), gst::debug!(CAT, imp: this, "Done sending");
|this| gst::debug!(CAT, imp: this, "Done sending")
);
let _ = ws_sink.close().await; let _ = ws_sink.close().await;
res.map_err(Into::into) res.map_err(Into::into)
}));
let recv_task_handle =
RUNTIME.spawn(glib::clone!(@weak-allow-none self as this => async move {
while let Some(msg) = tokio_stream::StreamExt::next(&mut ws_stream).await {
if let Some(ref this) = this {
if let ControlFlow::Break(_) = this.handle_msg(msg) {
break;
} }
} else { ));
let recv_task_handle = RUNTIME.spawn(glib::clone!(
#[to_owned(rename_to = this)]
self,
async move {
while let Some(msg) = tokio_stream::StreamExt::next(&mut ws_stream).await {
if let ControlFlow::Break(_) = this.handle_msg(msg) {
break; break;
} }
} }
let msg = "Stopped websocket receiving"; let msg = "Stopped websocket receiving";
this.map_or_else(|| gst::info!(CAT, "{msg}"), gst::info!(CAT, imp: this, "{msg}");
|this| gst::info!(CAT, imp: this, "{msg}") }
); ));
}));
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
state.ws_sender = Some(ws_sender); state.ws_sender = Some(ws_sender);
@ -531,11 +524,15 @@ impl Signaller {
fn send(&self, msg: OutgoingMessage) { fn send(&self, msg: OutgoingMessage) {
let state = self.state.lock().unwrap(); let state = self.state.lock().unwrap();
if let Some(mut sender) = state.ws_sender.clone() { if let Some(mut sender) = state.ws_sender.clone() {
RUNTIME.spawn(glib::clone!(@weak self as this => async move { RUNTIME.spawn(glib::clone!(
#[to_owned(rename_to = this)]
self,
async move {
if let Err(err) = sender.send(msg).await { if let Err(err) = sender.send(msg).await {
this.raise_error(err.to_string()); this.raise_error(err.to_string());
} }
})); }
));
} }
} }
@ -545,11 +542,11 @@ impl Signaller {
fn send_blocking(&self, msg: OutgoingMessage) { fn send_blocking(&self, msg: OutgoingMessage) {
let state = self.state.lock().unwrap(); let state = self.state.lock().unwrap();
if let Some(mut sender) = state.ws_sender.clone() { if let Some(mut sender) = state.ws_sender.clone() {
RUNTIME.block_on(glib::clone!(@weak self as this => async move { RUNTIME.block_on(async {
if let Err(err) = sender.send(msg).await { if let Err(err) = sender.send(msg).await {
this.raise_error(err.to_string()); self.raise_error(err.to_string());
} }
})); });
} }
} }

View file

@ -589,9 +589,7 @@ impl SignallableImpl for Signaller {
let weak_imp = self.downgrade(); let weak_imp = self.downgrade();
RUNTIME.spawn(async move { RUNTIME.spawn(async move {
let imp = if let Some(imp) = weak_imp.upgrade() { let Some(imp) = weak_imp.upgrade() else {
imp
} else {
return; return;
}; };
@ -634,15 +632,19 @@ impl SignallableImpl for Signaller {
} }
} }
let weak_imp = imp.downgrade();
imp.obj().connect_closure( imp.obj().connect_closure(
"webrtcbin-ready", "webrtcbin-ready",
false, false,
glib::closure!(|_signaller: &super::LiveKitSignaller, glib::closure!(
#[watch(rename_to = obj)]
imp.obj(),
move |_signaller: &super::LiveKitSignaller,
_consumer_identifier: &str, _consumer_identifier: &str,
webrtcbin: &gst::Element| { webrtcbin: &gst::Element| {
let imp = obj.imp();
gst::info!(CAT, "Adding data channels"); gst::info!(CAT, "Adding data channels");
let reliable_channel = webrtcbin.emit_by_name::<gst_webrtc::WebRTCDataChannel>( let reliable_channel = webrtcbin
.emit_by_name::<gst_webrtc::WebRTCDataChannel>(
"create-data-channel", "create-data-channel",
&[ &[
&"_reliable", &"_reliable",
@ -651,7 +653,8 @@ impl SignallableImpl for Signaller {
.build(), .build(),
], ],
); );
let lossy_channel = webrtcbin.emit_by_name::<gst_webrtc::WebRTCDataChannel>( let lossy_channel = webrtcbin
.emit_by_name::<gst_webrtc::WebRTCDataChannel>(
"create-data-channel", "create-data-channel",
&[ &[
&"_lossy", &"_lossy",
@ -662,7 +665,6 @@ impl SignallableImpl for Signaller {
], ],
); );
if let Some(imp) = weak_imp.upgrade() {
let mut connection = imp.connection.lock().unwrap(); let mut connection = imp.connection.lock().unwrap();
if let Some(connection) = connection.as_mut() { if let Some(connection) = connection.as_mut() {
connection.channels = Some(Channels { connection.channels = Some(Channels {
@ -671,7 +673,7 @@ impl SignallableImpl for Signaller {
}); });
} }
} }
}), ),
); );
let connection = Connection { let connection = Connection {

View file

@ -68,6 +68,7 @@ pub struct Signaller {
struct State { struct State {
/// Sender for the websocket messages /// Sender for the websocket messages
websocket_sender: Option<mpsc::Sender<p::IncomingMessage>>, websocket_sender: Option<mpsc::Sender<p::IncomingMessage>>,
connect_task_handle: Option<task::JoinHandle<()>>,
send_task_handle: Option<task::JoinHandle<Result<(), Error>>>, send_task_handle: Option<task::JoinHandle<Result<(), Error>>>,
receive_task_handle: Option<task::JoinHandle<()>>, receive_task_handle: Option<task::JoinHandle<()>>,
producers: HashSet<String>, producers: HashSet<String>,
@ -173,8 +174,10 @@ impl Signaller {
// 1000 is completely arbitrary, we simply don't want infinite piling // 1000 is completely arbitrary, we simply don't want infinite piling
// up of messages as with unbounded // up of messages as with unbounded
let (websocket_sender, mut websocket_receiver) = mpsc::channel::<p::IncomingMessage>(1000); let (websocket_sender, mut websocket_receiver) = mpsc::channel::<p::IncomingMessage>(1000);
let send_task_handle = let send_task_handle = RUNTIME.spawn(glib::clone!(
RUNTIME.spawn(glib::clone!(@weak-allow-none self as this => async move { #[to_owned(rename_to = this)]
self,
async move {
let mut res = Ok(()); let mut res = Ok(());
while let Some(msg) = websocket_receiver.next().await { while let Some(msg) = websocket_receiver.next().await {
gst::log!(CAT, "Sending websocket message {:?}", msg); gst::log!(CAT, "Sending websocket message {:?}", msg);
@ -183,21 +186,18 @@ impl Signaller {
.await; .await;
if let Err(ref err) = res { if let Err(ref err) = res {
this.as_ref().map_or_else(|| gst::error!(CAT, "Quitting send loop: {err}"), gst::error!(CAT, imp: this, "Quitting send loop: {err}");
|this| gst::error!(CAT, imp: this, "Quitting send loop: {err}")
);
break; break;
} }
} }
this.map_or_else(|| gst::debug!(CAT, "Done sending"), gst::debug!(CAT, imp: this, "Done sending");
|this| gst::debug!(CAT, imp: this, "Done sending")
);
let _ = ws_sink.close().await; let _ = ws_sink.close().await;
res.map_err(Into::into) res.map_err(Into::into)
})); }
));
let obj = self.obj(); let obj = self.obj();
let meta = let meta =
@ -207,23 +207,20 @@ impl Signaller {
None None
}; };
let receive_task_handle = let receive_task_handle = RUNTIME.spawn(glib::clone!(
RUNTIME.spawn(glib::clone!(@weak-allow-none self as this => async move { #[to_owned(rename_to = this)]
self,
async move {
while let Some(msg) = tokio_stream::StreamExt::next(&mut ws_stream).await { while let Some(msg) = tokio_stream::StreamExt::next(&mut ws_stream).await {
if let Some(ref this) = this {
if let ControlFlow::Break(_) = this.handle_message(msg, &meta) { if let ControlFlow::Break(_) = this.handle_message(msg, &meta) {
break; break;
} }
} else {
break;
}
} }
let msg = "Stopped websocket receiving"; let msg = "Stopped websocket receiving";
this.map_or_else(|| gst::info!(CAT, "{msg}"), gst::info!(CAT, imp: this, "{msg}");
|this| gst::info!(CAT, imp: this, "{msg}") }
); ));
}));
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
state.websocket_sender = Some(websocket_sender); state.websocket_sender = Some(websocket_sender);
@ -297,11 +294,16 @@ impl Signaller {
fn send(&self, msg: p::IncomingMessage) { fn send(&self, msg: p::IncomingMessage) {
let state = self.state.lock().unwrap(); let state = self.state.lock().unwrap();
if let Some(mut sender) = state.websocket_sender.clone() { if let Some(mut sender) = state.websocket_sender.clone() {
RUNTIME.spawn(glib::clone!(@weak self as this => async move { RUNTIME.spawn(glib::clone!(
#[to_owned(rename_to = this)]
self,
async move {
if let Err(err) = sender.send(msg).await { if let Err(err) = sender.send(msg).await {
this.obj().emit_by_name::<()>("error", &[&format!("Error: {}", err)]); this.obj()
.emit_by_name::<()>("error", &[&format!("Error: {}", err)]);
} }
})); }
));
} }
} }
@ -636,17 +638,37 @@ impl ObjectImpl for Signaller {
impl SignallableImpl for Signaller { impl SignallableImpl for Signaller {
fn start(&self) { fn start(&self) {
gst::info!(CAT, imp: self, "Starting"); gst::info!(CAT, imp: self, "Starting");
RUNTIME.spawn(glib::clone!(@weak self as this => async move {
let mut state = self.state.lock().unwrap();
let connect_task_handle = RUNTIME.spawn(glib::clone!(
#[to_owned(rename_to = this)]
self,
async move {
if let Err(err) = this.connect().await { if let Err(err) = this.connect().await {
this.obj().emit_by_name::<()>("error", &[&format!("Error receiving: {}", err)]); this.obj()
.emit_by_name::<()>("error", &[&format!("Error receiving: {}", err)]);
} }
})); }
));
state.connect_task_handle = Some(connect_task_handle);
} }
fn stop(&self) { fn stop(&self) {
gst::info!(CAT, imp: self, "Stopping now"); gst::info!(CAT, imp: self, "Stopping now");
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
// First make sure the connect task is stopped if it is still
// running
let connect_task_handle = state.connect_task_handle.take();
if let Some(handle) = connect_task_handle {
RUNTIME.block_on(async move {
handle.abort();
let _ = handle.await;
});
}
let send_task_handle = state.send_task_handle.take(); let send_task_handle = state.send_task_handle.take();
let receive_task_handle = state.receive_task_handle.take(); let receive_task_handle = state.receive_task_handle.take();
if let Some(mut sender) = state.websocket_sender.take() { if let Some(mut sender) = state.websocket_sender.take() {
@ -661,6 +683,7 @@ impl SignallableImpl for Signaller {
if let Some(handle) = receive_task_handle { if let Some(handle) = receive_task_handle {
handle.abort(); handle.abort();
let _ = handle.await;
} }
}); });
} }
@ -720,16 +743,21 @@ impl SignallableImpl for Signaller {
let state = self.state.lock().unwrap(); let state = self.state.lock().unwrap();
let session_id = session_id.to_string(); let session_id = session_id.to_string();
if let Some(mut sender) = state.websocket_sender.clone() { if let Some(mut sender) = state.websocket_sender.clone() {
RUNTIME.spawn(glib::clone!(@weak self as this => async move { RUNTIME.spawn(glib::clone!(
#[to_owned(rename_to = this)]
self,
async move {
if let Err(err) = sender if let Err(err) = sender
.send(p::IncomingMessage::EndSession(p::EndSessionMessage { .send(p::IncomingMessage::EndSession(p::EndSessionMessage {
session_id, session_id,
})) }))
.await .await
{ {
this.obj().emit_by_name::<()>("error", &[&format!("Error: {}", err)]); this.obj()
.emit_by_name::<()>("error", &[&format!("Error: {}", err)]);
} }
})); }
));
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -406,8 +406,13 @@ impl Session {
} }
let ghostpad = gst::GhostPad::builder(gst::PadDirection::Src) let ghostpad = gst::GhostPad::builder(gst::PadDirection::Src)
.proxy_pad_chain_function(glib::clone!(@weak element, @strong self.id as sess_id => @default-panic, move .proxy_pad_chain_function(glib::clone!(
|pad, parent, buffer| { #[weak]
element,
#[strong(rename_to = sess_id)]
self.id,
#[upgrade_or_panic]
move |pad, parent, buffer| {
let padret = gst::ProxyPad::chain_default(pad, parent, buffer); let padret = gst::ProxyPad::chain_default(pad, parent, buffer);
let state = element.imp().state.lock().unwrap(); let state = element.imp().state.lock().unwrap();
let Some(session) = state.sessions.get(&sess_id) else { let Some(session) = state.sessions.get(&sess_id) else {
@ -418,17 +423,31 @@ impl Session {
f f
} }
)) ))
.proxy_pad_event_function(glib::clone!(@weak element , @weak webrtcbin_pad as webrtcpad, @strong self.id as sess_id => @default-panic, move |pad, parent, event| { .proxy_pad_event_function(glib::clone!(
#[weak]
element,
#[weak(rename_to = webrtcpad)]
webrtcbin_pad,
#[strong(rename_to = sess_id)]
self.id,
#[upgrade_or_panic]
move |pad, parent, event| {
let event = if let gst::EventView::StreamStart(stream_start) = event.view() { let event = if let gst::EventView::StreamStart(stream_start) = event.view() {
let state = element.imp().state.lock().unwrap(); let state = element.imp().state.lock().unwrap();
if let Some(session) = state.sessions.get(&sess_id) { if let Some(session) = state.sessions.get(&sess_id) {
session.get_src_pad_from_webrtcbin_pad(&webrtcpad, &element) session
.get_src_pad_from_webrtcbin_pad(&webrtcpad, &element)
.map(|srcpad| { .map(|srcpad| {
gst::event::StreamStart::builder(&srcpad.imp().stream_id()) gst::event::StreamStart::builder(&srcpad.imp().stream_id())
.seqnum(stream_start.seqnum()) .seqnum(stream_start.seqnum())
.group_id(stream_start.group_id().unwrap_or_else(gst::GroupId::next)) .group_id(
stream_start
.group_id()
.unwrap_or_else(gst::GroupId::next),
)
.build() .build()
}).unwrap_or(event) })
.unwrap_or(event)
} else { } else {
gst::error!(CAT, obj: element , "session {sess_id:?} does not exist"); gst::error!(CAT, obj: element , "session {sess_id:?} does not exist");
event event
@ -438,10 +457,10 @@ impl Session {
}; };
gst::Pad::event_default(pad, parent, event) gst::Pad::event_default(pad, parent, event)
})) }
))
.build(); .build();
let sess_id = self.id.clone();
if element if element
.imp() .imp()
.settings .settings
@ -451,7 +470,14 @@ impl Session {
{ {
webrtcbin_pad.add_probe( webrtcbin_pad.add_probe(
gst::PadProbeType::EVENT_UPSTREAM, gst::PadProbeType::EVENT_UPSTREAM,
glib::clone!(@weak element => @default-panic, move |_pad, info| { glib::clone!(
#[weak]
element,
#[strong(rename_to = sess_id)]
self.id,
#[upgrade_or]
gst::PadProbeReturn::Remove,
move |_pad, info| {
let Some(ev) = info.event() else { let Some(ev) = info.event() else {
return gst::PadProbeReturn::Ok; return gst::PadProbeReturn::Ok;
}; };
@ -461,13 +487,17 @@ impl Session {
let mut state = element.imp().state.lock().unwrap(); let mut state = element.imp().state.lock().unwrap();
if let Some(session) = state.sessions.get_mut(&sess_id) { if let Some(session) = state.sessions.get_mut(&sess_id) {
session.send_navigation_event(gst_video::NavigationEvent::parse(ev).unwrap(), &element); session.send_navigation_event(
gst_video::NavigationEvent::parse(ev).unwrap(),
&element,
);
} else { } else {
gst::error!(CAT, obj: element , "session {sess_id:?} does not exist"); gst::error!(CAT, obj: element , "session {sess_id:?} does not exist");
} }
gst::PadProbeReturn::Ok gst::PadProbeReturn::Ok
}), }
),
); );
} }
@ -502,15 +532,17 @@ impl Session {
.expect("decodebin3 needs to be present!"); .expect("decodebin3 needs to be present!");
bin.add(&decodebin).unwrap(); bin.add(&decodebin).unwrap();
decodebin.sync_state_with_parent().unwrap(); decodebin.sync_state_with_parent().unwrap();
decodebin.connect_pad_added( decodebin.connect_pad_added(glib::clone!(
glib::clone!(@weak element as this, @weak ghostpad as ghostpad => move |_webrtcbin, pad| { #[weak]
ghostpad,
move |_webrtcbin, pad| {
if pad.direction() == gst::PadDirection::Sink { if pad.direction() == gst::PadDirection::Sink {
return; return;
} }
ghostpad.set_target(Some(pad)).unwrap(); ghostpad.set_target(Some(pad)).unwrap();
}), }
); ));
gst::debug!(CAT, obj: element, "Decoding for {}", srcpad.imp().stream_id()); gst::debug!(CAT, obj: element, "Decoding for {}", srcpad.imp().stream_id());
@ -684,18 +716,19 @@ impl Session {
gst::info!(CAT, obj: element, "Set remote description"); gst::info!(CAT, obj: element, "Set remote description");
let obj = element.clone(); let promise = gst::Promise::with_change_func(glib::clone!(
#[weak]
let session_id = self.id.clone(); element,
let promise = #[strong(rename_to = session_id)]
gst::Promise::with_change_func(glib::clone!(@weak element as ele => move |reply| { self.id,
let state = ele.imp().state.lock().unwrap(); move |reply| {
gst::info!(CAT, obj: ele, "got answer for session {session_id:?}"); let state = element.imp().state.lock().unwrap();
gst::info!(CAT, obj: element, "got answer for session {session_id:?}");
let Some(session) = state.sessions.get(&session_id) else { let Some(session) = state.sessions.get(&session_id) else {
gst::error!(CAT, obj: ele , "no session {session_id:?}"); gst::error!(CAT, obj: element , "no session {session_id:?}");
return return;
}; };
session.on_answer_created(reply, &obj); session.on_answer_created(reply, &element);
} }
)); ));
@ -843,7 +876,7 @@ impl BaseWebRTCSrc {
error: signaller.connect_closure( error: signaller.connect_closure(
"error", "error",
false, false,
glib::closure!(@watch instance => move | glib::closure!(#[watch] instance, move |
_signaller: glib::Object, error: String| { _signaller: glib::Object, error: String| {
gst::element_error!( gst::element_error!(
instance, instance,
@ -856,7 +889,7 @@ impl BaseWebRTCSrc {
session_started: signaller.connect_closure( session_started: signaller.connect_closure(
"session-started", "session-started",
false, false,
glib::closure!(@watch instance => move | glib::closure!(#[watch] instance, move |
_signaller: glib::Object, _signaller: glib::Object,
session_id: &str, session_id: &str,
_peer_id: &str| { _peer_id: &str| {
@ -869,7 +902,7 @@ impl BaseWebRTCSrc {
session_ended: signaller.connect_closure( session_ended: signaller.connect_closure(
"session-ended", "session-ended",
false, false,
glib::closure!(@watch instance => move |_signaler: glib::Object, session_id: &str|{ glib::closure!(#[watch] instance, move |_signaler: glib::Object, session_id: &str|{
let this = instance.imp(); let this = instance.imp();
let state = this.state.lock().unwrap(); let state = this.state.lock().unwrap();
let Some(session) = state.sessions.get(session_id) else { let Some(session) = state.sessions.get(session_id) else {
@ -900,7 +933,7 @@ impl BaseWebRTCSrc {
request_meta: signaller.connect_closure( request_meta: signaller.connect_closure(
"request-meta", "request-meta",
false, false,
glib::closure!(@watch instance => move | glib::closure!(#[watch] instance, move |
_signaller: glib::Object| -> Option<gst::Structure> { _signaller: glib::Object| -> Option<gst::Structure> {
instance.imp().settings.lock().unwrap().meta.clone() instance.imp().settings.lock().unwrap().meta.clone()
}), }),
@ -909,7 +942,7 @@ impl BaseWebRTCSrc {
session_description: signaller.connect_closure( session_description: signaller.connect_closure(
"session-description", "session-description",
false, false,
glib::closure!(@watch instance => move | glib::closure!(#[watch] instance, move |
_signaller: glib::Object, _signaller: glib::Object,
session_id: &str, session_id: &str,
desc: &gst_webrtc::WebRTCSessionDescription| { desc: &gst_webrtc::WebRTCSessionDescription| {
@ -934,7 +967,7 @@ impl BaseWebRTCSrc {
handle_ice: signaller.connect_closure( handle_ice: signaller.connect_closure(
"handle-ice", "handle-ice",
false, false,
glib::closure!(@watch instance => move | glib::closure!(#[watch] instance, move |
_signaller: glib::Object, _signaller: glib::Object,
session_id: &str, session_id: &str,
sdp_m_line_index: u32, sdp_m_line_index: u32,
@ -1079,90 +1112,110 @@ impl BaseWebRTCSrc {
let bin = gst::Bin::new(); let bin = gst::Bin::new();
bin.connect_pad_removed( bin.connect_pad_removed(glib::clone!(
glib::clone!(@weak self as this, @to-owned session_id => move |_, pad| #[weak(rename_to = this)]
self,
#[to_owned]
session_id,
move |_, pad| {
let mut state = this.state.lock().unwrap(); let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::warning!(CAT, imp: this, "session {session_id:?} not found"); gst::warning!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
session.flow_combiner.lock().unwrap().remove_pad(pad); session.flow_combiner.lock().unwrap().remove_pad(pad);
), }
); ));
bin.connect_pad_added( bin.connect_pad_added(glib::clone!(
glib::clone!(@weak self as this, @to-owned session_id => move |_, pad| #[weak(rename_to = this)]
self,
#[to_owned]
session_id,
move |_, pad| {
let mut state = this.state.lock().unwrap(); let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::warning!(CAT, imp: this, "session {session_id:?} not found"); gst::warning!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
session.flow_combiner.lock().unwrap().add_pad(pad); session.flow_combiner.lock().unwrap().add_pad(pad);
}
));
), webrtcbin.connect_pad_added(glib::clone!(
); #[weak(rename_to = this)]
self,
webrtcbin.connect_pad_added( #[weak]
glib::clone!(@weak self as this, @weak bin, @to-owned session_id => move |_webrtcbin, pad| { bin,
#[to_owned]
session_id,
move |_webrtcbin, pad| {
if pad.direction() == gst::PadDirection::Sink { if pad.direction() == gst::PadDirection::Sink {
return; return;
} }
let mut state = this.state.lock().unwrap(); let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::error!(CAT, imp: this, "session {session_id:?} not found"); gst::error!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
let bin_ghostpad = session.handle_webrtc_src_pad(&bin, pad, &this.obj()); let bin_ghostpad = session.handle_webrtc_src_pad(&bin, pad, &this.obj());
drop(state); drop(state);
bin.add_pad(&bin_ghostpad) bin.add_pad(&bin_ghostpad)
.expect("Adding ghostpad to the bin should always work"); .expect("Adding ghostpad to the bin should always work");
}), }
); ));
webrtcbin.connect_pad_removed( webrtcbin.connect_pad_removed(glib::clone!(
glib::clone!(@weak self as this, @weak bin, @to-owned session_id => move |_webrtcbin, pad| { #[weak(rename_to = this)]
self,
#[to_owned]
session_id,
move |_webrtcbin, pad| {
let mut state = this.state.lock().unwrap(); let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::error!(CAT, imp: this, "session {session_id:?} not found"); gst::error!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
session.flow_combiner.lock().unwrap().remove_pad(pad); session.flow_combiner.lock().unwrap().remove_pad(pad);
}), }
); ));
webrtcbin.connect_closure( webrtcbin.connect_closure(
"on-ice-candidate", "on-ice-candidate",
false, false,
glib::closure!(@weak-allow-none self as this, @to-owned session_id => move | glib::closure!(
_webrtcbin: gst::Bin, #[weak(rename_to = this)]
sdp_m_line_index: u32, self,
candidate: String| { #[to_owned]
if let Some(ele) = this { session_id,
let mut state = ele.state.lock().unwrap(); move |_webrtcbin: gst::Bin, sdp_m_line_index: u32, candidate: String| {
let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::error!(CAT, imp: ele, "session {session_id:?} not found"); gst::error!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
session.on_ice_candidate(sdp_m_line_index, candidate, &ele.obj()); session.on_ice_candidate(sdp_m_line_index, candidate, &this.obj());
} }
}), ),
); );
webrtcbin.connect_closure( webrtcbin.connect_closure(
"on-data-channel", "on-data-channel",
false, false,
glib::closure!(@weak-allow-none self as this, @to-owned session_id => move | glib::closure!(
_webrtcbin: gst::Bin, #[weak(rename_to = this)]
data_channel: glib::Object| { self,
if let Some(ele) = this { #[to_owned]
let mut state = ele.state.lock().unwrap(); session_id,
move |_webrtcbin: gst::Bin, data_channel: glib::Object| {
let mut state = this.state.lock().unwrap();
let Some(session) = state.sessions.get_mut(&session_id) else { let Some(session) = state.sessions.get_mut(&session_id) else {
gst::error!(CAT, imp: ele, "session {session_id:?} not found"); gst::error!(CAT, imp: this, "session {session_id:?} not found");
return return;
}; };
session.on_data_channel(data_channel, &ele.obj()); session.on_data_channel(data_channel, &this.obj());
} }
}), ),
); );
bin.add(&webrtcbin).unwrap(); bin.add(&webrtcbin).unwrap();

View file

@ -453,32 +453,34 @@ impl SignallableImpl for WhipClient {
glib::closure!(|signaller: &super::WhipClientSignaller, glib::closure!(|signaller: &super::WhipClientSignaller,
_consumer_identifier: &str, _consumer_identifier: &str,
webrtcbin: &gst::Element| { webrtcbin: &gst::Element| {
let obj_weak = signaller.downgrade(); webrtcbin.connect_notify(
webrtcbin.connect_notify(Some("ice-gathering-state"), move |webrtcbin, _pspec| { Some("ice-gathering-state"),
let Some(obj) = obj_weak.upgrade() else { glib::clone!(
return; #[weak]
}; signaller,
move |webrtcbin, _pspec| {
let state = let state = webrtcbin
webrtcbin.property::<WebRTCICEGatheringState>("ice-gathering-state"); .property::<WebRTCICEGatheringState>("ice-gathering-state");
match state { match state {
WebRTCICEGatheringState::Gathering => { WebRTCICEGatheringState::Gathering => {
gst::info!(CAT, obj: obj, "ICE gathering started"); gst::info!(CAT, obj: signaller, "ICE gathering started");
} }
WebRTCICEGatheringState::Complete => { WebRTCICEGatheringState::Complete => {
gst::info!(CAT, obj: obj, "ICE gathering complete"); gst::info!(CAT, obj: signaller, "ICE gathering complete");
let webrtcbin = webrtcbin.clone(); let webrtcbin = webrtcbin.clone();
RUNTIME.spawn(async move { RUNTIME.spawn(async move {
/* Note that we check for a valid WHIP endpoint in change_state */ /* Note that we check for a valid WHIP endpoint in change_state */
obj.imp().send_offer(&webrtcbin).await signaller.imp().send_offer(&webrtcbin).await
}); });
} }
_ => (), _ => (),
} }
}); }
),
);
}), }),
); );
@ -657,25 +659,27 @@ impl WhipServer {
glib::closure!(|signaller: &super::WhipServerSignaller, glib::closure!(|signaller: &super::WhipServerSignaller,
_producer_identifier: &str, _producer_identifier: &str,
webrtcbin: &gst::Element| { webrtcbin: &gst::Element| {
let obj_weak = signaller.downgrade(); webrtcbin.connect_notify(
webrtcbin.connect_notify(Some("ice-gathering-state"), move |webrtcbin, _pspec| { Some("ice-gathering-state"),
let obj = match obj_weak.upgrade() { glib::clone!(
Some(obj) => obj, #[weak]
None => return, signaller,
}; move |webrtcbin, _pspec| {
let state =
let state = webrtcbin.property::<WebRTCICEGatheringState>("ice-gathering-state"); webrtcbin.property::<WebRTCICEGatheringState>("ice-gathering-state");
match state { match state {
WebRTCICEGatheringState::Gathering => { WebRTCICEGatheringState::Gathering => {
gst::info!(CAT, obj: obj, "ICE gathering started"); gst::info!(CAT, obj: signaller, "ICE gathering started");
} }
WebRTCICEGatheringState::Complete => { WebRTCICEGatheringState::Complete => {
gst::info!(CAT, obj: obj, "ICE gathering complete"); gst::info!(CAT, obj: signaller, "ICE gathering complete");
let ans: Option<gst_sdp::SDPMessage>; let ans: Option<gst_sdp::SDPMessage>;
let mut settings = obj.imp().settings.lock().unwrap(); let mut settings = signaller.imp().settings.lock().unwrap();
if let Some(answer_desc) = webrtcbin if let Some(answer_desc) = webrtcbin
.property::<Option<WebRTCSessionDescription>>("local-description") .property::<Option<WebRTCSessionDescription>>(
"local-description",
)
{ {
ans = Some(answer_desc.sdp().to_owned()); ans = Some(answer_desc.sdp().to_owned());
} else { } else {
@ -686,21 +690,17 @@ impl WhipServer {
.take() .take()
.expect("SDP answer Sender needs to be valid"); .expect("SDP answer Sender needs to be valid");
let obj_weak = obj.downgrade(); RUNTIME.spawn(glib::clone!(#[strong] signaller, async move {
RUNTIME.spawn(async move {
let obj = match obj_weak.upgrade() {
Some(obj) => obj,
None => return,
};
if let Err(e) = tx.send(ans).await { if let Err(e) = tx.send(ans).await {
gst::error!(CAT, obj: obj, "Failed to send SDP {e}"); gst::error!(CAT, obj: signaller, "Failed to send SDP {e}");
} }
}); }));
} }
_ => (), _ => (),
} }
}); }
),
);
}) })
} }
@ -940,37 +940,29 @@ impl WhipServer {
let prefix = warp::path(ROOT); let prefix = warp::path(ROOT);
let self_weak = self.downgrade();
// POST /endpoint // POST /endpoint
let post_filter = warp::post() let post_filter = warp::post()
.and(warp::path(ENDPOINT_PATH)) .and(warp::path(ENDPOINT_PATH))
.and(warp::path::end()) .and(warp::path::end())
.and(warp::header::exact(CONTENT_TYPE.as_str(), CONTENT_SDP)) .and(warp::header::exact(CONTENT_TYPE.as_str(), CONTENT_SDP))
.and(warp::body::bytes()) .and(warp::body::bytes())
.and_then(move |body| { .and_then(glib::clone!(
let s = self_weak.upgrade(); #[weak(rename_to = self_)]
async { self,
let self_ = s.expect("Need to have the ObjectRef"); #[upgrade_or_panic]
self_.post_handler(body).await move |body| async move { self_.post_handler(body).await }
} ));
});
let self_weak = self.downgrade();
// OPTIONS /endpoint // OPTIONS /endpoint
let options_filter = warp::options() let options_filter = warp::options()
.and(warp::path(ENDPOINT_PATH)) .and(warp::path(ENDPOINT_PATH))
.and(warp::path::end()) .and(warp::path::end())
.and_then(move || { .and_then(glib::clone!(
let s = self_weak.upgrade(); #[weak(rename_to = self_)]
async { self,
let self_ = s.expect("Need to have the ObjectRef"); #[upgrade_or_panic]
self_.options_handler().await move || async move { self_.options_handler().await }
} ));
});
let self_weak = self.downgrade();
// PATCH /resource/:id // PATCH /resource/:id
let patch_filter = warp::patch() let patch_filter = warp::patch()
@ -981,28 +973,24 @@ impl WhipServer {
CONTENT_TYPE.as_str(), CONTENT_TYPE.as_str(),
CONTENT_TRICKLE_ICE, CONTENT_TRICKLE_ICE,
)) ))
.and_then(move |id| { .and_then(glib::clone!(
let s = self_weak.upgrade(); #[weak(rename_to = self_)]
async { self,
let self_ = s.expect("Need to have the ObjectRef"); #[upgrade_or_panic]
self_.patch_handler(id).await move |id| async move { self_.patch_handler(id).await }
} ));
});
let self_weak = self.downgrade();
// DELETE /resource/:id // DELETE /resource/:id
let delete_filter = warp::delete() let delete_filter = warp::delete()
.and(warp::path(RESOURCE_PATH)) .and(warp::path(RESOURCE_PATH))
.and(warp::path::param::<String>()) .and(warp::path::param::<String>())
.and(warp::path::end()) .and(warp::path::end())
.and_then(move |id| { .and_then(glib::clone!(
let s = self_weak.upgrade(); #[weak(rename_to = self_)]
async { self,
let self_ = s.expect("Need to have the ObjectRef"); #[upgrade_or_panic]
self_.delete_handler(id).await move |id| async move { self_.delete_handler(id).await }
} ));
});
let api = prefix let api = prefix
.and(post_filter) .and(post_filter)