GStreamer compat
This commit is contained in:
parent
5e11986838
commit
6ebdec1d78
|
@ -9,6 +9,10 @@ find_packages(RTP_PACKAGES REQUIRED
|
||||||
GstApp
|
GstApp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(Gst_VERSION VERSION_GREATER "1.16")
|
||||||
|
set(RTP_DEFINITIONS GST_1_16)
|
||||||
|
endif()
|
||||||
|
|
||||||
vala_precompile(RTP_VALA_C
|
vala_precompile(RTP_VALA_C
|
||||||
SOURCES
|
SOURCES
|
||||||
src/codec_util.vala
|
src/codec_util.vala
|
||||||
|
@ -25,6 +29,8 @@ CUSTOM_VAPIS
|
||||||
${CMAKE_BINARY_DIR}/exports/qlite.vapi
|
${CMAKE_BINARY_DIR}/exports/qlite.vapi
|
||||||
PACKAGES
|
PACKAGES
|
||||||
${RTP_PACKAGES}
|
${RTP_PACKAGES}
|
||||||
|
DEFINITIONS
|
||||||
|
${RTP_DEFINITIONS}
|
||||||
OPTIONS
|
OPTIONS
|
||||||
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
|
--vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
|
||||||
)
|
)
|
||||||
|
|
|
@ -130,11 +130,13 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object {
|
||||||
filter.@set("caps", get_best_caps());
|
filter.@set("caps", get_best_caps());
|
||||||
pipe.add(filter);
|
pipe.add(filter);
|
||||||
element.link(filter);
|
element.link(filter);
|
||||||
if (media == "audio") {
|
if (media == "audio" && plugin.echoprobe != null) {
|
||||||
dsp = Gst.ElementFactory.make("webrtcdsp", @"$id-dsp");
|
dsp = Gst.ElementFactory.make("webrtcdsp", @"$id-dsp");
|
||||||
dsp.@set("probe", plugin.echoprobe.name);
|
if (dsp != null) {
|
||||||
pipe.add(dsp);
|
dsp.@set("probe", plugin.echoprobe.name);
|
||||||
filter.link(dsp);
|
pipe.add(dsp);
|
||||||
|
filter.link(dsp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tee = Gst.ElementFactory.make("tee", @"$id-tee");
|
tee = Gst.ElementFactory.make("tee", @"$id-tee");
|
||||||
tee.@set("allow-not-linked", true);
|
tee.@set("allow-not-linked", true);
|
||||||
|
@ -149,15 +151,19 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object {
|
||||||
filter = Gst.ElementFactory.make("capsfilter", @"$id-caps-filter");
|
filter = Gst.ElementFactory.make("capsfilter", @"$id-caps-filter");
|
||||||
filter.@set("caps", get_best_caps());
|
filter.@set("caps", get_best_caps());
|
||||||
pipe.add(filter);
|
pipe.add(filter);
|
||||||
filter.link(plugin.echoprobe);
|
if (plugin.echoprobe != null) {
|
||||||
plugin.echoprobe.link(element);
|
filter.link(plugin.echoprobe);
|
||||||
|
plugin.echoprobe.link(element);
|
||||||
|
} else {
|
||||||
|
filter.link(element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
plugin.unpause();
|
plugin.unpause();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void destroy() {
|
private void destroy() {
|
||||||
if (mixer != null) {
|
if (mixer != null) {
|
||||||
if (is_sink && media == "audio") {
|
if (is_sink && media == "audio" && plugin.echoprobe != null) {
|
||||||
plugin.echoprobe.unlink(mixer);
|
plugin.echoprobe.unlink(mixer);
|
||||||
}
|
}
|
||||||
int linked_sink_pads = 0;
|
int linked_sink_pads = 0;
|
||||||
|
@ -177,11 +183,17 @@ public class Dino.Plugins.Rtp.Device : MediaDevice, Object {
|
||||||
if (filter != null) {
|
if (filter != null) {
|
||||||
filter.set_locked_state(true);
|
filter.set_locked_state(true);
|
||||||
filter.set_state(Gst.State.NULL);
|
filter.set_state(Gst.State.NULL);
|
||||||
filter.unlink(plugin.echoprobe);
|
if (plugin.echoprobe != null) {
|
||||||
|
filter.unlink(plugin.echoprobe);
|
||||||
|
} else {
|
||||||
|
filter.unlink(element);
|
||||||
|
}
|
||||||
pipe.remove(filter);
|
pipe.remove(filter);
|
||||||
filter = null;
|
filter = null;
|
||||||
}
|
}
|
||||||
plugin.echoprobe.unlink(element);
|
if (plugin.echoprobe != null) {
|
||||||
|
plugin.echoprobe.unlink(element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
element.set_locked_state(true);
|
element.set_locked_state(true);
|
||||||
element.set_state(Gst.State.NULL);
|
element.set_state(Gst.State.NULL);
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object {
|
||||||
|
|
||||||
// Audio echo probe
|
// Audio echo probe
|
||||||
echoprobe = Gst.ElementFactory.make("webrtcechoprobe", "echo-probe");
|
echoprobe = Gst.ElementFactory.make("webrtcechoprobe", "echo-probe");
|
||||||
pipe.add(echoprobe);
|
if (echoprobe != null) pipe.add(echoprobe);
|
||||||
|
|
||||||
// Pipeline
|
// Pipeline
|
||||||
pipe.auto_flush_bus = true;
|
pipe.auto_flush_bus = true;
|
||||||
|
@ -178,6 +178,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object {
|
||||||
if (devices.any_match((it) => it.matches(device))) return Source.CONTINUE;
|
if (devices.any_match((it) => it.matches(device))) return Source.CONTINUE;
|
||||||
devices.add(new Device(this, device));
|
devices.add(new Device(this, device));
|
||||||
break;
|
break;
|
||||||
|
#if GST_1_16
|
||||||
case Gst.MessageType.DEVICE_CHANGED:
|
case Gst.MessageType.DEVICE_CHANGED:
|
||||||
message.parse_device_changed(out device, out old_device);
|
message.parse_device_changed(out device, out old_device);
|
||||||
if (device.properties.has_name("pipewire-proplist") && device.device_class.has_prefix("Audio/")) return Source.CONTINUE;
|
if (device.properties.has_name("pipewire-proplist") && device.device_class.has_prefix("Audio/")) return Source.CONTINUE;
|
||||||
|
@ -185,6 +186,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object {
|
||||||
old = devices.first_match((it) => it.matches(old_device));
|
old = devices.first_match((it) => it.matches(old_device));
|
||||||
if (old != null) old.update(device);
|
if (old != null) old.update(device);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case Gst.MessageType.DEVICE_REMOVED:
|
case Gst.MessageType.DEVICE_REMOVED:
|
||||||
message.parse_device_removed(out device);
|
message.parse_device_removed(out device);
|
||||||
if (device.properties.has_name("pipewire-proplist") && device.device_class.has_prefix("Audio/")) return Source.CONTINUE;
|
if (device.properties.has_name("pipewire-proplist") && device.device_class.has_prefix("Audio/")) return Source.CONTINUE;
|
||||||
|
|
Loading…
Reference in a new issue