From 7e7dcedaf31ee35499875491c9f569c575d28435 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 14 Feb 2022 14:55:59 +0100 Subject: Port from GTK3 to GTK4 --- plugins/rtp/CMakeLists.txt | 2 +- plugins/rtp/src/plugin.vala | 2 +- plugins/rtp/src/video_widget.vala | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/rtp') diff --git a/plugins/rtp/CMakeLists.txt b/plugins/rtp/CMakeLists.txt index c8652c54..61d53c97 100644 --- a/plugins/rtp/CMakeLists.txt +++ b/plugins/rtp/CMakeLists.txt @@ -7,7 +7,7 @@ find_packages(RTP_PACKAGES REQUIRED GModule GnuTLS GObject - GTK3 + GTK4 Gst GstApp GstAudio diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index dc446530..aefe41ff 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -297,7 +297,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { public VideoCallWidget? create_widget(WidgetType type) { init_call_pipe(); - if (type == WidgetType.GTK) { + if (type == WidgetType.GTK4) { return new VideoWidget(this); } return null; diff --git a/plugins/rtp/src/video_widget.vala b/plugins/rtp/src/video_widget.vala index 82693b09..7a56f787 100644 --- a/plugins/rtp/src/video_widget.vala +++ b/plugins/rtp/src/video_widget.vala @@ -3,7 +3,7 @@ private static extern void gst_value_set_fraction(ref GLib.Value value, int numerator, int denominator); #endif -public class Dino.Plugins.Rtp.VideoWidget : Gtk.Bin, Dino.Plugins.VideoCallWidget { +public class Dino.Plugins.Rtp.VideoWidget : Gtk.Widget, Dino.Plugins.VideoCallWidget { private const int RECAPS_AFTER_CHANGE = 5; private static uint last_id = 0; @@ -29,7 +29,7 @@ public class Dino.Plugins.Rtp.VideoWidget : Gtk.Bin, Dino.Plugins.VideoCallWidge this.plugin = plugin; id = last_id++; - sink = Gst.ElementFactory.make("gtksink", @"video_widget_$id") as Gst.Base.Sink; +// sink = Gst.ElementFactory.make("gtksink", @"video_widget_$id") as Gst.Base.Sink; if (sink != null) { Gtk.Widget widget; sink.@get("widget", out widget); @@ -37,13 +37,13 @@ public class Dino.Plugins.Rtp.VideoWidget : Gtk.Bin, Dino.Plugins.VideoCallWidge sink.@set("sync", true); sink.@set("ignore-alpha", false); this.widget = widget; - this.widget.draw.connect_after(fix_caps_issues); - add(widget); - widget.visible = true; +// this.widget.draw.connect_after(fix_caps_issues); + this.widget.insert_after(this, null); + this.widget.visible = true; } else { warning("Could not create GTK video sink. Won't display videos."); } - size_allocate.connect_after(after_size_allocate); +// size_allocate.connect_after(after_size_allocate); } public void input_caps_changed(GLib.Object pad, ParamSpec spec) { -- cgit v1.2.3-70-g09d2