diff options
author | Marvin W <git@larma.de> | 2021-03-23 15:09:06 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2021-03-23 15:11:00 +0100 |
commit | b01f6f9ef7c0e8b0a15149426a47a238a5f6f1ce (patch) | |
tree | c5802a0446fed13a0b006eed9aa564968089afad /plugins/rtp/src/device.vala | |
parent | c8a37c02462f3eef2c6d26fbfbe2079da1b7a34f (diff) | |
download | dino-b01f6f9ef7c0e8b0a15149426a47a238a5f6f1ce.tar.gz dino-b01f6f9ef7c0e8b0a15149426a47a238a5f6f1ce.zip |
Resample audio data for common 48k sample rate
Diffstat (limited to 'plugins/rtp/src/device.vala')
-rw-r--r-- | plugins/rtp/src/device.vala | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/rtp/src/device.vala b/plugins/rtp/src/device.vala index 570c6667..20762f77 100644 --- a/plugins/rtp/src/device.vala +++ b/plugins/rtp/src/device.vala @@ -59,7 +59,7 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object { if (element == null) create(); links++; if (mixer != null) return mixer; - if (is_sink && media == "audio") return plugin.echoprobe; + if (is_sink && media == "audio") return filter; return element; } @@ -146,9 +146,10 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object { element.@set("sync", false); } if (is_sink && media == "audio") { -// mixer = Gst.ElementFactory.make("audiomixer", @"$id-mixer"); -// pipe.add(mixer); -// mixer.link(plugin.echoprobe); + filter = Gst.ElementFactory.make("capsfilter", @"$id-caps-filter"); + filter.@set("caps", get_best_caps()); + pipe.add(filter); + filter.link(plugin.echoprobe); plugin.echoprobe.link(element); } plugin.unpause(); @@ -173,6 +174,13 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object { pipe.remove(mixer); mixer = null; } else if (is_sink && media == "audio") { + if (filter != null) { + filter.set_locked_state(true); + filter.set_state(Gst.State.NULL); + filter.unlink(plugin.echoprobe); + pipe.remove(filter); + filter = null; + } plugin.echoprobe.unlink(element); } element.set_locked_state(true); |