summaryrefslogtreecommitdiff
blob: cdfa976d056088c29fab76db582bdb75c0f1a55b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
Bug: https://bugs.gentoo.org/716008

--- a/ext/lv2/gstlv2.c
+++ b/ext/lv2/gstlv2.c
@@ -69,6 +69,38 @@
 #error "Unsupported OS"
 #endif
 
+LilvWorld *gst_lv2_world_node = NULL;
+LilvNode *gst_lv2_audio_node = NULL;
+LilvNode *gst_lv2_control_node = NULL;
+LilvNode *gst_lv2_cv_node = NULL;
+LilvNode *gst_lv2_event_node = NULL;
+LilvNode *gst_lv2_input_node = NULL;
+LilvNode *gst_lv2_output_node = NULL;
+LilvNode *gst_lv2_preset_node = NULL;
+LilvNode *gst_lv2_state_iface_node = NULL;
+LilvNode *gst_lv2_state_uri_node = NULL;
+
+LilvNode *gst_lv2_integer_prop_node = NULL;
+LilvNode *gst_lv2_toggled_prop_node = NULL;
+LilvNode *gst_lv2_designation_pred_node = NULL;
+LilvNode *gst_lv2_in_place_broken_pred_node = NULL;
+LilvNode *gst_lv2_optional_pred_node = NULL;
+LilvNode *gst_lv2_group_pred_node = NULL;
+LilvNode *gst_lv2_supports_event_pred_node = NULL;
+LilvNode *gst_lv2_label_pred_node = NULL;
+
+LilvNode *gst_lv2_center_role_node = NULL;
+LilvNode *gst_lv2_left_role_node = NULL;
+LilvNode *gst_lv2_right_role_node = NULL;
+LilvNode *gst_lv2_rear_center_role_node = NULL;
+LilvNode *gst_lv2_rear_left_role_node = NULL;
+LilvNode *gst_lv2_rear_right_role_node = NULL;
+LilvNode *gst_lv2_lfe_role_node = NULL;
+LilvNode *gst_lv2_center_left_role_node = NULL;
+LilvNode *gst_lv2_center_right_role_node = NULL;
+LilvNode *gst_lv2_side_left_role_node = NULL;
+LilvNode *gst_lv2_side_right_role_node = NULL;
+
 GstStructure *lv2_meta_all = NULL;
 
 static void
@@ -98,9 +130,11 @@
   for (i = 0; i < lilv_plugin_get_num_ports (lv2plugin); i++) {
     const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, i);
 
-    if (lilv_port_is_a (lv2plugin, port, audio_class)) {
-      const gboolean is_input = lilv_port_is_a (lv2plugin, port, input_class);
-      LilvNodes *lv2group = lilv_port_get (lv2plugin, port, group_pred);
+    if (lilv_port_is_a (lv2plugin, port, gst_lv2_audio_node)) {
+      const gboolean is_input =
+          lilv_port_is_a (lv2plugin, port, gst_lv2_input_node);
+      LilvNodes *lv2group =
+          lilv_port_get (lv2plugin, port, gst_lv2_group_pred_node);
 
       if (lv2group) {
         const gchar *uri = lilv_node_as_uri (lv2group);
@@ -116,8 +150,8 @@
         (*audio_in)++;
       else
         (*audio_out)++;
-    } else if (lilv_port_is_a (lv2plugin, port, control_class) ||
-        lilv_port_is_a (lv2plugin, port, cv_class)) {
+    } else if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node) ||
+        lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node)) {
       (*control)++;
     }
   }
@@ -130,7 +164,7 @@
 {
   guint audio_in, audio_out, control;
   LilvIter *i;
-  const LilvPlugins *plugins = lilv_world_get_all_plugins (world);
+  const LilvPlugins *plugins = lilv_world_get_all_plugins (gst_lv2_world_node);
 
   for (i = lilv_plugins_begin (plugins); !lilv_plugins_is_end (plugins, i);
       i = lilv_plugins_next (plugins, i)) {
@@ -187,8 +221,9 @@
     }
 
     /* check supported extensions */
-    can_do_presets = lilv_plugin_has_extension_data (lv2plugin, state_iface)
-        || lilv_plugin_has_feature (lv2plugin, state_uri)
+    can_do_presets =
+        lilv_plugin_has_extension_data (lv2plugin, gst_lv2_state_iface_node)
+        || lilv_plugin_has_feature (lv2plugin, gst_lv2_state_uri_node)
         || (control > 0);
     GST_INFO ("plugin %s can%s do presets", type_name,
         (can_do_presets ? "" : "'t"));
@@ -224,8 +259,8 @@
   GST_DEBUG_CATEGORY_INIT (lv2_debug, "lv2",
       GST_DEBUG_FG_GREEN | GST_DEBUG_BG_BLACK | GST_DEBUG_BOLD, "LV2");
 
-  world = lilv_world_new ();
-  lilv_world_load_all (world);
+  gst_lv2_world_node = lilv_world_new ();
+  lilv_world_load_all (gst_lv2_world_node);
   gst_lv2_host_init ();
 
 /* have been added after lilv-0.22.0, which is the last release */
@@ -236,37 +271,57 @@
 #define LILV_URI_CV_PORT      "http://lv2plug.in/ns/lv2core#CVPort"
 #endif
 
-  atom_class = lilv_new_uri (world, LILV_URI_ATOM_PORT);
-  audio_class = lilv_new_uri (world, LILV_URI_AUDIO_PORT);
-  control_class = lilv_new_uri (world, LILV_URI_CONTROL_PORT);
-  cv_class = lilv_new_uri (world, LILV_URI_CV_PORT);
-  event_class = lilv_new_uri (world, LILV_URI_EVENT_PORT);
-  input_class = lilv_new_uri (world, LILV_URI_INPUT_PORT);
-  output_class = lilv_new_uri (world, LILV_URI_OUTPUT_PORT);
-  preset_class = lilv_new_uri (world, LV2_PRESETS__Preset);
-  state_iface = lilv_new_uri (world, LV2_STATE__interface);
-  state_uri = lilv_new_uri (world, LV2_STATE_URI);
-
-  integer_prop = lilv_new_uri (world, LV2_CORE__integer);
-  toggled_prop = lilv_new_uri (world, LV2_CORE__toggled);
-  designation_pred = lilv_new_uri (world, LV2_CORE__designation);
-  in_place_broken_pred = lilv_new_uri (world, LV2_CORE__inPlaceBroken);
-  optional_pred = lilv_new_uri (world, LV2_CORE__optionalFeature);
-  group_pred = lilv_new_uri (world, LV2_PORT_GROUPS__group);
-  supports_event_pred = lilv_new_uri (world, LV2_EVENT__supportsEvent);
-  label_pred = lilv_new_uri (world, LILV_NS_RDFS "label");
-
-  center_role = lilv_new_uri (world, LV2_PORT_GROUPS__center);
-  left_role = lilv_new_uri (world, LV2_PORT_GROUPS__left);
-  right_role = lilv_new_uri (world, LV2_PORT_GROUPS__right);
-  rear_center_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearCenter);
-  rear_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearLeft);
-  rear_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearLeft);
-  lfe_role = lilv_new_uri (world, LV2_PORT_GROUPS__lowFrequencyEffects);
-  center_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__centerLeft);
-  center_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__centerRight);
-  side_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideLeft);
-  side_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideRight);
+  gst_lv2_audio_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_AUDIO_PORT);
+  gst_lv2_control_node =
+      lilv_new_uri (gst_lv2_world_node, LILV_URI_CONTROL_PORT);
+  gst_lv2_cv_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_CV_PORT);
+  gst_lv2_event_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_EVENT_PORT);
+  gst_lv2_input_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_INPUT_PORT);
+  gst_lv2_output_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_OUTPUT_PORT);
+  gst_lv2_preset_node = lilv_new_uri (gst_lv2_world_node, LV2_PRESETS__Preset);
+  gst_lv2_state_iface_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_STATE__interface);
+  gst_lv2_state_uri_node = lilv_new_uri (gst_lv2_world_node, LV2_STATE_URI);
+
+  gst_lv2_integer_prop_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_CORE__integer);
+  gst_lv2_toggled_prop_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_CORE__toggled);
+  gst_lv2_designation_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_CORE__designation);
+  gst_lv2_in_place_broken_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_CORE__inPlaceBroken);
+  gst_lv2_optional_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_CORE__optionalFeature);
+  gst_lv2_group_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__group);
+  gst_lv2_supports_event_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_EVENT__supportsEvent);
+  gst_lv2_label_pred_node =
+      lilv_new_uri (gst_lv2_world_node, LILV_NS_RDFS "label");
+
+  gst_lv2_center_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__center);
+  gst_lv2_left_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__left);
+  gst_lv2_right_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__right);
+  gst_lv2_rear_center_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearCenter);
+  gst_lv2_rear_left_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearLeft);
+  gst_lv2_rear_right_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearRight);
+  gst_lv2_lfe_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__lowFrequencyEffects);
+  gst_lv2_center_left_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__centerLeft);
+  gst_lv2_center_right_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__centerRight);
+  gst_lv2_side_left_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__sideLeft);
+  gst_lv2_side_right_role_node =
+      lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__sideRight);
 
   gst_plugin_add_dependency_simple (plugin,
       "LV2_PATH:" GST_LV2_ENVVARS, GST_LV2_DEFAULT_PATH, NULL,
@@ -323,39 +378,38 @@
 #endif
      static void plugin_cleanup (GstPlugin * plugin)
 {
-  lilv_node_free (atom_class);
-  lilv_node_free (audio_class);
-  lilv_node_free (control_class);
-  lilv_node_free (cv_class);
-  lilv_node_free (event_class);
-  lilv_node_free (input_class);
-  lilv_node_free (output_class);
-  lilv_node_free (preset_class);
-  lilv_node_free (state_iface);
-  lilv_node_free (state_uri);
-
-  lilv_node_free (integer_prop);
-  lilv_node_free (toggled_prop);
-  lilv_node_free (designation_pred);
-  lilv_node_free (in_place_broken_pred);
-  lilv_node_free (optional_pred);
-  lilv_node_free (group_pred);
-  lilv_node_free (supports_event_pred);
-  lilv_node_free (label_pred);
-
-  lilv_node_free (center_role);
-  lilv_node_free (left_role);
-  lilv_node_free (right_role);
-  lilv_node_free (rear_center_role);
-  lilv_node_free (rear_left_role);
-  lilv_node_free (rear_right_role);
-  lilv_node_free (lfe_role);
-  lilv_node_free (center_left_role);
-  lilv_node_free (center_right_role);
-  lilv_node_free (side_left_role);
-  lilv_node_free (side_right_role);
+  lilv_node_free (gst_lv2_audio_node);
+  lilv_node_free (gst_lv2_control_node);
+  lilv_node_free (gst_lv2_cv_node);
+  lilv_node_free (gst_lv2_event_node);
+  lilv_node_free (gst_lv2_input_node);
+  lilv_node_free (gst_lv2_output_node);
+  lilv_node_free (gst_lv2_preset_node);
+  lilv_node_free (gst_lv2_state_iface_node);
+  lilv_node_free (gst_lv2_state_uri_node);
+
+  lilv_node_free (gst_lv2_integer_prop_node);
+  lilv_node_free (gst_lv2_toggled_prop_node);
+  lilv_node_free (gst_lv2_designation_pred_node);
+  lilv_node_free (gst_lv2_in_place_broken_pred_node);
+  lilv_node_free (gst_lv2_optional_pred_node);
+  lilv_node_free (gst_lv2_group_pred_node);
+  lilv_node_free (gst_lv2_supports_event_pred_node);
+  lilv_node_free (gst_lv2_label_pred_node);
+
+  lilv_node_free (gst_lv2_center_role_node);
+  lilv_node_free (gst_lv2_left_role_node);
+  lilv_node_free (gst_lv2_right_role_node);
+  lilv_node_free (gst_lv2_rear_center_role_node);
+  lilv_node_free (gst_lv2_rear_left_role_node);
+  lilv_node_free (gst_lv2_rear_right_role_node);
+  lilv_node_free (gst_lv2_lfe_role_node);
+  lilv_node_free (gst_lv2_center_left_role_node);
+  lilv_node_free (gst_lv2_center_right_role_node);
+  lilv_node_free (gst_lv2_side_left_role_node);
+  lilv_node_free (gst_lv2_side_right_role_node);
 
-  lilv_world_free (world);
+  lilv_world_free (gst_lv2_world_node);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
--- a/ext/lv2/gstlv2filter.c
+++ b/ext/lv2/gstlv2filter.c
@@ -183,37 +183,37 @@
 gst_lv2_filter_role_to_position (LilvNode * role)
 {
   /* Front.  Mono and left/right are mututally exclusive */
-  if (lilv_node_equals (role, center_role)) {
+  if (lilv_node_equals (role, gst_lv2_center_role_node)) {
 
     return GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER;
-  } else if (lilv_node_equals (role, left_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_left_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
-  } else if (lilv_node_equals (role, right_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_right_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
 
     /* Rear. Left/right and center are mututally exclusive */
-  } else if (lilv_node_equals (role, rear_center_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_rear_center_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_REAR_CENTER;
-  } else if (lilv_node_equals (role, rear_left_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_rear_left_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_REAR_LEFT;
-  } else if (lilv_node_equals (role, rear_right_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_rear_right_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT;
 
     /* Subwoofer/low-frequency-effects */
-  } else if (lilv_node_equals (role, lfe_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_lfe_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_LFE1;
 
     /* Center front speakers. Center and left/right_of_center
      * are mutually exclusive */
-  } else if (lilv_node_equals (role, center_left_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_center_left_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER;
-  } else if (lilv_node_equals (role, center_right_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_center_right_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER;
 
     /* sides */
-  } else if (lilv_node_equals (role, side_left_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_side_left_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT;
-  } else if (lilv_node_equals (role, side_right_role)) {
+  } else if (lilv_node_equals (role, gst_lv2_side_right_role_node)) {
     return GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT;
   }
 
@@ -531,7 +531,8 @@
 {
   gst_lv2_init (&self->lv2, &klass->lv2);
 
-  if (!lilv_plugin_has_feature (klass->lv2.plugin, in_place_broken_pred))
+  if (!lilv_plugin_has_feature (klass->lv2.plugin,
+          gst_lv2_in_place_broken_pred_node))
     gst_base_transform_set_in_place (GST_BASE_TRANSFORM (self), TRUE);
 }
 
--- a/ext/lv2/gstlv2.h
+++ b/ext/lv2/gstlv2.h
@@ -28,40 +28,39 @@
 
 #include "gstlv2utils.h"
 
-LilvWorld *world;
-LilvNode *atom_class;
-LilvNode *audio_class;
-LilvNode *control_class;
-LilvNode *cv_class;
-LilvNode *event_class;
-LilvNode *input_class;
-LilvNode *output_class;
-LilvNode *preset_class;
-LilvNode *state_iface;
-LilvNode *state_uri;
-
-LilvNode *integer_prop;
-LilvNode *toggled_prop;
-LilvNode *designation_pred;
-LilvNode *in_place_broken_pred;
-LilvNode *optional_pred;
-LilvNode *group_pred;
-LilvNode *supports_event_pred;
-LilvNode *label_pred;
-
-LilvNode *center_role;
-LilvNode *left_role;
-LilvNode *right_role;
-LilvNode *rear_center_role;
-LilvNode *rear_left_role;
-LilvNode *rear_right_role;
-LilvNode *lfe_role;
-LilvNode *center_left_role;
-LilvNode *center_right_role;
-LilvNode *side_left_role;
-LilvNode *side_right_role;
+G_GNUC_INTERNAL extern LilvWorld *gst_lv2_world_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_audio_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_control_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_cv_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_event_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_input_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_output_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_preset_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_state_iface_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_state_uri_node;
+
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_integer_prop_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_toggled_prop_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_designation_pred_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_in_place_broken_pred_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_optional_pred_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_group_pred_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_supports_event_pred_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_label_pred_node;
+
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_left_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_right_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_center_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_left_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_right_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_lfe_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_left_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_right_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_side_left_role_node;
+G_GNUC_INTERNAL extern LilvNode *gst_lv2_side_right_role_node;
 
-GstStructure *lv2_meta_all;
+G_GNUC_INTERNAL extern GstStructure *lv2_meta_all;
 
 void gst_lv2_filter_register_element (GstPlugin *plugin,
                                       GstStructure * lv2_meta);
--- a/ext/lv2/gstlv2utils.c
+++ b/ext/lv2/gstlv2utils.c
@@ -173,7 +173,9 @@
   if (!lv2->presets) {
     LilvNodes *presets;
 
-    if ((presets = lilv_plugin_get_related (lv2->klass->plugin, preset_class))) {
+    if ((presets =
+            lilv_plugin_get_related (lv2->klass->plugin,
+                gst_lv2_preset_node))) {
       LilvIter *j;
 
       lv2->presets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
@@ -184,8 +186,10 @@
         const LilvNode *preset = lilv_nodes_get (presets, j);
         LilvNodes *titles;
 
-        lilv_world_load_resource (world, preset);
-        titles = lilv_world_find_nodes (world, preset, label_pred, NULL);
+        lilv_world_load_resource (gst_lv2_world_node, preset);
+        titles =
+            lilv_world_find_nodes (gst_lv2_world_node, preset,
+            gst_lv2_label_pred_node, NULL);
         if (titles) {
           const LilvNode *title = lilv_nodes_get_first (titles);
           g_hash_table_insert (lv2->presets,
@@ -249,7 +253,8 @@
 gst_lv2_load_preset (GstLV2 * lv2, GstObject * obj, const gchar * name)
 {
   LilvNode *preset = g_hash_table_lookup (lv2->presets, name);
-  LilvState *state = lilv_state_new_from_world (world, &lv2_map, preset);
+  LilvState *state =
+      lilv_state_new_from_world (gst_lv2_world_node, &lv2_map, preset);
   gpointer user_data[] = { lv2->klass, obj };
 
   GST_INFO_OBJECT (obj, "loading preset <%s>", lilv_node_as_string (preset));
@@ -291,7 +296,7 @@
   gpointer user_data[] = { lv2->klass, obj };
   LilvState *state;
   LilvNode *bundle_dir;
-  const LilvNode *state_uri;
+  const LilvNode *gst_lv2_state_uri_node;
   LilvInstance *instance = lv2->instance;
   gboolean res;
 #ifndef HAVE_LILV_0_22
@@ -319,27 +324,27 @@
 
   lilv_state_set_label (state, name);
 
-  res = lilv_state_save (world, &lv2_map, &lv2_unmap, state, /*uri */ NULL, dir,
-      filename) != 0;
+  res = lilv_state_save (gst_lv2_world_node, &lv2_map, &lv2_unmap, state,       /*uri */
+      NULL, dir, filename) != 0;
 
-  /* reload bundle into the world */
-  bundle_dir = lilv_new_file_uri (world, NULL, dir);
-  lilv_world_unload_bundle (world, bundle_dir);
-  lilv_world_load_bundle (world, bundle_dir);
+  /* reload bundle into the gst_lv2_world_node */
+  bundle_dir = lilv_new_file_uri (gst_lv2_world_node, NULL, dir);
+  lilv_world_unload_bundle (gst_lv2_world_node, bundle_dir);
+  lilv_world_load_bundle (gst_lv2_world_node, bundle_dir);
   lilv_node_free (bundle_dir);
 
 #ifdef HAVE_LILV_0_22
-  state_uri = lilv_state_get_uri (state);
+  gst_lv2_state_uri_node = lilv_state_get_uri (state);
 #else
   filepath = g_build_filename (dir, filename, NULL);
-  state_uri = lilv_new_uri (world, filepath);
+  gst_lv2_state_uri_node = lilv_new_uri (gst_lv2_world_node, filepath);
   g_free (filepath);
 #endif
-  lilv_world_load_resource (world, state_uri);
+  lilv_world_load_resource (gst_lv2_world_node, gst_lv2_state_uri_node);
   g_hash_table_insert (lv2->presets, g_strdup (name),
-      lilv_node_duplicate (state_uri));
+      lilv_node_duplicate (gst_lv2_state_uri_node));
 #ifndef HAVE_LILV_0_22
-  lilv_node_free ((LilvNode *) state_uri);
+  lilv_node_free ((LilvNode *) gst_lv2_state_uri_node);
 #endif
 
   lilv_state_free (state);
@@ -370,10 +375,11 @@
 {
 #ifdef HAVE_LILV_0_22
   LilvNode *preset = g_hash_table_lookup (lv2->presets, name);
-  LilvState *state = lilv_state_new_from_world (world, &lv2_map, preset);
+  LilvState *state =
+      lilv_state_new_from_world (gst_lv2_world_node, &lv2_map, preset);
 
-  lilv_world_unload_resource (world, lilv_state_get_uri (state));
-  lilv_state_delete (world, state);
+  lilv_world_unload_resource (gst_lv2_world_node, lilv_state_get_uri (state));
+  lilv_state_delete (gst_lv2_world_node, state);
   lilv_state_free (state);
 #endif
   g_hash_table_remove (lv2->presets, name);
@@ -620,13 +626,13 @@
       lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), name, nick);
 
   perms = G_PARAM_READABLE;
-  if (lilv_port_is_a (lv2plugin, port, input_class))
+  if (lilv_port_is_a (lv2plugin, port, gst_lv2_input_node))
     perms |= G_PARAM_WRITABLE | G_PARAM_CONSTRUCT;
-  if (lilv_port_is_a (lv2plugin, port, control_class) ||
-      lilv_port_is_a (lv2plugin, port, cv_class))
+  if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node) ||
+      lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node))
     perms |= GST_PARAM_CONTROLLABLE;
 
-  if (lilv_port_has_property (lv2plugin, port, toggled_prop)) {
+  if (lilv_port_has_property (lv2plugin, port, gst_lv2_toggled_prop_node)) {
     ret = g_param_spec_boolean (name, nick, nick, FALSE, perms);
     goto done;
   }
@@ -722,7 +728,8 @@
 
   if (enum_type != G_TYPE_INVALID) {
     ret = g_param_spec_enum (name, nick, nick, enum_type, def, perms);
-  } else if (lilv_port_has_property (lv2plugin, port, integer_prop))
+  } else if (lilv_port_has_property (lv2plugin, port,
+          gst_lv2_integer_prop_node))
     ret = g_param_spec_int (name, nick, nick, lower, upper, def, perms);
   else
     ret = g_param_spec_float (name, nick, nick, lower, upper, def, perms);
@@ -814,14 +821,14 @@
   GstStructure *lv2_meta = g_value_get_boxed (value);
   const LilvPlugin *lv2plugin;
   guint j, in_pad_index = 0, out_pad_index = 0;
-  const LilvPlugins *plugins = lilv_world_get_all_plugins (world);
+  const LilvPlugins *plugins = lilv_world_get_all_plugins (gst_lv2_world_node);
   LilvNode *plugin_uri;
   const gchar *element_uri;
 
   GST_DEBUG ("LV2 initializing class");
 
   element_uri = gst_structure_get_string (lv2_meta, "element-uri");
-  plugin_uri = lilv_new_uri (world, element_uri);
+  plugin_uri = lilv_new_uri (gst_lv2_world_node, element_uri);
   g_assert (plugin_uri);
   lv2plugin = lilv_plugins_get_by_uri (plugins, plugin_uri);
   g_assert (lv2plugin);
@@ -838,11 +845,13 @@
   /* find ports and groups */
   for (j = 0; j < lilv_plugin_get_num_ports (lv2plugin); j++) {
     const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, j);
-    const gboolean is_input = lilv_port_is_a (lv2plugin, port, input_class);
+    const gboolean is_input =
+        lilv_port_is_a (lv2plugin, port, gst_lv2_input_node);
     const gboolean is_optional = lilv_port_has_property (lv2plugin, port,
-        optional_pred);
+        gst_lv2_optional_pred_node);
     GstLV2Port desc = { j, GST_LV2_PORT_AUDIO, -1, };
-    LilvNodes *lv2group = lilv_port_get (lv2plugin, port, group_pred);
+    LilvNodes *lv2group =
+        lilv_port_get (lv2plugin, port, gst_lv2_group_pred_node);
     /* FIXME Handle channels positionning
      * GstAudioChannelPosition position = GST_AUDIO_CHANNEL_POSITION_INVALID; */
 
@@ -860,7 +869,7 @@
 
       /* FIXME Handle channels positionning
          position = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
-         sub_values = lilv_port_get_value (lv2plugin, port, designation_pred);
+         sub_values = lilv_port_get_value (lv2plugin, port, gst_lv2_designation_pred_node);
          if (lilv_nodes_size (sub_values) > 0) {
          LilvNode *role = lilv_nodes_get_at (sub_values, 0);
          position = gst_lv2_filter_role_to_position (role);
@@ -875,7 +884,7 @@
     } else {
       /* port is not part of a group, or it is part of a group but that group
        * is illegal so we just ignore it */
-      if (lilv_port_is_a (lv2plugin, port, audio_class)) {
+      if (lilv_port_is_a (lv2plugin, port, gst_lv2_audio_node)) {
         if (is_input) {
           desc.pad = in_pad_index++;
           g_array_append_val (lv2_class->in_group.ports, desc);
@@ -883,7 +892,7 @@
           desc.pad = out_pad_index++;
           g_array_append_val (lv2_class->out_group.ports, desc);
         }
-      } else if (lilv_port_is_a (lv2plugin, port, control_class)) {
+      } else if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node)) {
         desc.type = GST_LV2_PORT_CONTROL;
         if (is_input) {
           lv2_class->num_control_in++;
@@ -892,7 +901,7 @@
           lv2_class->num_control_out++;
           g_array_append_val (lv2_class->control_out_ports, desc);
         }
-      } else if (lilv_port_is_a (lv2plugin, port, cv_class)) {
+      } else if (lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node)) {
         desc.type = GST_LV2_PORT_CV;
         if (is_input) {
           lv2_class->num_cv_in++;
@@ -901,9 +910,9 @@
           lv2_class->num_cv_out++;
           g_array_append_val (lv2_class->control_out_ports, desc);
         }
-      } else if (lilv_port_is_a (lv2plugin, port, event_class)) {
+      } else if (lilv_port_is_a (lv2plugin, port, gst_lv2_event_node)) {
         LilvNodes *supported = lilv_port_get_value (lv2plugin, port,
-            supports_event_pred);
+            gst_lv2_supports_event_pred_node);
 
         GST_INFO ("%s: unhandled event port %d: %s, optional=%d, input=%d",
             element_uri, j,