Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2022-11-30 12:58:26 +0300
committerSebastian Dröge <sebastian@centricular.com>2022-11-30 12:59:53 +0300
commit8c457cfa04cd413e0a4ebb28c838a59b44879af9 (patch)
tree6b20adc57b483d2c21305c564b343ffeca5712b7 /video
parent599d3a4d8a03ff96efb17076a0da1646c681920c (diff)
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>
Diffstat (limited to 'video')
-rw-r--r--video/gtk4/examples/gtksink.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs
index bf271dd8..867dc1ea 100644
--- a/video/gtk4/examples/gtksink.rs
+++ b/video/gtk4/examples/gtksink.rs
@@ -42,7 +42,21 @@ fn create_ui(app: &gtk::Application) {
(src, sink)
} else {
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(&gtksink).unwrap();
+ convert.link(&gtksink).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();