summaryrefslogtreecommitdiff
path: root/ext/lv2
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2016-05-14 12:35:15 -0700
committerStefan Sauer <ensonic@users.sf.net>2016-05-15 14:47:22 -0700
commitda0a3d95e7ae9fec12ce289377896e07a7615d76 (patch)
tree555b08e6265ad11b55b85f8992b918e9f573f613 /ext/lv2
parent3101fe78f9f4020b4e44ffaf0b4bdcadffe61790 (diff)
downloadgstreamer-plugins-bad-da0a3d95e7ae9fec12ce289377896e07a7615d76.tar.gz
lv2: implemnt the map-extension
This is the most used one and at the same time easy to implement sing QGQuark.
Diffstat (limited to 'ext/lv2')
-rw-r--r--ext/lv2/README5
-rw-r--r--ext/lv2/gstlv2utils.c32
2 files changed, 34 insertions, 3 deletions
diff --git a/ext/lv2/README b/ext/lv2/README
index 770c10d0f..f3abb3c18 100644
--- a/ext/lv2/README
+++ b/ext/lv2/README
@@ -12,7 +12,8 @@ http://lv2plug.in/ns/lv2core
http://lv2plug.in/ns/ext/port-groups
and these host features:
-http://lv2plug.in/ns/ext/log/
+http://lv2plug.in/ns/ext/log
+http://lv2plug.in/ns/ext/urid
Example Pipeline:
@@ -38,6 +39,8 @@ TODO
- we should sync, then fill the buffer and connect the port
* support presets
* support more host features
+ GST_DEBUG="lv2:4" GST_DEBUG_FILE=/tmp/gst.log gst-inspect lv2
+ grep -o "needs host feature: .*$" /tmp/gst.log | sort | uniq -c | sort -n
* samples sources:
http://svn.drobilla.net/lad/trunk/lilv/utils/lv2info.c
diff --git a/ext/lv2/gstlv2utils.c b/ext/lv2/gstlv2utils.c
index 638aef34e..7b841eddf 100644
--- a/ext/lv2/gstlv2utils.c
+++ b/ext/lv2/gstlv2utils.c
@@ -28,6 +28,7 @@
#include "gstlv2utils.h"
#include <lv2/lv2plug.in/ns/ext/log/log.h>
+#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
GST_DEBUG_CATEGORY_EXTERN (lv2_debug);
#define GST_CAT_DEFAULT lv2_debug
@@ -56,16 +57,43 @@ lv2_log_vprintf (LV2_Log_Handle handle, LV2_URID type,
}
static LV2_Log_Log lv2_log = {
- NULL, /* handle */
- lv2_log_printf, lv2_log_vprintf,
+ /* handle = */ NULL, lv2_log_printf, lv2_log_vprintf
};
+
static const LV2_Feature lv2_log_feature = { LV2_LOG__log, &lv2_log };
+/* - urid map/unmap extension */
+
+static LV2_URID
+lv2_urid_map (LV2_URID_Map_Handle handle, const char *uri)
+{
+ return (LV2_URID) g_quark_from_string (uri);
+}
+
+static const char *
+lv2_urid_unmap (LV2_URID_Unmap_Handle handle, LV2_URID urid)
+{
+ return g_quark_to_string ((GQuark) urid);
+}
+
+static LV2_URID_Map lv2_map = {
+ /* handle = */ NULL, lv2_urid_map
+};
+
+static LV2_URID_Unmap lv2_unmap = {
+ /* handle = */ NULL, lv2_urid_unmap
+};
+
+static const LV2_Feature lv2_map_feature = { LV2_URID__map, &lv2_map };
+static const LV2_Feature lv2_unmap_feature = { LV2_URID__unmap, &lv2_unmap };
+
/* feature list */
static const LV2_Feature *lv2_features[] = {
&lv2_log_feature,
+ &lv2_map_feature,
+ &lv2_unmap_feature,
NULL
};