From cde1e38f5d56269addff93b36c57299cbf546279 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 21 Mar 2021 15:42:58 +0100 Subject: RTP: Backport gst_caps_copy_nth from GStreamer 1.16 --- plugins/rtp/src/device.vala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'plugins/rtp/src/device.vala') diff --git a/plugins/rtp/src/device.vala b/plugins/rtp/src/device.vala index 796be203..570c6667 100644 --- a/plugins/rtp/src/device.vala +++ b/plugins/rtp/src/device.vala @@ -104,14 +104,22 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object { best_index = i; } } - return device.caps.copy_nth(best_index); + return caps_copy_nth(device.caps, best_index); } else if (device.caps.get_size() > 0) { - return device.caps.copy_nth(0); + return caps_copy_nth(device.caps, 0); } else { return new Gst.Caps.any(); } } + // Backport from gst_caps_copy_nth added in GStreamer 1.16 + private static Gst.Caps caps_copy_nth(Gst.Caps source, uint index) { + Gst.Caps target = new Gst.Caps.empty(); + target.flags = source.flags; + target.append_structure_full(source.get_structure(index).copy(), source.get_features(index).copy()); + return target; + } + private void create() { debug("Creating device %s", id); plugin.pause(); -- cgit v1.2.3-54-g00ecf