aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-03-21 15:42:58 +0100
committerMarvin W <git@larma.de>2021-03-21 15:43:54 +0100
commitcde1e38f5d56269addff93b36c57299cbf546279 (patch)
tree450cad0b5ec507375009c5a47bf74ba54aa60e70 /plugins
parentc6c677d62da868953c3e5cba33ddee2f1f8047c7 (diff)
downloaddino-cde1e38f5d56269addff93b36c57299cbf546279.tar.gz
dino-cde1e38f5d56269addff93b36c57299cbf546279.zip
RTP: Backport gst_caps_copy_nth from GStreamer 1.16
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rtp/src/device.vala12
1 files changed, 10 insertions, 2 deletions
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();