mirror of
https://github.com/TakeV-Lambda/dino.git
synced 2024-11-04 14:57:44 +00:00
RTP: Backport gst_caps_copy_nth from GStreamer 1.16
This commit is contained in:
parent
c6c677d62d
commit
cde1e38f5d
1 changed files with 10 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue