Skip to content
Snippets Groups Projects
Commit 5747ce0f authored by Larry Price's avatar Larry Price
Browse files

changes to sort injection files before using them

parents b736730e 5593aaa4
No related branches found
No related tags found
No related merge requests found
......@@ -104,16 +104,16 @@ elems.append(pipeutil.mkelem("lal_firbank",
elems.append(pipeutil.mkelem("progressreport"))
# sum square of the snr channels
#elems.append(pipeutil.mkelem("lal_sumsquares"))
elems.append(pipeutil.mkelem("lal_sumsquares"))
elems.append(pipeutil.mkelem("queue", {"max-size-time": queuesize}))
#elems.append(pipeutil.mkelem("cairovis_lineseries",
# {"title": "Omega detection"}))
elems.append(pipeutil.mkelem("cairovis_waterfall",
{"title": "OmegaGram",
"history": gst.SECOND,
}))
elems.append(pipeutil.mkelem("cairovis_lineseries",
{"title": "Omega detection"}))
# elems.append(pipeutil.mkelem("cairovis_waterfall",
# {"title": "OmegaGram",
# "history": gst.SECOND,
# }))
elems.append(pipeutil.mkelem("capsfilter",
{"caps": gst.Caps("video/x-raw-rgb,framerate=24/1,width=800,height=600")
......
plugin_LTLIBRARIES = libcairovis.la
colormap_data.c: gencolormap.py
python $< > $@
# FIXME: is it OK to have Matplotlib as a build dependency?
#colormap_data.c: gencolormap.py
# python $< > $@
libcairovis_la_SOURCES = \
cairovis.c \
......
......@@ -246,6 +246,7 @@ enum property {
ARG_ZMIN,
ARG_ZMAX,
ARG_HISTORY,
ARG_COLORMAP,
};
......@@ -273,6 +274,20 @@ static void set_property(GObject * object, enum property id, const GValue * valu
case ARG_HISTORY:
element->history = g_value_get_uint64(value);
break;
case ARG_COLORMAP: {
gchar *new_map_name = g_value_dup_string(value);
colormap *new_map = colormap_create_by_name(new_map_name);
if (new_map)
{
g_free(element->map_name);
colormap_destroy(element->map);
element->map_name = new_map_name;
element->map = new_map;
} else {
GST_ERROR_OBJECT(element, "no such colormap: %s", new_map_name);
g_free(new_map_name);
}
} break;
}
GST_OBJECT_UNLOCK(element);
......@@ -302,6 +317,9 @@ static void get_property(GObject * object, enum property id, GValue * value, GPa
case ARG_HISTORY:
g_value_set_uint64(value, element->history);
break;
case ARG_COLORMAP:
g_value_set_string(value, element->map_name);
break;
}
GST_OBJECT_UNLOCK(element);
......@@ -319,6 +337,8 @@ static void finalize(GObject *object)
element->sinkpad = NULL;
gst_object_unref(element->adapter);
element->adapter = NULL;
g_free(element->map_name);
element->map_name = NULL;
colormap_destroy(element->map);
element->map = NULL;
......@@ -420,6 +440,17 @@ static void class_init(gpointer class, gpointer class_data)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT
)
);
g_object_class_install_property(
gobject_class,
ARG_COLORMAP,
g_param_spec_string(
"colormap",
"Colormap",
"Name of colormap (e.g. 'jet')",
"jet",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT
)
);
}
......@@ -440,7 +471,8 @@ static void instance_init(GTypeInstance *object, gpointer class)
element->t0 = GST_CLOCK_TIME_NONE;
element->offset0 = GST_BUFFER_OFFSET_NONE;
element->last_offset_end = GST_BUFFER_OFFSET_NONE;
element->map = colormap_create_by_name("jet");
element->map = NULL;
element->map_name = NULL;
element->zlabel = NULL;
}
......
......@@ -69,6 +69,7 @@ typedef struct _CairoVisWaterfall {
guint64 offset0;
guint64 last_offset_end;
guint64 frame_number;
gchar *map_name;
colormap *map;
} CairoVisWaterfall;
......
......@@ -26,6 +26,11 @@ static colormap_channel channel_for_data(colormap_channel_data *data)
channel.accel = gsl_interp_accel_alloc();
channel.spline = gsl_spline_alloc(gsl_interp_linear, data->len);
gsl_spline_init(channel.spline, data->x, data->y, data->len);
/* FIXME: move these into a separate destructor for colormap_channel_data? */
g_free(data->x);
g_free(data->y);
return channel;
}
......@@ -56,6 +61,9 @@ static void colormap_destroy_channel(colormap_channel *channel)
void colormap_destroy(colormap *map)
{
if (map == NULL)
return;
colormap_destroy_channel(&map->red);
colormap_destroy_channel(&map->green);
colormap_destroy_channel(&map->blue);
......
This diff is collapsed.
......@@ -46,8 +46,8 @@ for key, value in sorted(datad.items()):
print 'const double x[] = {', ','.join([repr(x) for x, y0, y1 in sorted(value[color])]), '};'
print 'const double y[] = {', ','.join([repr(y1) for x, y0, y1 in sorted(value[color])]), '};'
print 'data->%s.len = sizeof(x) / sizeof(double);' % color
print 'data->%s.x = x;' % color
print 'data->%s.y = y;' % color
print 'data->%s.x = g_memdup(x, sizeof(x));' % color
print 'data->%s.y = g_memdup(y, sizeof(y));' % color
print '}'
print 'return TRUE;'
print '} else',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment