mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-09 16:02:59 +00:00
lv2: code cleanups
More logging and comments. Rename some vars for consistency. Fully init port struct.
This commit is contained in:
parent
ebdf1c2a18
commit
88009080e8
1 changed files with 12 additions and 7 deletions
|
@ -214,7 +214,7 @@ gst_lv2_base_init (gpointer g_class)
|
||||||
const SLV2Port port = slv2_plugin_get_port_by_index (lv2plugin, j);
|
const SLV2Port port = slv2_plugin_get_port_by_index (lv2plugin, j);
|
||||||
const gboolean is_input = slv2_port_is_a (lv2plugin, port, input_class);
|
const gboolean is_input = slv2_port_is_a (lv2plugin, port, input_class);
|
||||||
gboolean in_group = FALSE;
|
gboolean in_group = FALSE;
|
||||||
struct _GstLV2Port desc = { j, 0 };
|
struct _GstLV2Port desc = { j, 0, };
|
||||||
values = slv2_port_get_value (lv2plugin, port, in_group_pred);
|
values = slv2_port_get_value (lv2plugin, port, in_group_pred);
|
||||||
|
|
||||||
if (slv2_values_size (values) > 0) {
|
if (slv2_values_size (values) > 0) {
|
||||||
|
@ -287,6 +287,7 @@ gst_lv2_base_init (gpointer g_class)
|
||||||
g_array_append_val (klass->control_out_ports, desc);
|
g_array_append_val (klass->control_out_ports, desc);
|
||||||
} else {
|
} else {
|
||||||
/* unknown port type */
|
/* unknown port type */
|
||||||
|
GST_INFO ("unhandled port %d", j);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -727,7 +728,7 @@ gst_lv2_process (GstSignalProcessor * gsp, guint nframes)
|
||||||
{
|
{
|
||||||
GstSignalProcessorClass *gsp_class;
|
GstSignalProcessorClass *gsp_class;
|
||||||
GstLV2 *lv2;
|
GstLV2 *lv2;
|
||||||
GstLV2Class *oclass;
|
GstLV2Class *lv2_class;
|
||||||
GstLV2Group *lv2_group;
|
GstLV2Group *lv2_group;
|
||||||
GstLV2Port *lv2_port;
|
GstLV2Port *lv2_port;
|
||||||
GstSignalProcessorGroup *gst_group;
|
GstSignalProcessorGroup *gst_group;
|
||||||
|
@ -735,10 +736,11 @@ gst_lv2_process (GstSignalProcessor * gsp, guint nframes)
|
||||||
|
|
||||||
gsp_class = GST_SIGNAL_PROCESSOR_GET_CLASS (gsp);
|
gsp_class = GST_SIGNAL_PROCESSOR_GET_CLASS (gsp);
|
||||||
lv2 = (GstLV2 *) gsp;
|
lv2 = (GstLV2 *) gsp;
|
||||||
oclass = (GstLV2Class *) gsp_class;
|
lv2_class = (GstLV2Class *) gsp_class;
|
||||||
|
|
||||||
|
/* multi channel inputs */
|
||||||
for (i = 0; i < gsp_class->num_group_in; i++) {
|
for (i = 0; i < gsp_class->num_group_in; i++) {
|
||||||
lv2_group = &g_array_index (oclass->in_groups, GstLV2Group, i);
|
lv2_group = &g_array_index (lv2_class->in_groups, GstLV2Group, i);
|
||||||
gst_group = &gsp->group_in[i];
|
gst_group = &gsp->group_in[i];
|
||||||
for (j = 0; j < lv2_group->ports->len; ++j) {
|
for (j = 0; j < lv2_group->ports->len; ++j) {
|
||||||
lv2_port = &g_array_index (lv2_group->ports, GstLV2Port, j);
|
lv2_port = &g_array_index (lv2_group->ports, GstLV2Port, j);
|
||||||
|
@ -746,13 +748,15 @@ gst_lv2_process (GstSignalProcessor * gsp, guint nframes)
|
||||||
gst_group->buffer + (j * nframes));
|
gst_group->buffer + (j * nframes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* mono inputs */
|
||||||
for (i = 0; i < gsp_class->num_audio_in; i++) {
|
for (i = 0; i < gsp_class->num_audio_in; i++) {
|
||||||
lv2_port = &g_array_index (oclass->audio_in_ports, GstLV2Port, i);
|
lv2_port = &g_array_index (lv2_class->audio_in_ports, GstLV2Port, i);
|
||||||
slv2_instance_connect_port (lv2->instance, lv2_port->index,
|
slv2_instance_connect_port (lv2->instance, lv2_port->index,
|
||||||
gsp->audio_in[i]);
|
gsp->audio_in[i]);
|
||||||
}
|
}
|
||||||
|
/* multi channel outputs */
|
||||||
for (i = 0; i < gsp_class->num_group_out; i++) {
|
for (i = 0; i < gsp_class->num_group_out; i++) {
|
||||||
lv2_group = &g_array_index (oclass->out_groups, GstLV2Group, i);
|
lv2_group = &g_array_index (lv2_class->out_groups, GstLV2Group, i);
|
||||||
gst_group = &gsp->group_out[i];
|
gst_group = &gsp->group_out[i];
|
||||||
for (j = 0; j < lv2_group->ports->len; ++j) {
|
for (j = 0; j < lv2_group->ports->len; ++j) {
|
||||||
lv2_port = &g_array_index (lv2_group->ports, GstLV2Port, j);
|
lv2_port = &g_array_index (lv2_group->ports, GstLV2Port, j);
|
||||||
|
@ -760,8 +764,9 @@ gst_lv2_process (GstSignalProcessor * gsp, guint nframes)
|
||||||
gst_group->buffer + (j * nframes));
|
gst_group->buffer + (j * nframes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* mono outputs */
|
||||||
for (i = 0; i < gsp_class->num_audio_out; i++) {
|
for (i = 0; i < gsp_class->num_audio_out; i++) {
|
||||||
lv2_port = &g_array_index (oclass->audio_out_ports, GstLV2Port, i);
|
lv2_port = &g_array_index (lv2_class->audio_out_ports, GstLV2Port, i);
|
||||||
slv2_instance_connect_port (lv2->instance, lv2_port->index,
|
slv2_instance_connect_port (lv2->instance, lv2_port->index,
|
||||||
gsp->audio_out[i]);
|
gsp->audio_out[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue