gegl r2797 - in trunk: . operations/external
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2797 - in trunk: . operations/external
- Date: Mon, 24 Nov 2008 00:26:20 +0000 (UTC)
Author: ok
Date: Mon Nov 24 00:26:20 2008
New Revision: 2797
URL: http://svn.gnome.org/viewvc/gegl?rev=2797&view=rev
Log:
* operations/external/v4l.c: (update), (process): made the v4l source
able to auto-update.
Modified:
trunk/ChangeLog
trunk/operations/external/v4l.c
Modified: trunk/operations/external/v4l.c
==============================================================================
--- trunk/operations/external/v4l.c (original)
+++ trunk/operations/external/v4l.c Mon Nov 24 00:26:20 2008
@@ -28,6 +28,8 @@
gegl_chant_int (height, _("Height"), 0, G_MAXINT, 240, _("Height for rendered image"))
gegl_chant_int (frame, _("Frame"), 0, G_MAXINT, 0,
_("current frame number, can be changed to trigger a reload of the image."))
+gegl_chant_int (fps, _("FPS"), 0, G_MAXINT, 0,
+ _("autotrigger reload this many times a second."))
#else
@@ -191,6 +193,13 @@
G_OBJECT_CLASS (gegl_chant_parent_class)->finalize (object);
}
+static gboolean update (GeglOperation *operation)
+{
+ GeglRectangle bounds = gegl_operation_get_bounding_box (operation);
+ gegl_operation_invalidate (operation, &bounds, FALSE);
+ return TRUE;
+}
+
static gboolean
process (GeglOperation *operation,
GeglBuffer *output,
@@ -199,6 +208,13 @@
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
Priv *p = (Priv*)o->chant_data;
guchar *capbuf;
+ static gboolean inited = FALSE;
+
+ if (!inited && o->fps != 0)
+ {
+ inited= TRUE;
+ g_timeout_add (1000/o->fps, update, operation);
+ }
if (!p->active)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]