E CVS: enthrall tilman

2007-08-26 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Removed Files:
Makefile 


Log Message:
Moved Makefile up one level




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2007-08-26 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall


Added Files:
Makefile 


Log Message:
Moved Makefile up one level




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2007-05-27 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c theora.c theora.h 


Log Message:
Refactored the enthrall/theora interface. Patch by Vincent.

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- enthrall.c  15 Feb 2007 04:24:43 -  1.14
+++ enthrall.c  27 May 2007 18:26:30 -  1.15
@@ -36,7 +36,6 @@
 #include 
 
 #include "theora.h"
-#include "rgb2yuv420.h"
 
 #define VERSION "0.0.2"
 
@@ -53,7 +52,7 @@
 
struct {
Ecore_X_Window id;
-   int w, h, w16, h16;
+   int w, h;
int offset_x, offset_y;
} window;
 
@@ -70,7 +69,6 @@
 
EnthrallTheora theora;
 
-   uint8_t *y, *u, *v;
int (*render)(Enthrall *e);
 };
 
@@ -154,7 +152,6 @@
Bool b;
int result;
uint32_t *data;
-   bool final_frame;
int ptr_x = 0, ptr_y = 0, unused1;
unsigned int unused2;
Window dw, childw = None;
@@ -164,13 +161,13 @@
 *valid window. not sure whether this really should be
 *done every time we enter this function.
 */
-   final_frame = false;
 
result = e->render(e);
if (result < 0) {
-   final_frame = true;
fprintf(stderr, "Failed to render frame... exiting.\n");
-   goto out;
+
+   enthrall_theora_encode_frame (&e->theora, NULL);
+   exit (result);
}
 
/* if we have a cursor, find out where it's at */
@@ -187,20 +184,9 @@
}
 
data = imlib_image_get_data_for_reading_only ();
-   rgb2yuv420 (data, e->window.w16, e->window.h16, e->y, e->u, e->v);
+   enthrall_theora_encode_frame (&e->theora, data);
imlib_image_put_back_data (data);
 
-out:
-   /* FIXME:
-* According to this ticket
-* https://trac.xiph.org/changeset/9
-* it seems we can just put in an empty packet to repeat
-* the last frame.
-*/
-   enthrall_theora_encode_frame (&e->theora, final_frame);
-   if (result < 0)
-   exit(result);
-
return 1; /* keep going */
 }
 
@@ -289,6 +275,7 @@
Imlib_Image tmp;
char pointer_img[PATH_MAX], output_file[PATH_MAX] = {0};
uint32_t *data;
+   int w16, h16;
double start;
bool s;
int fps = 25, quality = 90;
@@ -380,13 +367,12 @@
 
init_imlib (&e);
 
-   e.window.w16 = e.window.w;
-   e.window.h16 = e.window.h;
+   w16 = e.window.w;
+   h16 = e.window.h;
 
s = enthrall_theora_init (&e.theora, output_file,
- quality, &e.window.w16, &e.window.h16,
- &e.window.offset_x, &e.window.offset_y,
- &e.y, &e.u, &e.v);
+ quality, &w16, &h16,
+ &e.window.offset_x, &e.window.offset_y);
if (!s) {
fprintf (stderr, "Error: Cannot initialize theora encoder.\n");
 
@@ -403,12 +389,12 @@
e.damage.height = e.window.h;
e.damage_valid = true;
 
-   e.prev_img = imlib_create_image (e.window.w16, e.window.h16);
+   e.prev_img = imlib_create_image (w16, h16);
imlib_context_set_image (e.prev_img);
 
/* init image data */
data = imlib_image_get_data ();
-   memset (data, 0, e.window.w16 * e.window.h16 * 4);
+   memset (data, 0, w16 * h16 * 4);
imlib_image_put_back_data (data);
 
tmp = IMG_FROM_RECT (e.damage);
@@ -420,7 +406,7 @@
printf ("Starting recording...\n");
ecore_main_loop_begin ();
 
-   enthrall_theora_encode_frame (&e.theora, true);
+   enthrall_theora_encode_frame (&e.theora, NULL);
enthrall_theora_finish (&e.theora);
 
ecore_x_shutdown ();
===
RCS file: /cvs/e/misc/enthrall/src/theora.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- theora.c22 Oct 2006 19:12:21 -  1.2
+++ theora.c27 May 2007 18:26:30 -  1.3
@@ -44,19 +44,30 @@
 #include 
 
 #include "theora.h"
+#include "rgb2yuv420.h"
 
 void
-enthrall_theora_encode_frame (EnthrallTheora *et,
-  bool final_frame)
+enthrall_theora_encode_frame (EnthrallTheora *et, uint32_t *data)
 {
ogg_page page;
ogg_packet op;
 
+   /* If data is NULL, we assume that it's the last frame.
+*
+* FIXME:
+* According to this ticket
+* https://trac.xiph.org/changeset/9
+* it seems we can just put in an empty packet to repeat
+* the last frame.
+*/
+   if (data)
+   rgb2yuv420 (data, et->yuv

E CVS: enthrall tilman

2007-04-13 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
Makefile 


Log Message:
pkg-config ftw

===
RCS file: /cvs/e/misc/enthrall/src/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile20 Oct 2006 20:50:22 -  1.2
+++ Makefile13 Apr 2007 16:35:18 -  1.3
@@ -3,11 +3,10 @@
 OBJ = $(SRC:%.c=%.o)
 PREFIX = /usr/local
 
-LIBS = `ecore-config --libs-x` `imlib2-config --libs` \
-   `pkg-config theora --libs`
+LIBS = `pkg-config --libs ecore-x imlib2 theora`
 
-ECORE_CFLAGS = `ecore-config --cflags`
-IMLIB_CFLAGS = `imlib2-config --cflags`
+ECORE_CFLAGS = `pkg-config --cflags ecore-x`
+IMLIB_CFLAGS = `pkg-config --cflags imlib2`
 THEORA_CFLAGS = `pkg-config theora --cflags`
 
 all: $(BIN)



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-10-22 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c rgb2yuv420.c rgb2yuv420.h theora.c theora.h 


Log Message:
fixed handling of odd-shaped windows (non-4bit-aligned ones). since teaching 
the rgb2yuv conversion about these seems to be non-trivial, just use a properly 
sized imlib image.

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- enthrall.c  20 Oct 2006 20:50:22 -  1.12
+++ enthrall.c  22 Oct 2006 19:12:21 -  1.13
@@ -57,7 +57,8 @@
 
struct {
Ecore_X_Window id;
-   int w, h;
+   int w, h, w16, h16;
+   int offset_x, offset_y;
} window;
 
struct {
@@ -110,9 +111,10 @@
tmp = IMG_FROM_RECT (e->damage);
 
/* and blend it onto the previous shot */
-   imlib_blend_image_onto_image (tmp, true,
- 0, 0, e->damage.width, e->damage.height,
- e->damage.x, e->damage.y,
+   imlib_blend_image_onto_image (tmp, true, 0, 0,
+ e->damage.width, e->damage.height,
+ e->damage.x + e->window.offset_x,
+ e->damage.y + e->window.offset_y,
  e->damage.width, e->damage.height);
 
/* free the temporary grab */
@@ -128,13 +130,13 @@
if (b == True)
imlib_blend_image_onto_image (e->cursor.id, true, 0, 0,
  e->cursor.w, e->cursor.h,
- ptr_x, ptr_y,
+ ptr_x + 
e->window.offset_x,
+ ptr_y + 
e->window.offset_y,
  e->cursor.w, e->cursor.h);
}
 
data = imlib_image_get_data_for_reading_only ();
-   rgb2yuv420 (data, e->window.w, e->window.h, e->y, e->u, e->v,
-   e->theora.yuv.y_stride, e->theora.yuv.uv_stride);
+   rgb2yuv420 (data, e->window.w16, e->window.h16, e->y, e->u, e->v);
imlib_image_put_back_data (data);
 
enthrall_theora_encode_frame (&e->theora, false);
@@ -229,7 +231,9 @@
 main (int argc, char **argv)
 {
Enthrall e;
+   Imlib_Image tmp;
char pointer_img[PATH_MAX], output_file[PATH_MAX] = {0};
+   uint32_t *data;
double start;
bool s;
int fps = 25, quality = 90;
@@ -319,8 +323,12 @@
 
init_imlib (&e);
 
+   e.window.w16 = e.window.w;
+   e.window.h16 = e.window.h;
+
s = enthrall_theora_init (&e.theora, output_file,
- quality, e.window.w, e.window.h,
+ quality, &e.window.w16, &e.window.h16,
+ &e.window.offset_x, &e.window.offset_y,
  &e.y, &e.u, &e.v);
if (!s) {
fprintf (stderr, "Error: Cannot initialize theora encoder.\n");
@@ -338,8 +346,19 @@
e.damage.height = e.window.h;
e.damage_valid = true;
 
-   e.prev_img = IMG_FROM_RECT (e.damage);
+   e.prev_img = imlib_create_image (e.window.w16, e.window.h16);
imlib_context_set_image (e.prev_img);
+
+   /* init image data */
+   data = imlib_image_get_data ();
+   memset (data, 0, e.window.w16 * e.window.h16 * 4);
+   imlib_image_put_back_data (data);
+
+   tmp = IMG_FROM_RECT (e.damage);
+   imlib_blend_image_onto_image (tmp, true, 0, 0,
+ e.window.w, e.window.h,
+ e.window.offset_x, e.window.offset_y,
+ e.window.w, e.window.h);
 
printf ("Starting recording...\n");
ecore_main_loop_begin ();
===
RCS file: /cvs/e/misc/enthrall/src/rgb2yuv420.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- rgb2yuv420.c21 Oct 2006 15:32:13 -  1.2
+++ rgb2yuv420.c22 Oct 2006 19:12:21 -  1.3
@@ -36,8 +36,7 @@
  */
 void
 rgb2yuv420 (uint32_t *data_rgb, int width, int height,
-uint8_t *data_y, uint8_t *data_u, uint8_t *data_v,
-int y_stride, int uv_stride)
+uint8_t *data_y, uint8_t *data_u, uint8_t *data_v)
 {
int x, y, row_stride = width * 4;
uint8_t *rgb, *Y = data_y, *U = data_u, *V = data_v;
@@ -57,8 +56,6 @@
int32_t GtoVCoeff = (int32_t) (-94.154 * 256 + 0.5);
int32_t BtoVCoeff = (int32_t) (-18.285 * 256 + 0.5);
 
-   int y_edge = y_stride - width, uv_edge = uv_stride - (width / 2);
-

E CVS: enthrall tilman

2006-10-21 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
rgb2yuv420.c rgb2yuv420.h 


Log Message:
license fix, as requested (and acked) by Vincent on IRC.

===
RCS file: /cvs/e/misc/enthrall/src/rgb2yuv420.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- rgb2yuv420.c20 Oct 2006 20:50:22 -  1.1
+++ rgb2yuv420.c21 Oct 2006 15:32:13 -  1.2
@@ -1,21 +1,24 @@
-/* Avisynth v3.0 alpha.
- * Copyright 2005 David Pierre - Ben Rudiak-Gould et al.
- * http://www.avisynth.org
+/*
+ * Copyright (c) 2005 Vincent Torri (vtorri at univ-evry fr)
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
- * http://www.gnu.org/copyleft/gpl.html .
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include 
===
RCS file: /cvs/e/misc/enthrall/src/rgb2yuv420.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- rgb2yuv420.h20 Oct 2006 20:50:22 -  1.1
+++ rgb2yuv420.h21 Oct 2006 15:32:13 -  1.2
@@ -1,21 +1,24 @@
-/* Avisynth v3.0 alpha.
- * Copyright 2005 David Pierre - Ben Rudiak-Gould et al.
- * http://www.avisynth.org
+/*
+ * Copyright (c) 2005 Vincent Torri (vtorri at univ-evry fr)
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
- * http://www.gnu.org/copyleft/gpl.html .
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef __RGB2YUV420_H



--

E CVS: enthrall tilman

2006-10-20 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
Makefile enthrall.c 
Added Files:
rgb2yuv420.c rgb2yuv420.h theora.c theora.h 


Log Message:
enthrall now produces a theora video from the captured frames. thanks to 
vincent for pointing me at his rgb2yuv420 code.

===
RCS file: /cvs/e/misc/enthrall/src/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- Makefile19 Dec 2004 12:45:55 -  1.1
+++ Makefile20 Oct 2006 20:50:22 -  1.2
@@ -1,21 +1,28 @@
-# $Id: Makefile,v 1.1 2004/12/19 12:45:55 tsauerbeck Exp $
-
 BIN = enthrall
-SRC = $(BIN:%=%.c)
+SRC = enthrall.c theora.c rgb2yuv420.c
 OBJ = $(SRC:%.c=%.o)
 PREFIX = /usr/local
 
-FLAGS = $(CFLAGS) \
-`ecore-config --cflags` `imlib2-config --cflags`
-LIBS = `ecore-config --libs` `imlib2-config --libs`
+LIBS = `ecore-config --libs-x` `imlib2-config --libs` \
+   `pkg-config theora --libs`
+
+ECORE_CFLAGS = `ecore-config --cflags`
+IMLIB_CFLAGS = `imlib2-config --cflags`
+THEORA_CFLAGS = `pkg-config theora --cflags`
 
 all: $(BIN)
 
 $(BIN): $(OBJ)
$(CC) $(LIBS) $(OBJ) -o $@
 
+enthrall.o: enthrall.c
+   $(CC) $(CFLAGS) $(ECORE_CFLAGS) $(IMLIB_CFLAGS) $(THEORA_CFLAGS) -c -o 
$@ $<
+
+theora.o: theora.c
+   $(CC) $(CFLAGS) $(THEORA_CFLAGS) -c -o $@ $<
+
 .c.o:
-   $(CC) $(FLAGS) -c -o $@ $<
+   $(CC) $(CFLAGS) -c -o $@ $<
 
 install: $(BIN)
install $(BIN) $(DESTDIR)$(PREFIX)/bin
===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- enthrall.c  12 Oct 2006 18:29:28 -  1.11
+++ enthrall.c  20 Oct 2006 20:50:22 -  1.12
@@ -1,6 +1,4 @@
 /*
- * $Id: enthrall.c,v 1.11 2006/10/12 18:29:28 tilman Exp $
- *
  * Copyright (C) 2004-2006 Tilman Sauerbeck (tilman at code-monkey de)
  *
  * This program is free software; you can redistribute it and/or modify
@@ -33,11 +31,13 @@
 #include 
 #include 
 #include 
-#include 
 
 #define _GNU_SOURCE
 #include 
 
+#include "theora.h"
+#include "rgb2yuv420.h"
+
 #define VERSION "0.0.2"
 
 /* FIXME: should be configurable, but i'm too lazy to add the necessary
@@ -55,10 +55,6 @@
 typedef struct {
Ecore_X_Display *disp;
 
-   int fps;
-   int quality;
-   char output_dir[PATH_MAX];
-
struct {
Ecore_X_Window id;
int w, h;
@@ -72,9 +68,12 @@
Imlib_Image prev_img;
Ecore_X_Rectangle damage;
bool damage_valid;
-   char last_written[PATH_MAX];
 
unsigned long frame_count;
+
+   EnthrallTheora theora;
+
+   uint8_t *y, *u, *v;
 } Enthrall;
 
 static int
@@ -85,7 +84,7 @@
Bool b;
int ptr_x = 0, ptr_y = 0, unused1;
unsigned int unused2;
-   char buf[PATH_MAX];
+   uint32_t *data;
Window dw, childw = None;
 
/* FIXME: check whether e->window.id still points to a
@@ -93,14 +92,17 @@
 *done every time we enter this function.
 */
 
-   snprintf (buf, sizeof (buf), "%s/"FILE_FMT".jpeg",
- e->output_dir, e->frame_count);
-
/* was there any change at all?
 * if not, just link the last written frame to the current.
 */
if (!e->damage_valid) {
-   symlink (e->last_written, buf);
+   /* FIXME:
+* According to this ticket
+* https://trac.xiph.org/changeset/9
+* it seems we can just put in an empty packet to repeat
+* the last frame.
+*/
+   enthrall_theora_encode_frame (&e->theora, false);
goto out;
}
 
@@ -130,11 +132,12 @@
  e->cursor.w, e->cursor.h);
}
 
-   imlib_image_attach_data_value ("quality", NULL, e->quality, NULL);
-   imlib_image_set_format ("jpeg");
+   data = imlib_image_get_data_for_reading_only ();
+   rgb2yuv420 (data, e->window.w, e->window.h, e->y, e->u, e->v,
+   e->theora.yuv.y_stride, e->theora.yuv.uv_stride);
+   imlib_image_put_back_data (data);
 
-   imlib_save_image (buf);
-   strcpy (e->last_written, buf);
+   enthrall_theora_encode_frame (&e->theora, false);
 
e->damage_valid = false;
 
@@ -187,12 +190,12 @@
"Options:\n"
"  -f, --fps=FPS   "
"frames per second (1-50, default: 25)\n"
-   "  -o, --output-directory=DIR  "
-   "output directory (default: working directory)\n"
+   "  -o, --output-file=F "
+   "output file\n"
"  -p, --pointer=FILE  "
"path to pointer image file\n"

E CVS: enthrall tilman

2006-10-12 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
update copyright notice

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- enthrall.c  12 Oct 2006 18:24:11 -  1.10
+++ enthrall.c  12 Oct 2006 18:29:28 -  1.11
@@ -1,7 +1,7 @@
 /*
- * $Id: enthrall.c,v 1.10 2006/10/12 18:24:11 tilman Exp $
+ * $Id: enthrall.c,v 1.11 2006/10/12 18:29:28 tilman Exp $
  *
- * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
+ * Copyright (C) 2004-2006 Tilman Sauerbeck (tilman at code-monkey de)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-10-12 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
use the x damage extension to only take screenshots of areas that changed since 
the last grab

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- enthrall.c  11 Oct 2006 19:02:19 -  1.9
+++ enthrall.c  12 Oct 2006 18:24:11 -  1.10
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.9 2006/10/11 19:02:19 tilman Exp $
+ * $Id: enthrall.c,v 1.10 2006/10/12 18:24:11 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -45,6 +45,13 @@
  */
 #define FILE_FMT "enthrall_dump%.5lu"
 
+#define IMG_FROM_RECT(r) \
+   imlib_create_image_from_drawable (0, \
+ (r).x, (r).y, (r).width, (r).height, \
+ true)
+#define MIN(a, b) (a) < (b) ? (a) : (b)
+#define MAX(a, b) (a) > (b) ? (a) : (b)
+
 typedef struct {
Ecore_X_Display *disp;
 
@@ -62,6 +69,11 @@
int w, h;
} cursor;
 
+   Imlib_Image prev_img;
+   Ecore_X_Rectangle damage;
+   bool damage_valid;
+   char last_written[PATH_MAX];
+
unsigned long frame_count;
 } Enthrall;
 
@@ -69,7 +81,7 @@
 on_timer (void *udata)
 {
Enthrall *e = udata;
-   Imlib_Image im;
+   Imlib_Image tmp;
Bool b;
int ptr_x = 0, ptr_y = 0, unused1;
unsigned int unused2;
@@ -84,10 +96,27 @@
snprintf (buf, sizeof (buf), "%s/"FILE_FMT".jpeg",
  e->output_dir, e->frame_count);
 
-   im = imlib_create_image_from_drawable (0, 0, 0,
-  e->window.w, e->window.h,
-  true);
-   imlib_context_set_image (im);
+   /* was there any change at all?
+* if not, just link the last written frame to the current.
+*/
+   if (!e->damage_valid) {
+   symlink (e->last_written, buf);
+   goto out;
+   }
+
+   /* grab the damaged rectangle */
+   tmp = IMG_FROM_RECT (e->damage);
+
+   /* and blend it onto the previous shot */
+   imlib_blend_image_onto_image (tmp, true,
+ 0, 0, e->damage.width, e->damage.height,
+ e->damage.x, e->damage.y,
+ e->damage.width, e->damage.height);
+
+   /* free the temporary grab */
+   imlib_context_set_image (tmp);
+   imlib_free_image ();
+   imlib_context_set_image (e->prev_img);
 
/* if we have a cursor, find out where it's at */
if (e->cursor.id) {
@@ -105,13 +134,51 @@
imlib_image_set_format ("jpeg");
 
imlib_save_image (buf);
-   imlib_free_image ();
+   strcpy (e->last_written, buf);
 
+   e->damage_valid = false;
+
+out:
e->frame_count++;
 
return 1; /* keep going */
 }
 
+static inline void
+combine_rects (Ecore_X_Rectangle *a, Ecore_X_Rectangle *b)
+{
+   int ax2 = a->x + a->width;
+   int ay2 = a->y + a->height;
+
+   int bx2 = b->x + b->width;
+   int by2 = b->y + b->height;
+
+   a->x = MIN (a->x, b->x);
+   a->y = MIN (a->y, b->y);
+
+   a->width = MAX (ax2, bx2) - a->x;
+   a->height = MAX (ay2, by2) - a->y;
+}
+
+static int
+on_damage (void *udata, int type, void *event)
+{
+   Enthrall *e = udata;
+   Ecore_X_Event_Damage *ev = event;
+
+   if (e->damage_valid)
+   combine_rects (&e->damage, &ev->area);
+   else {
+   e->damage.x = ev->area.x;
+   e->damage.y = ev->area.y;
+   e->damage.width = ev->area.width;
+   e->damage.height = ev->area.height;
+   e->damage_valid = true;
+   }
+
+   return 0;
+}
+
 static void
 show_usage ()
 {
@@ -237,6 +304,12 @@
ecore_init ();
ecore_x_init (NULL);
 
+   if (!ecore_x_damage_query ()) {
+   fprintf (stderr, "Error: X damage extension not available.\n");
+
+   return EXIT_FAILURE;
+   }
+
start = ecore_time_get ();
 
e.disp = ecore_x_display_get ();
@@ -251,10 +324,24 @@
ecore_x_window_geometry_get (e.window.id, NULL, NULL,
 &e.window.w, &e.window.h);
 
+   ecore_x_damage_new (e.window.id,
+   ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES);
+
init_imlib (&e);
 
ecore_timer_add (1.0 / e.fps, on_timer, &e);
 
+   ecore_event_handler_add (ECORE_X_EVENT_DAMAGE_NOTIFY,
+on_damage, &e);
+
+   e.damage.x = e.damage.y = 0;
+   e.damage.width = e.window.w;
+   e.damage.height = e.window.h;
+   e.damage_valid = true;
+
+   e.prev_img = 

E CVS: enthrall tilman

2006-10-11 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
child window may be none

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- enthrall.c  26 Aug 2006 11:10:12 -  1.8
+++ enthrall.c  11 Oct 2006 19:02:19 -  1.9
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.8 2006/08/26 11:10:12 tilman Exp $
+ * $Id: enthrall.c,v 1.9 2006/10/11 19:02:19 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -94,7 +94,7 @@
b = XQueryPointer (e->disp, e->window.id, &dw, &childw,
   &unused1, &unused1, &ptr_x, &ptr_y, 
&unused2);
 
-   if (b == True && childw != None)
+   if (b == True)
imlib_blend_image_onto_image (e->cursor.id, true, 0, 0,
  e->cursor.w, e->cursor.h,
  ptr_x, ptr_y,



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-08-26 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
ugh, forgot to hook up the new command line switches in getopt_long()

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- enthrall.c  18 Aug 2006 19:02:27 -  1.7
+++ enthrall.c  26 Aug 2006 11:10:12 -  1.8
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.7 2006/08/18 19:02:27 tilman Exp $
+ * $Id: enthrall.c,v 1.8 2006/08/26 11:10:12 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -179,7 +179,7 @@
 
strcpy (e.output_dir, ".");
 
-   while ((c = getopt_long (argc, argv, "hf:q:w:", options, NULL)) != -1) {
+   while ((c = getopt_long (argc, argv, "hf:o:p:q:w:", options, NULL)) != 
-1) {
int base;
 
switch (c) {



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-08-18 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
bump version to 0.0.2

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- enthrall.c  18 Aug 2006 18:40:22 -  1.6
+++ enthrall.c  18 Aug 2006 19:02:27 -  1.7
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.6 2006/08/18 18:40:22 tilman Exp $
+ * $Id: enthrall.c,v 1.7 2006/08/18 19:02:27 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -38,7 +38,7 @@
 #define _GNU_SOURCE
 #include 
 
-#define VERSION "0.0.1"
+#define VERSION "0.0.2"
 
 /* FIXME: should be configurable, but i'm too lazy to add the necessary
  * sanity checks :)



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-08-18 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
output directory support (based on a patch by morlenxus)

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- enthrall.c  18 Aug 2006 17:25:18 -  1.5
+++ enthrall.c  18 Aug 2006 18:40:22 -  1.6
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.5 2006/08/18 17:25:18 tilman Exp $
+ * $Id: enthrall.c,v 1.6 2006/08/18 18:40:22 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define _GNU_SOURCE
 #include 
@@ -49,6 +50,7 @@
 
int fps;
int quality;
+   char output_dir[PATH_MAX];
 
struct {
Ecore_X_Window id;
@@ -79,7 +81,8 @@
 *done every time we enter this function.
 */
 
-   snprintf (buf, sizeof (buf), FILE_FMT".jpeg", e->frame_count);
+   snprintf (buf, sizeof (buf), "%s/"FILE_FMT".jpeg",
+ e->output_dir, e->frame_count);
 
im = imlib_create_image_from_drawable (0, 0, 0,
   e->window.w, e->window.h,
@@ -115,13 +118,15 @@
printf ("enthrall " VERSION "\n\n"
"Usage: enthrall [options]\n\n"
"Options:\n"
-   "  -f, --fps=FPS "
+   "  -f, --fps=FPS   "
"frames per second (1-50, default: 25)\n"
-   "  -p, --pointer=FILE"
+   "  -o, --output-directory=DIR  "
+   "output directory (default: working directory)\n"
+   "  -p, --pointer=FILE  "
"path to pointer image file\n"
-   "  -q, --quality=QUALITY "
+   "  -q, --quality=QUALITY   "
"JPEG quality (0-100, default: 90)\n"
-   "  -w, --window=WINDOW   "
+   "  -w, --window=WINDOW "
"window to grab\n");
 }
 
@@ -154,11 +159,13 @@
 main (int argc, char **argv)
 {
Enthrall e;
+   DIR *d;
char pointer_img[PATH_MAX];
double start;
struct option options[] = {
{"help", no_argument, NULL, 'h'},
{"fps", required_argument, NULL, 'f'},
+   {"output-directory", required_argument, NULL, 'o'},
{"pointer", required_argument, NULL, 'p'},
{"quality", required_argument, NULL, 'q'},
{"window", required_argument, NULL, 'w'},
@@ -170,6 +177,8 @@
e.fps = 25;
e.quality = 90;
 
+   strcpy (e.output_dir, ".");
+
while ((c = getopt_long (argc, argv, "hf:q:w:", options, NULL)) != -1) {
int base;
 
@@ -180,6 +189,10 @@
case 'f':
e.fps = atoi (optarg);
break;
+   case 'o':
+   snprintf (e.output_dir, sizeof (e.output_dir), 
"%s",
+ optarg);
+   break;
case 'p':
snprintf (pointer_img, sizeof (pointer_img), 
"%s",
  optarg);
@@ -212,6 +225,15 @@
return EXIT_FAILURE;
}
 
+   d = opendir (e.output_dir);
+   if (!d) {
+   fprintf (stderr, "Error: cannot open output directory.\n");
+
+   return EXIT_FAILURE;
+   }
+
+   closedir (d);
+
ecore_init ();
ecore_x_init (NULL);
 
@@ -246,10 +268,11 @@
printf ("Wrote %lu frames in %f seconds.\n\n", e.frame_count,
ecore_time_get () - start);
printf ("Suggested MEncoder call to encode the video:\n\n"
-   "mencoder \"mf://*.jpeg\" \\\n"
+   "mencoder \"mf://%s/*.jpeg\" \\\n"
"-mf w=%i:h=%i:fps=%i:type=jpeg -ovc lavc \\\n"
"-lavcopts vcodec=mpeg4:vbitrate=16000:vhq:autoaspect \\\n"
-   "-o out.avi\n\n", e.window.w, e.window.h, e.fps);
+   "-o out.avi\n\n",
+   e.output_dir, e.window.w, e.window.h, e.fps);
 
return EXIT_SUCCESS;
 }



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enligh

E CVS: enthrall tilman

2006-08-18 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
enable autoaspect mode in mencoder (morlenxus)

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- enthrall.c  18 Aug 2006 17:22:47 -  1.4
+++ enthrall.c  18 Aug 2006 17:25:18 -  1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.4 2006/08/18 17:22:47 tilman Exp $
+ * $Id: enthrall.c,v 1.5 2006/08/18 17:25:18 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -248,7 +248,7 @@
printf ("Suggested MEncoder call to encode the video:\n\n"
"mencoder \"mf://*.jpeg\" \\\n"
"-mf w=%i:h=%i:fps=%i:type=jpeg -ovc lavc \\\n"
-   "-lavcopts vcodec=mpeg4:vbitrate=16000:vhq \\\n"
+   "-lavcopts vcodec=mpeg4:vbitrate=16000:vhq:autoaspect \\\n"
"-o out.avi\n\n", e.window.w, e.window.h, e.fps);
 
return EXIT_SUCCESS;



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-08-18 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
configurable pointer image (morlenxus)

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- enthrall.c  18 Aug 2006 17:17:01 -  1.3
+++ enthrall.c  18 Aug 2006 17:22:47 -  1.4
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.3 2006/08/18 17:17:01 tilman Exp $
+ * $Id: enthrall.c,v 1.4 2006/08/18 17:22:47 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -117,6 +117,8 @@
"Options:\n"
"  -f, --fps=FPS "
"frames per second (1-50, default: 25)\n"
+   "  -p, --pointer=FILE"
+   "path to pointer image file\n"
"  -q, --quality=QUALITY "
"JPEG quality (0-100, default: 90)\n"
"  -w, --window=WINDOW   "
@@ -152,10 +154,12 @@
 main (int argc, char **argv)
 {
Enthrall e;
+   char pointer_img[PATH_MAX];
double start;
struct option options[] = {
{"help", no_argument, NULL, 'h'},
{"fps", required_argument, NULL, 'f'},
+   {"pointer", required_argument, NULL, 'p'},
{"quality", required_argument, NULL, 'q'},
{"window", required_argument, NULL, 'w'},
{NULL, no_argument, NULL, 0}};
@@ -176,6 +180,10 @@
case 'f':
e.fps = atoi (optarg);
break;
+   case 'p':
+   snprintf (pointer_img, sizeof (pointer_img), 
"%s",
+ optarg);
+   break;
case 'q':
e.quality = atoi (optarg);
break;
@@ -211,8 +219,8 @@
 
e.disp = ecore_x_display_get ();
 
-   if (file_exists ("pointer.png")) {
-   e.cursor.id = imlib_load_image ("pointer.png");
+   if (file_exists (pointer_img)) {
+   e.cursor.id = imlib_load_image (pointer_img);
imlib_context_set_image (e.cursor.id);
e.cursor.w = imlib_image_get_width ();
e.cursor.h = imlib_image_get_height ();



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: enthrall tilman

2006-08-18 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : tilman
Project : misc
Module  : enthrall

Dir : misc/enthrall/src


Modified Files:
enthrall.c 


Log Message:
warning fixes (morlenxus)

===
RCS file: /cvs/e/misc/enthrall/src/enthrall.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- enthrall.c  18 Sep 2005 15:21:45 -  1.2
+++ enthrall.c  18 Aug 2006 17:17:01 -  1.3
@@ -1,5 +1,5 @@
 /*
- * $Id: enthrall.c,v 1.2 2005/09/18 15:21:45 tsauerbeck Exp $
+ * $Id: enthrall.c,v 1.3 2006/08/18 17:17:01 tilman Exp $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -69,10 +69,10 @@
Enthrall *e = udata;
Imlib_Image im;
Bool b;
-   int ptr_x = 0, ptr_y = 0;
+   int ptr_x = 0, ptr_y = 0, unused1;
+   unsigned int unused2;
char buf[PATH_MAX];
Window dw, childw = None;
-   unsigned int unused;
 
/* FIXME: check whether e->window.id still points to a
 *valid window. not sure whether this really should be
@@ -89,7 +89,7 @@
/* if we have a cursor, find out where it's at */
if (e->cursor.id) {
b = XQueryPointer (e->disp, e->window.id, &dw, &childw,
-  &unused, &unused, &ptr_x, &ptr_y, &unused);
+  &unused1, &unused1, &ptr_x, &ptr_y, 
&unused2);
 
if (b == True && childw != None)
imlib_blend_image_onto_image (e->cursor.id, true, 0, 0,



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs