From dbb8abc1178720020ca872361e23b2e941b874f4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 21 Apr 2023 17:38:15 +0200 Subject: Fix video for cameras with rotated image --- plugins/rtp/src/video_widget.vala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'plugins/rtp/src/video_widget.vala') diff --git a/plugins/rtp/src/video_widget.vala b/plugins/rtp/src/video_widget.vala index 0d66476b..20123c68 100644 --- a/plugins/rtp/src/video_widget.vala +++ b/plugins/rtp/src/video_widget.vala @@ -227,9 +227,21 @@ public class Dino.Plugins.Rtp.VideoWidget : Gtk.Widget, Dino.Plugins.VideoCallWi if (connected_device == null) return; plugin.pause(); pipe.add(sink); +#if GST_1_20 + prepare = Gst.parse_bin_from_description(@"videoflip video-direction=auto name=video_widget_$(id)_orientation ! videoflip method=horizontal-flip name=video_widget_$(id)_flip ! videoconvert name=video_widget_$(id)_convert", true); +#else prepare = Gst.parse_bin_from_description(@"videoflip method=horizontal-flip name=video_widget_$(id)_flip ! videoconvert name=video_widget_$(id)_convert", true); +#endif prepare.name = @"video_widget_$(id)_prepare"; - prepare.get_static_pad("sink").notify["caps"].connect(input_caps_changed); +#if GST_1_20 + if (prepare is Gst.Bin) { + ((Gst.Bin) prepare).get_by_name(@"video_widget_$(id)_flip").get_static_pad("sink").notify["caps"].connect(input_caps_changed); + } else { +#endif + prepare.get_static_pad("sink").notify["caps"].connect(input_caps_changed); +#if GST_1_20 + } +#endif pipe.add(prepare); connected_device_element = connected_device.link_source(); connected_device_element.link(prepare); -- cgit v1.2.3-54-g00ecf