diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-11-30 12:58:26 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-11-30 12:59:53 +0300 |
commit | 8c457cfa04cd413e0a4ebb28c838a59b44879af9 (patch) | |
tree | 6b20adc57b483d2c21305c564b343ffeca5712b7 /video | |
parent | 599d3a4d8a03ff96efb17076a0da1646c681920c (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.rs | 16 |
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: >k::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(>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(); |