#gtk4 #gst

gst-plugin-gtk4

GStreamer GTK 4 Sink element and Paintable widget

19 releases

0.11.2 Nov 11, 2023
0.11.0 Aug 10, 2023
0.10.10 Jul 5, 2023
0.10.5 Mar 19, 2023
0.0.0 Oct 13, 2021

#106 in Video

Download history 453/week @ 2023-08-18 538/week @ 2023-08-25 563/week @ 2023-09-01 510/week @ 2023-09-08 603/week @ 2023-09-15 628/week @ 2023-09-22 585/week @ 2023-09-29 518/week @ 2023-10-06 483/week @ 2023-10-13 466/week @ 2023-10-20 1121/week @ 2023-10-27 851/week @ 2023-11-03 892/week @ 2023-11-10 548/week @ 2023-11-17 982/week @ 2023-11-24 695/week @ 2023-12-01

3,241 downloads per month
Used in 5 crates

MPL-2.0 license

70KB
1.5K SLoC

Gtk 4 Sink & Paintable

GTK 4 provides gtk::Video & gtk::Picture for rendering media such as videos. As the default gtk::Video widget doesn't offer the possibility to use a custom gst::Pipeline. The plugin provides a gst_video::VideoSink along with a gdk::Paintable that's capable of rendering the sink's frames.

The Sink can generate GL Textures if the system is capable of it, but it needs to be compiled with either wayland, x11glx or x11egl cargo features.

Flatpak Integration

To build and include the plugin in a Flatpak manifest, you can add the following snippet to your json manifest:

{
    "sdk-extensions": [
        "org.freedesktop.Sdk.Extension.rust-stable"
    ],
    "build-options": {
        "env": {
            "CARGO_HOME": "/run/build/cargo-c/cargo"
        },
        "append-path": "/usr/lib/sdk/rust-stable/bin",
    },
    "modules": [
        {
            "name": "cargo-c",
            "buildsystem": "simple",
            "build-commands": [
                "cargo install cargo-c --root /app"
            ],
            "build-options": {
                "build-args": [
                    "--share=network"
                ]
            },
            "cleanup": [
                "*"
            ]
        },
        {
            "name": "gst-plugins-rs",
            "buildsystem": "simple",
            "sources": [
                {
                    "type": "git",
                    "url": "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
                    "branch": "0.10"
                }
            ],
            "build-options": {
                "build-args": [
                    "--share=network"
                ]
            },
            "build-commands": [
                "cargo cinstall -p gst-plugin-gtk4 --prefix=/app"
            ]
        }
    ]
}

Dependencies

~21–31MB
~604K SLoC