gtk4paintablesink: Wrong colour space when used in conjunction with vaapi.
Describe your issue
When using gtk4paintablesink, if used in conjunction with playbin pipeline using vaapidecodebin, the wrong color space is used. e.g. What should be green shows as purple.
Setup
- Operating System: Fedora 39
- Device: Computer with Intel gpu
- gst-plugins-rs Version: 0.11.2
- GStreamer Version: 1.22.7
- Command line: zsh?
Steps to reproduce the bug
- Ensure vaapi operational by running
vainfo
, and ensuring profiles are listed. - Save the following rust code to disk:
Cargo.toml
[package]
name = "gst-gtk4-test"
version = "0.1.0"
edition = "2021"
[dependencies]
gtk4 = "0.7.3"
gdk4 = "0.7.3"
gstreamer = { version = "0.21", features = ["v1_16"] }
gstreamer-play = { version = "0.21" }
gstreamer-video = { version = "0.21", features = ["v1_16"] }
gst-plugin-gtk4 = "0.11.2"
main.rs
use glib::clone;
use gstreamer::prelude::*;
use gstreamer::{Pipeline, Element, State};
use gtk4::prelude::*;
use gtk4::{glib, Application, ApplicationWindow, Picture};
fn main() -> glib::ExitCode {
gstreamer::init().unwrap();
gtk4::init().unwrap();
gstgtk4::plugin_register_static().expect("Failed to register gstgtk4 plugin");
let app = Application::builder()
.application_id("gst-gtk4-test")
.build();
app.connect_activate(build_ui);
let res = app.run();
unsafe {
gstreamer::deinit();
}
return res;
}
fn build_ui(app: &Application) {
let picture = Picture::new();
let window = ApplicationWindow::builder()
.application(app)
.title("Gstreamer GTK4 Rust Test")
.child(&picture)
.default_width(640)
.default_height(480)
.build();
let pipeline = gstreamer::parse_launch(
"playbin uri=http://docs.evostream.com/sample_content/assets/bun33s.mp4 video-sink=gtk4paintablesink",
)
.unwrap()
.downcast::<Pipeline>()
.unwrap();
let sink = pipeline.property::<Element>("video-sink");
let paintable = sink.property::<gdk4::Paintable>("paintable");
picture.set_paintable(Some(&paintable));
pipeline.set_state(State::Playing).unwrap();
picture.connect_destroy(clone!(@strong pipeline =>
move |_| {
pipeline.set_state(State::Null).unwrap();
}
));
window.present();
}
- Run with vaapi enable:
cargo run
- Compare to run with vaapi disabled:
LIBVA_DRIVER_NAME=fakedriver cargo run
How reproducible is the bug?
Always
Additional Information
I'm trying to get a dot file of the pipeline, but for some reason GST_DEBUG_DUMP_DOT_DIR
is not doing anything. I'll continue trying to get this.