aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-04-11 15:57:53 +0200
committerMarvin W <git@larma.de>2021-04-11 16:28:59 +0200
commitfe160d94ba8a08a806dc755d918dc3de0a645d7c (patch)
treed16c91f7e62694adbaedf0ed483e9e498e204cdf /plugins
parent4edab3c8d63b327dcb48799e174a3e00192721ec (diff)
downloaddino-fe160d94ba8a08a806dc755d918dc3de0a645d7c.tar.gz
dino-fe160d94ba8a08a806dc755d918dc3de0a645d7c.zip
Handle broken VAPI in older vala
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rtp/src/stream.vala21
1 files changed, 19 insertions, 2 deletions
diff --git a/plugins/rtp/src/stream.vala b/plugins/rtp/src/stream.vala
index efa1b497..3a63f3fa 100644
--- a/plugins/rtp/src/stream.vala
+++ b/plugins/rtp/src/stream.vala
@@ -300,7 +300,17 @@ public class Dino.Plugins.Rtp.Stream : Xmpp.Xep.JingleRtp.Stream {
}
}
if (push_recv_data) {
- recv_rtp.push_buffer(new Gst.Buffer.wrapped((owned) data));
+ Gst.Buffer buffer = new Gst.Buffer.wrapped((owned) data);
+ // FIXME: VAPI file in Vala < 0.49.1 has a bug that results in broken ownership of buffer in push_buffer()
+ // We workaround by using the plain signal. The signal unfortunately will cause an unnecessary copy of
+ // the underlying buffer, so and some point we should move over to the new version (once we require
+ // Vala >= 0.50)
+#if FIXED_APPSRC_PUSH_BUFFER_IN_VAPI
+ recv_rtp.push_buffer((owned) buffer);
+#else
+ Gst.FlowReturn ret;
+ GLib.Signal.emit_by_name(recv_rtp, "push-buffer", buffer, out ret);
+#endif
}
}
@@ -315,7 +325,14 @@ public class Dino.Plugins.Rtp.Stream : Xmpp.Xep.JingleRtp.Stream {
}
}
if (push_recv_data) {
- recv_rtcp.push_buffer(new Gst.Buffer.wrapped((owned) data));
+ Gst.Buffer buffer = new Gst.Buffer.wrapped((owned) data);
+ // See above
+#if FIXED_APPSRC_PUSH_BUFFER_IN_VAPI
+ recv_rtcp.push_buffer((owned) buffer);
+#else
+ Gst.FlowReturn ret;
+ GLib.Signal.emit_by_name(recv_rtcp, "push-buffer", buffer, out ret);
+#endif
}
}