Line
Link Here
|
0 |
-- a/ext/lv2/gstlv2.c |
0 |
++ b/ext/lv2/gstlv2.c |
Lines 69-74
Link Here
|
69 |
#error "Unsupported OS" |
69 |
#error "Unsupported OS" |
70 |
#endif |
70 |
#endif |
71 |
|
71 |
|
|
|
72 |
LilvWorld *gst_lv2_world_node = NULL; |
73 |
LilvNode *gst_lv2_audio_node = NULL; |
74 |
LilvNode *gst_lv2_control_node = NULL; |
75 |
LilvNode *gst_lv2_cv_node = NULL; |
76 |
LilvNode *gst_lv2_event_node = NULL; |
77 |
LilvNode *gst_lv2_input_node = NULL; |
78 |
LilvNode *gst_lv2_output_node = NULL; |
79 |
LilvNode *gst_lv2_preset_node = NULL; |
80 |
LilvNode *gst_lv2_state_iface_node = NULL; |
81 |
LilvNode *gst_lv2_state_uri_node = NULL; |
82 |
|
83 |
LilvNode *gst_lv2_integer_prop_node = NULL; |
84 |
LilvNode *gst_lv2_toggled_prop_node = NULL; |
85 |
LilvNode *gst_lv2_designation_pred_node = NULL; |
86 |
LilvNode *gst_lv2_in_place_broken_pred_node = NULL; |
87 |
LilvNode *gst_lv2_optional_pred_node = NULL; |
88 |
LilvNode *gst_lv2_group_pred_node = NULL; |
89 |
LilvNode *gst_lv2_supports_event_pred_node = NULL; |
90 |
LilvNode *gst_lv2_label_pred_node = NULL; |
91 |
|
92 |
LilvNode *gst_lv2_center_role_node = NULL; |
93 |
LilvNode *gst_lv2_left_role_node = NULL; |
94 |
LilvNode *gst_lv2_right_role_node = NULL; |
95 |
LilvNode *gst_lv2_rear_center_role_node = NULL; |
96 |
LilvNode *gst_lv2_rear_left_role_node = NULL; |
97 |
LilvNode *gst_lv2_rear_right_role_node = NULL; |
98 |
LilvNode *gst_lv2_lfe_role_node = NULL; |
99 |
LilvNode *gst_lv2_center_left_role_node = NULL; |
100 |
LilvNode *gst_lv2_center_right_role_node = NULL; |
101 |
LilvNode *gst_lv2_side_left_role_node = NULL; |
102 |
LilvNode *gst_lv2_side_right_role_node = NULL; |
103 |
|
72 |
GstStructure *lv2_meta_all = NULL; |
104 |
GstStructure *lv2_meta_all = NULL; |
73 |
|
105 |
|
74 |
static void |
106 |
static void |
Lines 98-106
Link Here
|
98 |
for (i = 0; i < lilv_plugin_get_num_ports (lv2plugin); i++) { |
130 |
for (i = 0; i < lilv_plugin_get_num_ports (lv2plugin); i++) { |
99 |
const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, i); |
131 |
const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, i); |
100 |
|
132 |
|
101 |
if (lilv_port_is_a (lv2plugin, port, audio_class)) { |
133 |
if (lilv_port_is_a (lv2plugin, port, gst_lv2_audio_node)) { |
102 |
const gboolean is_input = lilv_port_is_a (lv2plugin, port, input_class); |
134 |
const gboolean is_input = |
103 |
LilvNodes *lv2group = lilv_port_get (lv2plugin, port, group_pred); |
135 |
lilv_port_is_a (lv2plugin, port, gst_lv2_input_node); |
|
|
136 |
LilvNodes *lv2group = |
137 |
lilv_port_get (lv2plugin, port, gst_lv2_group_pred_node); |
104 |
|
138 |
|
105 |
if (lv2group) { |
139 |
if (lv2group) { |
106 |
const gchar *uri = lilv_node_as_uri (lv2group); |
140 |
const gchar *uri = lilv_node_as_uri (lv2group); |
Lines 116-123
Link Here
|
116 |
(*audio_in)++; |
150 |
(*audio_in)++; |
117 |
else |
151 |
else |
118 |
(*audio_out)++; |
152 |
(*audio_out)++; |
119 |
} else if (lilv_port_is_a (lv2plugin, port, control_class) || |
153 |
} else if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node) || |
120 |
lilv_port_is_a (lv2plugin, port, cv_class)) { |
154 |
lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node)) { |
121 |
(*control)++; |
155 |
(*control)++; |
122 |
} |
156 |
} |
123 |
} |
157 |
} |
Lines 130-136
Link Here
|
130 |
{ |
164 |
{ |
131 |
guint audio_in, audio_out, control; |
165 |
guint audio_in, audio_out, control; |
132 |
LilvIter *i; |
166 |
LilvIter *i; |
133 |
const LilvPlugins *plugins = lilv_world_get_all_plugins (world); |
167 |
const LilvPlugins *plugins = lilv_world_get_all_plugins (gst_lv2_world_node); |
134 |
|
168 |
|
135 |
for (i = lilv_plugins_begin (plugins); !lilv_plugins_is_end (plugins, i); |
169 |
for (i = lilv_plugins_begin (plugins); !lilv_plugins_is_end (plugins, i); |
136 |
i = lilv_plugins_next (plugins, i)) { |
170 |
i = lilv_plugins_next (plugins, i)) { |
Lines 187-194
Link Here
|
187 |
} |
221 |
} |
188 |
|
222 |
|
189 |
/* check supported extensions */ |
223 |
/* check supported extensions */ |
190 |
can_do_presets = lilv_plugin_has_extension_data (lv2plugin, state_iface) |
224 |
can_do_presets = |
191 |
|| lilv_plugin_has_feature (lv2plugin, state_uri) |
225 |
lilv_plugin_has_extension_data (lv2plugin, gst_lv2_state_iface_node) |
|
|
226 |
|| lilv_plugin_has_feature (lv2plugin, gst_lv2_state_uri_node) |
192 |
|| (control > 0); |
227 |
|| (control > 0); |
193 |
GST_INFO ("plugin %s can%s do presets", type_name, |
228 |
GST_INFO ("plugin %s can%s do presets", type_name, |
194 |
(can_do_presets ? "" : "'t")); |
229 |
(can_do_presets ? "" : "'t")); |
Lines 224-231
Link Here
|
224 |
GST_DEBUG_CATEGORY_INIT (lv2_debug, "lv2", |
259 |
GST_DEBUG_CATEGORY_INIT (lv2_debug, "lv2", |
225 |
GST_DEBUG_FG_GREEN | GST_DEBUG_BG_BLACK | GST_DEBUG_BOLD, "LV2"); |
260 |
GST_DEBUG_FG_GREEN | GST_DEBUG_BG_BLACK | GST_DEBUG_BOLD, "LV2"); |
226 |
|
261 |
|
227 |
world = lilv_world_new (); |
262 |
gst_lv2_world_node = lilv_world_new (); |
228 |
lilv_world_load_all (world); |
263 |
lilv_world_load_all (gst_lv2_world_node); |
229 |
gst_lv2_host_init (); |
264 |
gst_lv2_host_init (); |
230 |
|
265 |
|
231 |
/* have been added after lilv-0.22.0, which is the last release */ |
266 |
/* have been added after lilv-0.22.0, which is the last release */ |
Lines 236-272
Link Here
|
236 |
#define LILV_URI_CV_PORT "http://lv2plug.in/ns/lv2core#CVPort" |
271 |
#define LILV_URI_CV_PORT "http://lv2plug.in/ns/lv2core#CVPort" |
237 |
#endif |
272 |
#endif |
238 |
|
273 |
|
239 |
atom_class = lilv_new_uri (world, LILV_URI_ATOM_PORT); |
274 |
gst_lv2_audio_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_AUDIO_PORT); |
240 |
audio_class = lilv_new_uri (world, LILV_URI_AUDIO_PORT); |
275 |
gst_lv2_control_node = |
241 |
control_class = lilv_new_uri (world, LILV_URI_CONTROL_PORT); |
276 |
lilv_new_uri (gst_lv2_world_node, LILV_URI_CONTROL_PORT); |
242 |
cv_class = lilv_new_uri (world, LILV_URI_CV_PORT); |
277 |
gst_lv2_cv_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_CV_PORT); |
243 |
event_class = lilv_new_uri (world, LILV_URI_EVENT_PORT); |
278 |
gst_lv2_event_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_EVENT_PORT); |
244 |
input_class = lilv_new_uri (world, LILV_URI_INPUT_PORT); |
279 |
gst_lv2_input_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_INPUT_PORT); |
245 |
output_class = lilv_new_uri (world, LILV_URI_OUTPUT_PORT); |
280 |
gst_lv2_output_node = lilv_new_uri (gst_lv2_world_node, LILV_URI_OUTPUT_PORT); |
246 |
preset_class = lilv_new_uri (world, LV2_PRESETS__Preset); |
281 |
gst_lv2_preset_node = lilv_new_uri (gst_lv2_world_node, LV2_PRESETS__Preset); |
247 |
state_iface = lilv_new_uri (world, LV2_STATE__interface); |
282 |
gst_lv2_state_iface_node = |
248 |
state_uri = lilv_new_uri (world, LV2_STATE_URI); |
283 |
lilv_new_uri (gst_lv2_world_node, LV2_STATE__interface); |
249 |
|
284 |
gst_lv2_state_uri_node = lilv_new_uri (gst_lv2_world_node, LV2_STATE_URI); |
250 |
integer_prop = lilv_new_uri (world, LV2_CORE__integer); |
285 |
|
251 |
toggled_prop = lilv_new_uri (world, LV2_CORE__toggled); |
286 |
gst_lv2_integer_prop_node = |
252 |
designation_pred = lilv_new_uri (world, LV2_CORE__designation); |
287 |
lilv_new_uri (gst_lv2_world_node, LV2_CORE__integer); |
253 |
in_place_broken_pred = lilv_new_uri (world, LV2_CORE__inPlaceBroken); |
288 |
gst_lv2_toggled_prop_node = |
254 |
optional_pred = lilv_new_uri (world, LV2_CORE__optionalFeature); |
289 |
lilv_new_uri (gst_lv2_world_node, LV2_CORE__toggled); |
255 |
group_pred = lilv_new_uri (world, LV2_PORT_GROUPS__group); |
290 |
gst_lv2_designation_pred_node = |
256 |
supports_event_pred = lilv_new_uri (world, LV2_EVENT__supportsEvent); |
291 |
lilv_new_uri (gst_lv2_world_node, LV2_CORE__designation); |
257 |
label_pred = lilv_new_uri (world, LILV_NS_RDFS "label"); |
292 |
gst_lv2_in_place_broken_pred_node = |
258 |
|
293 |
lilv_new_uri (gst_lv2_world_node, LV2_CORE__inPlaceBroken); |
259 |
center_role = lilv_new_uri (world, LV2_PORT_GROUPS__center); |
294 |
gst_lv2_optional_pred_node = |
260 |
left_role = lilv_new_uri (world, LV2_PORT_GROUPS__left); |
295 |
lilv_new_uri (gst_lv2_world_node, LV2_CORE__optionalFeature); |
261 |
right_role = lilv_new_uri (world, LV2_PORT_GROUPS__right); |
296 |
gst_lv2_group_pred_node = |
262 |
rear_center_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearCenter); |
297 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__group); |
263 |
rear_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearLeft); |
298 |
gst_lv2_supports_event_pred_node = |
264 |
rear_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__rearLeft); |
299 |
lilv_new_uri (gst_lv2_world_node, LV2_EVENT__supportsEvent); |
265 |
lfe_role = lilv_new_uri (world, LV2_PORT_GROUPS__lowFrequencyEffects); |
300 |
gst_lv2_label_pred_node = |
266 |
center_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__centerLeft); |
301 |
lilv_new_uri (gst_lv2_world_node, LILV_NS_RDFS "label"); |
267 |
center_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__centerRight); |
302 |
|
268 |
side_left_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideLeft); |
303 |
gst_lv2_center_role_node = |
269 |
side_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideRight); |
304 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__center); |
|
|
305 |
gst_lv2_left_role_node = |
306 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__left); |
307 |
gst_lv2_right_role_node = |
308 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__right); |
309 |
gst_lv2_rear_center_role_node = |
310 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearCenter); |
311 |
gst_lv2_rear_left_role_node = |
312 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearLeft); |
313 |
gst_lv2_rear_right_role_node = |
314 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__rearRight); |
315 |
gst_lv2_lfe_role_node = |
316 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__lowFrequencyEffects); |
317 |
gst_lv2_center_left_role_node = |
318 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__centerLeft); |
319 |
gst_lv2_center_right_role_node = |
320 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__centerRight); |
321 |
gst_lv2_side_left_role_node = |
322 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__sideLeft); |
323 |
gst_lv2_side_right_role_node = |
324 |
lilv_new_uri (gst_lv2_world_node, LV2_PORT_GROUPS__sideRight); |
270 |
|
325 |
|
271 |
gst_plugin_add_dependency_simple (plugin, |
326 |
gst_plugin_add_dependency_simple (plugin, |
272 |
"LV2_PATH:" GST_LV2_ENVVARS, GST_LV2_DEFAULT_PATH, NULL, |
327 |
"LV2_PATH:" GST_LV2_ENVVARS, GST_LV2_DEFAULT_PATH, NULL, |
Lines 323-361
Link Here
|
323 |
#endif |
378 |
#endif |
324 |
static void plugin_cleanup (GstPlugin * plugin) |
379 |
static void plugin_cleanup (GstPlugin * plugin) |
325 |
{ |
380 |
{ |
326 |
lilv_node_free (atom_class); |
381 |
lilv_node_free (gst_lv2_audio_node); |
327 |
lilv_node_free (audio_class); |
382 |
lilv_node_free (gst_lv2_control_node); |
328 |
lilv_node_free (control_class); |
383 |
lilv_node_free (gst_lv2_cv_node); |
329 |
lilv_node_free (cv_class); |
384 |
lilv_node_free (gst_lv2_event_node); |
330 |
lilv_node_free (event_class); |
385 |
lilv_node_free (gst_lv2_input_node); |
331 |
lilv_node_free (input_class); |
386 |
lilv_node_free (gst_lv2_output_node); |
332 |
lilv_node_free (output_class); |
387 |
lilv_node_free (gst_lv2_preset_node); |
333 |
lilv_node_free (preset_class); |
388 |
lilv_node_free (gst_lv2_state_iface_node); |
334 |
lilv_node_free (state_iface); |
389 |
lilv_node_free (gst_lv2_state_uri_node); |
335 |
lilv_node_free (state_uri); |
390 |
|
336 |
|
391 |
lilv_node_free (gst_lv2_integer_prop_node); |
337 |
lilv_node_free (integer_prop); |
392 |
lilv_node_free (gst_lv2_toggled_prop_node); |
338 |
lilv_node_free (toggled_prop); |
393 |
lilv_node_free (gst_lv2_designation_pred_node); |
339 |
lilv_node_free (designation_pred); |
394 |
lilv_node_free (gst_lv2_in_place_broken_pred_node); |
340 |
lilv_node_free (in_place_broken_pred); |
395 |
lilv_node_free (gst_lv2_optional_pred_node); |
341 |
lilv_node_free (optional_pred); |
396 |
lilv_node_free (gst_lv2_group_pred_node); |
342 |
lilv_node_free (group_pred); |
397 |
lilv_node_free (gst_lv2_supports_event_pred_node); |
343 |
lilv_node_free (supports_event_pred); |
398 |
lilv_node_free (gst_lv2_label_pred_node); |
344 |
lilv_node_free (label_pred); |
399 |
|
345 |
|
400 |
lilv_node_free (gst_lv2_center_role_node); |
346 |
lilv_node_free (center_role); |
401 |
lilv_node_free (gst_lv2_left_role_node); |
347 |
lilv_node_free (left_role); |
402 |
lilv_node_free (gst_lv2_right_role_node); |
348 |
lilv_node_free (right_role); |
403 |
lilv_node_free (gst_lv2_rear_center_role_node); |
349 |
lilv_node_free (rear_center_role); |
404 |
lilv_node_free (gst_lv2_rear_left_role_node); |
350 |
lilv_node_free (rear_left_role); |
405 |
lilv_node_free (gst_lv2_rear_right_role_node); |
351 |
lilv_node_free (rear_right_role); |
406 |
lilv_node_free (gst_lv2_lfe_role_node); |
352 |
lilv_node_free (lfe_role); |
407 |
lilv_node_free (gst_lv2_center_left_role_node); |
353 |
lilv_node_free (center_left_role); |
408 |
lilv_node_free (gst_lv2_center_right_role_node); |
354 |
lilv_node_free (center_right_role); |
409 |
lilv_node_free (gst_lv2_side_left_role_node); |
355 |
lilv_node_free (side_left_role); |
410 |
lilv_node_free (gst_lv2_side_right_role_node); |
356 |
lilv_node_free (side_right_role); |
|
|
357 |
|
411 |
|
358 |
lilv_world_free (world); |
412 |
lilv_world_free (gst_lv2_world_node); |
359 |
} |
413 |
} |
360 |
|
414 |
|
361 |
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, |
415 |
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, |
362 |
-- a/ext/lv2/gstlv2filter.c |
416 |
++ b/ext/lv2/gstlv2filter.c |
Lines 183-219
Link Here
|
183 |
gst_lv2_filter_role_to_position (LilvNode * role) |
183 |
gst_lv2_filter_role_to_position (LilvNode * role) |
184 |
{ |
184 |
{ |
185 |
/* Front. Mono and left/right are mututally exclusive */ |
185 |
/* Front. Mono and left/right are mututally exclusive */ |
186 |
if (lilv_node_equals (role, center_role)) { |
186 |
if (lilv_node_equals (role, gst_lv2_center_role_node)) { |
187 |
|
187 |
|
188 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; |
188 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; |
189 |
} else if (lilv_node_equals (role, left_role)) { |
189 |
} else if (lilv_node_equals (role, gst_lv2_left_role_node)) { |
190 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; |
190 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; |
191 |
} else if (lilv_node_equals (role, right_role)) { |
191 |
} else if (lilv_node_equals (role, gst_lv2_right_role_node)) { |
192 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; |
192 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; |
193 |
|
193 |
|
194 |
/* Rear. Left/right and center are mututally exclusive */ |
194 |
/* Rear. Left/right and center are mututally exclusive */ |
195 |
} else if (lilv_node_equals (role, rear_center_role)) { |
195 |
} else if (lilv_node_equals (role, gst_lv2_rear_center_role_node)) { |
196 |
return GST_AUDIO_CHANNEL_POSITION_REAR_CENTER; |
196 |
return GST_AUDIO_CHANNEL_POSITION_REAR_CENTER; |
197 |
} else if (lilv_node_equals (role, rear_left_role)) { |
197 |
} else if (lilv_node_equals (role, gst_lv2_rear_left_role_node)) { |
198 |
return GST_AUDIO_CHANNEL_POSITION_REAR_LEFT; |
198 |
return GST_AUDIO_CHANNEL_POSITION_REAR_LEFT; |
199 |
} else if (lilv_node_equals (role, rear_right_role)) { |
199 |
} else if (lilv_node_equals (role, gst_lv2_rear_right_role_node)) { |
200 |
return GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT; |
200 |
return GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT; |
201 |
|
201 |
|
202 |
/* Subwoofer/low-frequency-effects */ |
202 |
/* Subwoofer/low-frequency-effects */ |
203 |
} else if (lilv_node_equals (role, lfe_role)) { |
203 |
} else if (lilv_node_equals (role, gst_lv2_lfe_role_node)) { |
204 |
return GST_AUDIO_CHANNEL_POSITION_LFE1; |
204 |
return GST_AUDIO_CHANNEL_POSITION_LFE1; |
205 |
|
205 |
|
206 |
/* Center front speakers. Center and left/right_of_center |
206 |
/* Center front speakers. Center and left/right_of_center |
207 |
* are mutually exclusive */ |
207 |
* are mutually exclusive */ |
208 |
} else if (lilv_node_equals (role, center_left_role)) { |
208 |
} else if (lilv_node_equals (role, gst_lv2_center_left_role_node)) { |
209 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER; |
209 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER; |
210 |
} else if (lilv_node_equals (role, center_right_role)) { |
210 |
} else if (lilv_node_equals (role, gst_lv2_center_right_role_node)) { |
211 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER; |
211 |
return GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER; |
212 |
|
212 |
|
213 |
/* sides */ |
213 |
/* sides */ |
214 |
} else if (lilv_node_equals (role, side_left_role)) { |
214 |
} else if (lilv_node_equals (role, gst_lv2_side_left_role_node)) { |
215 |
return GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT; |
215 |
return GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT; |
216 |
} else if (lilv_node_equals (role, side_right_role)) { |
216 |
} else if (lilv_node_equals (role, gst_lv2_side_right_role_node)) { |
217 |
return GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT; |
217 |
return GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT; |
218 |
} |
218 |
} |
219 |
|
219 |
|
Lines 531-537
Link Here
|
531 |
{ |
531 |
{ |
532 |
gst_lv2_init (&self->lv2, &klass->lv2); |
532 |
gst_lv2_init (&self->lv2, &klass->lv2); |
533 |
|
533 |
|
534 |
if (!lilv_plugin_has_feature (klass->lv2.plugin, in_place_broken_pred)) |
534 |
if (!lilv_plugin_has_feature (klass->lv2.plugin, |
|
|
535 |
gst_lv2_in_place_broken_pred_node)) |
535 |
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (self), TRUE); |
536 |
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (self), TRUE); |
536 |
} |
537 |
} |
537 |
|
538 |
|
538 |
-- a/ext/lv2/gstlv2.h |
539 |
++ b/ext/lv2/gstlv2.h |
Lines 28-67
Link Here
|
28 |
|
28 |
|
29 |
#include "gstlv2utils.h" |
29 |
#include "gstlv2utils.h" |
30 |
|
30 |
|
31 |
LilvWorld *world; |
31 |
G_GNUC_INTERNAL extern LilvWorld *gst_lv2_world_node; |
32 |
LilvNode *atom_class; |
32 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_audio_node; |
33 |
LilvNode *audio_class; |
33 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_control_node; |
34 |
LilvNode *control_class; |
34 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_cv_node; |
35 |
LilvNode *cv_class; |
35 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_event_node; |
36 |
LilvNode *event_class; |
36 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_input_node; |
37 |
LilvNode *input_class; |
37 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_output_node; |
38 |
LilvNode *output_class; |
38 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_preset_node; |
39 |
LilvNode *preset_class; |
39 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_state_iface_node; |
40 |
LilvNode *state_iface; |
40 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_state_uri_node; |
41 |
LilvNode *state_uri; |
41 |
|
42 |
|
42 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_integer_prop_node; |
43 |
LilvNode *integer_prop; |
43 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_toggled_prop_node; |
44 |
LilvNode *toggled_prop; |
44 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_designation_pred_node; |
45 |
LilvNode *designation_pred; |
45 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_in_place_broken_pred_node; |
46 |
LilvNode *in_place_broken_pred; |
46 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_optional_pred_node; |
47 |
LilvNode *optional_pred; |
47 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_group_pred_node; |
48 |
LilvNode *group_pred; |
48 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_supports_event_pred_node; |
49 |
LilvNode *supports_event_pred; |
49 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_label_pred_node; |
50 |
LilvNode *label_pred; |
50 |
|
51 |
|
51 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_role_node; |
52 |
LilvNode *center_role; |
52 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_left_role_node; |
53 |
LilvNode *left_role; |
53 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_right_role_node; |
54 |
LilvNode *right_role; |
54 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_center_role_node; |
55 |
LilvNode *rear_center_role; |
55 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_left_role_node; |
56 |
LilvNode *rear_left_role; |
56 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_rear_right_role_node; |
57 |
LilvNode *rear_right_role; |
57 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_lfe_role_node; |
58 |
LilvNode *lfe_role; |
58 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_left_role_node; |
59 |
LilvNode *center_left_role; |
59 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_center_right_role_node; |
60 |
LilvNode *center_right_role; |
60 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_side_left_role_node; |
61 |
LilvNode *side_left_role; |
61 |
G_GNUC_INTERNAL extern LilvNode *gst_lv2_side_right_role_node; |
62 |
LilvNode *side_right_role; |
|
|
63 |
|
62 |
|
64 |
GstStructure *lv2_meta_all; |
63 |
G_GNUC_INTERNAL extern GstStructure *lv2_meta_all; |
65 |
|
64 |
|
66 |
void gst_lv2_filter_register_element (GstPlugin *plugin, |
65 |
void gst_lv2_filter_register_element (GstPlugin *plugin, |
67 |
GstStructure * lv2_meta); |
66 |
GstStructure * lv2_meta); |
68 |
-- a/ext/lv2/gstlv2utils.c |
67 |
++ b/ext/lv2/gstlv2utils.c |
Lines 173-179
Link Here
|
173 |
if (!lv2->presets) { |
173 |
if (!lv2->presets) { |
174 |
LilvNodes *presets; |
174 |
LilvNodes *presets; |
175 |
|
175 |
|
176 |
if ((presets = lilv_plugin_get_related (lv2->klass->plugin, preset_class))) { |
176 |
if ((presets = |
|
|
177 |
lilv_plugin_get_related (lv2->klass->plugin, |
178 |
gst_lv2_preset_node))) { |
177 |
LilvIter *j; |
179 |
LilvIter *j; |
178 |
|
180 |
|
179 |
lv2->presets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, |
181 |
lv2->presets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, |
Lines 184-191
Link Here
|
184 |
const LilvNode *preset = lilv_nodes_get (presets, j); |
186 |
const LilvNode *preset = lilv_nodes_get (presets, j); |
185 |
LilvNodes *titles; |
187 |
LilvNodes *titles; |
186 |
|
188 |
|
187 |
lilv_world_load_resource (world, preset); |
189 |
lilv_world_load_resource (gst_lv2_world_node, preset); |
188 |
titles = lilv_world_find_nodes (world, preset, label_pred, NULL); |
190 |
titles = |
|
|
191 |
lilv_world_find_nodes (gst_lv2_world_node, preset, |
192 |
gst_lv2_label_pred_node, NULL); |
189 |
if (titles) { |
193 |
if (titles) { |
190 |
const LilvNode *title = lilv_nodes_get_first (titles); |
194 |
const LilvNode *title = lilv_nodes_get_first (titles); |
191 |
g_hash_table_insert (lv2->presets, |
195 |
g_hash_table_insert (lv2->presets, |
Lines 249-255
Link Here
|
249 |
gst_lv2_load_preset (GstLV2 * lv2, GstObject * obj, const gchar * name) |
253 |
gst_lv2_load_preset (GstLV2 * lv2, GstObject * obj, const gchar * name) |
250 |
{ |
254 |
{ |
251 |
LilvNode *preset = g_hash_table_lookup (lv2->presets, name); |
255 |
LilvNode *preset = g_hash_table_lookup (lv2->presets, name); |
252 |
LilvState *state = lilv_state_new_from_world (world, &lv2_map, preset); |
256 |
LilvState *state = |
|
|
257 |
lilv_state_new_from_world (gst_lv2_world_node, &lv2_map, preset); |
253 |
gpointer user_data[] = { lv2->klass, obj }; |
258 |
gpointer user_data[] = { lv2->klass, obj }; |
254 |
|
259 |
|
255 |
GST_INFO_OBJECT (obj, "loading preset <%s>", lilv_node_as_string (preset)); |
260 |
GST_INFO_OBJECT (obj, "loading preset <%s>", lilv_node_as_string (preset)); |
Lines 291-297
Link Here
|
291 |
gpointer user_data[] = { lv2->klass, obj }; |
296 |
gpointer user_data[] = { lv2->klass, obj }; |
292 |
LilvState *state; |
297 |
LilvState *state; |
293 |
LilvNode *bundle_dir; |
298 |
LilvNode *bundle_dir; |
294 |
const LilvNode *state_uri; |
299 |
const LilvNode *gst_lv2_state_uri_node; |
295 |
LilvInstance *instance = lv2->instance; |
300 |
LilvInstance *instance = lv2->instance; |
296 |
gboolean res; |
301 |
gboolean res; |
297 |
#ifndef HAVE_LILV_0_22 |
302 |
#ifndef HAVE_LILV_0_22 |
Lines 319-345
Link Here
|
319 |
|
324 |
|
320 |
lilv_state_set_label (state, name); |
325 |
lilv_state_set_label (state, name); |
321 |
|
326 |
|
322 |
res = lilv_state_save (world, &lv2_map, &lv2_unmap, state, /*uri */ NULL, dir, |
327 |
res = lilv_state_save (gst_lv2_world_node, &lv2_map, &lv2_unmap, state, /*uri */ |
323 |
filename) != 0; |
328 |
NULL, dir, filename) != 0; |
324 |
|
329 |
|
325 |
/* reload bundle into the world */ |
330 |
/* reload bundle into the gst_lv2_world_node */ |
326 |
bundle_dir = lilv_new_file_uri (world, NULL, dir); |
331 |
bundle_dir = lilv_new_file_uri (gst_lv2_world_node, NULL, dir); |
327 |
lilv_world_unload_bundle (world, bundle_dir); |
332 |
lilv_world_unload_bundle (gst_lv2_world_node, bundle_dir); |
328 |
lilv_world_load_bundle (world, bundle_dir); |
333 |
lilv_world_load_bundle (gst_lv2_world_node, bundle_dir); |
329 |
lilv_node_free (bundle_dir); |
334 |
lilv_node_free (bundle_dir); |
330 |
|
335 |
|
331 |
#ifdef HAVE_LILV_0_22 |
336 |
#ifdef HAVE_LILV_0_22 |
332 |
state_uri = lilv_state_get_uri (state); |
337 |
gst_lv2_state_uri_node = lilv_state_get_uri (state); |
333 |
#else |
338 |
#else |
334 |
filepath = g_build_filename (dir, filename, NULL); |
339 |
filepath = g_build_filename (dir, filename, NULL); |
335 |
state_uri = lilv_new_uri (world, filepath); |
340 |
gst_lv2_state_uri_node = lilv_new_uri (gst_lv2_world_node, filepath); |
336 |
g_free (filepath); |
341 |
g_free (filepath); |
337 |
#endif |
342 |
#endif |
338 |
lilv_world_load_resource (world, state_uri); |
343 |
lilv_world_load_resource (gst_lv2_world_node, gst_lv2_state_uri_node); |
339 |
g_hash_table_insert (lv2->presets, g_strdup (name), |
344 |
g_hash_table_insert (lv2->presets, g_strdup (name), |
340 |
lilv_node_duplicate (state_uri)); |
345 |
lilv_node_duplicate (gst_lv2_state_uri_node)); |
341 |
#ifndef HAVE_LILV_0_22 |
346 |
#ifndef HAVE_LILV_0_22 |
342 |
lilv_node_free ((LilvNode *) state_uri); |
347 |
lilv_node_free ((LilvNode *) gst_lv2_state_uri_node); |
343 |
#endif |
348 |
#endif |
344 |
|
349 |
|
345 |
lilv_state_free (state); |
350 |
lilv_state_free (state); |
Lines 370-379
Link Here
|
370 |
{ |
375 |
{ |
371 |
#ifdef HAVE_LILV_0_22 |
376 |
#ifdef HAVE_LILV_0_22 |
372 |
LilvNode *preset = g_hash_table_lookup (lv2->presets, name); |
377 |
LilvNode *preset = g_hash_table_lookup (lv2->presets, name); |
373 |
LilvState *state = lilv_state_new_from_world (world, &lv2_map, preset); |
378 |
LilvState *state = |
|
|
379 |
lilv_state_new_from_world (gst_lv2_world_node, &lv2_map, preset); |
374 |
|
380 |
|
375 |
lilv_world_unload_resource (world, lilv_state_get_uri (state)); |
381 |
lilv_world_unload_resource (gst_lv2_world_node, lilv_state_get_uri (state)); |
376 |
lilv_state_delete (world, state); |
382 |
lilv_state_delete (gst_lv2_world_node, state); |
377 |
lilv_state_free (state); |
383 |
lilv_state_free (state); |
378 |
#endif |
384 |
#endif |
379 |
g_hash_table_remove (lv2->presets, name); |
385 |
g_hash_table_remove (lv2->presets, name); |
Lines 620-632
Link Here
|
620 |
lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), name, nick); |
626 |
lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), name, nick); |
621 |
|
627 |
|
622 |
perms = G_PARAM_READABLE; |
628 |
perms = G_PARAM_READABLE; |
623 |
if (lilv_port_is_a (lv2plugin, port, input_class)) |
629 |
if (lilv_port_is_a (lv2plugin, port, gst_lv2_input_node)) |
624 |
perms |= G_PARAM_WRITABLE | G_PARAM_CONSTRUCT; |
630 |
perms |= G_PARAM_WRITABLE | G_PARAM_CONSTRUCT; |
625 |
if (lilv_port_is_a (lv2plugin, port, control_class) || |
631 |
if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node) || |
626 |
lilv_port_is_a (lv2plugin, port, cv_class)) |
632 |
lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node)) |
627 |
perms |= GST_PARAM_CONTROLLABLE; |
633 |
perms |= GST_PARAM_CONTROLLABLE; |
628 |
|
634 |
|
629 |
if (lilv_port_has_property (lv2plugin, port, toggled_prop)) { |
635 |
if (lilv_port_has_property (lv2plugin, port, gst_lv2_toggled_prop_node)) { |
630 |
ret = g_param_spec_boolean (name, nick, nick, FALSE, perms); |
636 |
ret = g_param_spec_boolean (name, nick, nick, FALSE, perms); |
631 |
goto done; |
637 |
goto done; |
632 |
} |
638 |
} |
Lines 722-728
Link Here
|
722 |
|
728 |
|
723 |
if (enum_type != G_TYPE_INVALID) { |
729 |
if (enum_type != G_TYPE_INVALID) { |
724 |
ret = g_param_spec_enum (name, nick, nick, enum_type, def, perms); |
730 |
ret = g_param_spec_enum (name, nick, nick, enum_type, def, perms); |
725 |
} else if (lilv_port_has_property (lv2plugin, port, integer_prop)) |
731 |
} else if (lilv_port_has_property (lv2plugin, port, |
|
|
732 |
gst_lv2_integer_prop_node)) |
726 |
ret = g_param_spec_int (name, nick, nick, lower, upper, def, perms); |
733 |
ret = g_param_spec_int (name, nick, nick, lower, upper, def, perms); |
727 |
else |
734 |
else |
728 |
ret = g_param_spec_float (name, nick, nick, lower, upper, def, perms); |
735 |
ret = g_param_spec_float (name, nick, nick, lower, upper, def, perms); |
Lines 814-827
Link Here
|
814 |
GstStructure *lv2_meta = g_value_get_boxed (value); |
821 |
GstStructure *lv2_meta = g_value_get_boxed (value); |
815 |
const LilvPlugin *lv2plugin; |
822 |
const LilvPlugin *lv2plugin; |
816 |
guint j, in_pad_index = 0, out_pad_index = 0; |
823 |
guint j, in_pad_index = 0, out_pad_index = 0; |
817 |
const LilvPlugins *plugins = lilv_world_get_all_plugins (world); |
824 |
const LilvPlugins *plugins = lilv_world_get_all_plugins (gst_lv2_world_node); |
818 |
LilvNode *plugin_uri; |
825 |
LilvNode *plugin_uri; |
819 |
const gchar *element_uri; |
826 |
const gchar *element_uri; |
820 |
|
827 |
|
821 |
GST_DEBUG ("LV2 initializing class"); |
828 |
GST_DEBUG ("LV2 initializing class"); |
822 |
|
829 |
|
823 |
element_uri = gst_structure_get_string (lv2_meta, "element-uri"); |
830 |
element_uri = gst_structure_get_string (lv2_meta, "element-uri"); |
824 |
plugin_uri = lilv_new_uri (world, element_uri); |
831 |
plugin_uri = lilv_new_uri (gst_lv2_world_node, element_uri); |
825 |
g_assert (plugin_uri); |
832 |
g_assert (plugin_uri); |
826 |
lv2plugin = lilv_plugins_get_by_uri (plugins, plugin_uri); |
833 |
lv2plugin = lilv_plugins_get_by_uri (plugins, plugin_uri); |
827 |
g_assert (lv2plugin); |
834 |
g_assert (lv2plugin); |
Lines 838-848
Link Here
|
838 |
/* find ports and groups */ |
845 |
/* find ports and groups */ |
839 |
for (j = 0; j < lilv_plugin_get_num_ports (lv2plugin); j++) { |
846 |
for (j = 0; j < lilv_plugin_get_num_ports (lv2plugin); j++) { |
840 |
const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, j); |
847 |
const LilvPort *port = lilv_plugin_get_port_by_index (lv2plugin, j); |
841 |
const gboolean is_input = lilv_port_is_a (lv2plugin, port, input_class); |
848 |
const gboolean is_input = |
|
|
849 |
lilv_port_is_a (lv2plugin, port, gst_lv2_input_node); |
842 |
const gboolean is_optional = lilv_port_has_property (lv2plugin, port, |
850 |
const gboolean is_optional = lilv_port_has_property (lv2plugin, port, |
843 |
optional_pred); |
851 |
gst_lv2_optional_pred_node); |
844 |
GstLV2Port desc = { j, GST_LV2_PORT_AUDIO, -1, }; |
852 |
GstLV2Port desc = { j, GST_LV2_PORT_AUDIO, -1, }; |
845 |
LilvNodes *lv2group = lilv_port_get (lv2plugin, port, group_pred); |
853 |
LilvNodes *lv2group = |
|
|
854 |
lilv_port_get (lv2plugin, port, gst_lv2_group_pred_node); |
846 |
/* FIXME Handle channels positionning |
855 |
/* FIXME Handle channels positionning |
847 |
* GstAudioChannelPosition position = GST_AUDIO_CHANNEL_POSITION_INVALID; */ |
856 |
* GstAudioChannelPosition position = GST_AUDIO_CHANNEL_POSITION_INVALID; */ |
848 |
|
857 |
|
Lines 860-866
Link Here
|
860 |
|
869 |
|
861 |
/* FIXME Handle channels positionning |
870 |
/* FIXME Handle channels positionning |
862 |
position = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; |
871 |
position = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT; |
863 |
sub_values = lilv_port_get_value (lv2plugin, port, designation_pred); |
872 |
sub_values = lilv_port_get_value (lv2plugin, port, gst_lv2_designation_pred_node); |
864 |
if (lilv_nodes_size (sub_values) > 0) { |
873 |
if (lilv_nodes_size (sub_values) > 0) { |
865 |
LilvNode *role = lilv_nodes_get_at (sub_values, 0); |
874 |
LilvNode *role = lilv_nodes_get_at (sub_values, 0); |
866 |
position = gst_lv2_filter_role_to_position (role); |
875 |
position = gst_lv2_filter_role_to_position (role); |
Lines 875-881
Link Here
|
875 |
} else { |
884 |
} else { |
876 |
/* port is not part of a group, or it is part of a group but that group |
885 |
/* port is not part of a group, or it is part of a group but that group |
877 |
* is illegal so we just ignore it */ |
886 |
* is illegal so we just ignore it */ |
878 |
if (lilv_port_is_a (lv2plugin, port, audio_class)) { |
887 |
if (lilv_port_is_a (lv2plugin, port, gst_lv2_audio_node)) { |
879 |
if (is_input) { |
888 |
if (is_input) { |
880 |
desc.pad = in_pad_index++; |
889 |
desc.pad = in_pad_index++; |
881 |
g_array_append_val (lv2_class->in_group.ports, desc); |
890 |
g_array_append_val (lv2_class->in_group.ports, desc); |
Lines 883-889
Link Here
|
883 |
desc.pad = out_pad_index++; |
892 |
desc.pad = out_pad_index++; |
884 |
g_array_append_val (lv2_class->out_group.ports, desc); |
893 |
g_array_append_val (lv2_class->out_group.ports, desc); |
885 |
} |
894 |
} |
886 |
} else if (lilv_port_is_a (lv2plugin, port, control_class)) { |
895 |
} else if (lilv_port_is_a (lv2plugin, port, gst_lv2_control_node)) { |
887 |
desc.type = GST_LV2_PORT_CONTROL; |
896 |
desc.type = GST_LV2_PORT_CONTROL; |
888 |
if (is_input) { |
897 |
if (is_input) { |
889 |
lv2_class->num_control_in++; |
898 |
lv2_class->num_control_in++; |
Lines 892-898
Link Here
|
892 |
lv2_class->num_control_out++; |
901 |
lv2_class->num_control_out++; |
893 |
g_array_append_val (lv2_class->control_out_ports, desc); |
902 |
g_array_append_val (lv2_class->control_out_ports, desc); |
894 |
} |
903 |
} |
895 |
} else if (lilv_port_is_a (lv2plugin, port, cv_class)) { |
904 |
} else if (lilv_port_is_a (lv2plugin, port, gst_lv2_cv_node)) { |
896 |
desc.type = GST_LV2_PORT_CV; |
905 |
desc.type = GST_LV2_PORT_CV; |
897 |
if (is_input) { |
906 |
if (is_input) { |
898 |
lv2_class->num_cv_in++; |
907 |
lv2_class->num_cv_in++; |
Lines 901-909
Link Here
|
901 |
lv2_class->num_cv_out++; |
910 |
lv2_class->num_cv_out++; |
902 |
g_array_append_val (lv2_class->control_out_ports, desc); |
911 |
g_array_append_val (lv2_class->control_out_ports, desc); |
903 |
} |
912 |
} |
904 |
} else if (lilv_port_is_a (lv2plugin, port, event_class)) { |
913 |
} else if (lilv_port_is_a (lv2plugin, port, gst_lv2_event_node)) { |
905 |
LilvNodes *supported = lilv_port_get_value (lv2plugin, port, |
914 |
LilvNodes *supported = lilv_port_get_value (lv2plugin, port, |
906 |
supports_event_pred); |
915 |
gst_lv2_supports_event_pred_node); |
907 |
|
916 |
|
908 |
GST_INFO ("%s: unhandled event port %d: %s, optional=%d, input=%d", |
917 |
GST_INFO ("%s: unhandled event port %d: %s, optional=%d, input=%d", |
909 |
element_uri, j, |
918 |
element_uri, j, |