mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 23:11:01 +00:00
gtk4: example: Use a bin with a videoconvert
in the non-GL case
The sink only supports RGB formats in that case, which decoders rarely would output. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/995>
This commit is contained in:
parent
599d3a4d8a
commit
8c457cfa04
1 changed files with 15 additions and 1 deletions
|
@ -42,7 +42,21 @@ fn create_ui(app: >k::Application) {
|
||||||
(src, sink)
|
(src, sink)
|
||||||
} else {
|
} else {
|
||||||
let src = gst::ElementFactory::make("videotestsrc").build().unwrap();
|
let src = gst::ElementFactory::make("videotestsrc").build().unwrap();
|
||||||
(src, gtksink)
|
|
||||||
|
let sink = gst::Bin::default();
|
||||||
|
let convert = gst::ElementFactory::make("videoconvert").build().unwrap();
|
||||||
|
|
||||||
|
sink.add(&convert).unwrap();
|
||||||
|
sink.add(>ksink).unwrap();
|
||||||
|
convert.link(>ksink).unwrap();
|
||||||
|
|
||||||
|
sink.add_pad(
|
||||||
|
&gst::GhostPad::with_target(Some("sink"), &convert.static_pad("sink").unwrap())
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
(src, sink.upcast())
|
||||||
};
|
};
|
||||||
|
|
||||||
pipeline.add_many(&[&src, &overlay, &sink]).unwrap();
|
pipeline.add_many(&[&src, &overlay, &sink]).unwrap();
|
||||||
|
|
Loading…
Reference in a new issue