Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 76127 | Differences between
and this patch

Collapse All | Expand All

(-)pyvoice-gyach-1.0.7.orig/gyach/Makefile.am (-4 / +3 lines)
Lines 2-11 Link Here
2
2
3
SUBDIRS = src
3
SUBDIRS = src
4
4
5
EXTRA_DIST = gyach.glade sample.gyachrc sample.ignore.list \
5
EXTRA_DIST = sample.gyachrc sample.ignore.list sample.ignore.regex \
6
	sample.ignore.regex BUGS depcomp scripts/my-gtk-config \
6
	BUGS depcomp scripts/my-gtk-config \
7
	README.FreeBSD README.NetBSD README.MacOSX README.Win32 \
7
	gyache-help-short.txt PHROZEN_SMOKE_README.txt
8
	src/interface.c.gtk2.patch
9
8
10
install-data-local:
9
install-data-local:
11
	@$(NORMAL_INSTALL)
10
	@$(NORMAL_INSTALL)
(-)pyvoice-gyach-1.0.7.orig/gyach/configure.in (-90 / +127 lines)
Lines 1-7 Link Here
1
dnl Process this file with autoconf to produce a configure script.
1
dnl Process this file with autoconf to produce a configure script.
2
2
3
AC_INIT(configure.in)
3
dnl Is there actually anyone who understands how this autoconf animal works?
4
AM_INIT_AUTOMAKE(gyach, 0.9.2)
4
dnl Feel free to clean it up if you do....
5
6
AC_INIT
7
AC_CONFIG_SRCDIR([configure.in])
8
AM_INIT_AUTOMAKE(gyache, 1.0.7)
5
AM_CONFIG_HEADER(config.h)
9
AM_CONFIG_HEADER(config.h)
6
10
7
AC_ISC_POSIX
11
AC_ISC_POSIX
Lines 9-91 Link Here
9
AM_PROG_CC_STDC
13
AM_PROG_CC_STDC
10
AC_HEADER_STDC
14
AC_HEADER_STDC
11
15
12
AC_ARG_ENABLE(gtk_v2,
16
dnl configure libtool. this is for adding the -lltdl linker flag.
13
  [  --disable-gtk_v2        disable gtk v2.0.x support])
17
AC_LIBLTDL_INSTALLABLE
14
AC_ARG_ENABLE(gdk-pixbuf,
18
AC_PROG_LIBTOOL
15
  [  --disable-gdk-pixbuf    disable use of gdk-pixbuf (with gtk v1.x)],
19
AC_SUBST(LIBLTDL)
16
    gdk_pixbuf=$enableval, gdk_pixbuf=yes)
20
17
AC_ARG_ENABLE(pixmaps,
21
dnl stolen from gdm (who stole it from gconf..)
18
  [  --disable-pixmaps       disable remote user status pixmaps])
22
# find the actual value for $prefix that we'll end up with
23
REAL_PREFIX=
24
if test "x$prefix" = "xNONE"; then
25
  REAL_PREFIX=$ac_default_prefix
26
else
27
  REAL_PREFIX=$prefix
28
fi
29
old_prefix=$prefix
30
prefix=$REAL_PREFIX
31
32
REAL_EXEC_PREFIX=
33
if test "x$exec_prefix" = "xNONE"; then
34
  REAL_EXEC_PREFIX=$prefix
35
else
36
  REAL_EXEC_PREFIX=$exec_prefix
37
fi
38
old_exec_prefix=$exec_prefix
39
exec_prefix=$REAL_EXEC_PREFIX
40
41
42
dnl AC_ARG_ENABLE(gtk_v2,
43
dnl   [  --disable-gtk_v2        disable gtk v2.0.x support])
44
dnl AC_ARG_ENABLE(gdk-pixbuf,
45
dnl   [  --disable-gdk-pixbuf    disable use of gdk-pixbuf (with gtk v1.x)],
46
dnl    gdk_pixbuf=$enableval, gdk_pixbuf=yes)
47
dnl AC_ARG_ENABLE(pixmaps,
48
dnl   [  --disable-pixmaps       disable remote user status pixmaps])
19
AC_ARG_ENABLE(threads,
49
AC_ARG_ENABLE(threads,
20
  [  --disable-threads       disable use of pthread_create])
50
  [  --disable-threads       disable use of pthread_create])
21
AC_ARG_ENABLE(debug,
51
AC_ARG_ENABLE(debug,
22
  [  --enable-debug=LEVEL    enable debug messages at specified level])
52
  [  --enable-debug=LEVEL    enable debug messages at specified level])
23
dnl AC_ARG_ENABLE(interface,
24
dnl   [  --enable-interface=type use "type" widget for main chat text [text/xtext/html]] )
25
53
54
dnl GTK_CFLAGS=`pkg-config --cflags gtk+-2.0 gthread-2.0 libgtkhtml-2.0 2>/dev/null`
55
dnl ESD_LIBS=`esd-config --cflags`
56
dnl ESD_LIBS=`esd-config --libs`
57
58
AC_SUBST(CFLAGS)
59
AC_SUBST(LDFLAGS)
60
61
AC_DEFINE(USE_GTK2,[],[use GTK+ v2.x])
62
GTK_REQUIRED_VERSION=2.0
63
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION)
64
AC_SUBST(GTK_CFLAGS)
65
AC_SUBST(GTK_LIBS)
66
67
GTHREAD_REQUIRED_VERSION=2.0
68
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GTHREAD_REQUIRED_VERSION)
69
AC_SUBST(GHTREAD_CFLAGS)
70
AC_SUBST(GTHREAD_LIBS)
71
72
GTKHTML_REQUIRED_VERSION=2.0
73
PKG_CHECK_MODULES(GTKHTML, libgtkhtml-2.0 >= $GTKHTML_REQUIRED_VERSION)
74
AC_SUBST(GTKHTML_CFLAGS)
75
AC_SUBST(GTKHTML_LIBS)
76
77
dnl I honsestly dont know what version is requred of esd
78
dnl or if it would be better to:
79
dnl ESOUND_LIBS=`esd-config --libs`
80
dnl AC_SUBST(ESOUND_LIBS)
81
ESOUND_REQUIRED_VERSION=0.2
82
PKG_CHECK_MODULES(ESOUND, esound >= $ESOUND_REQUIRED_VERSION)
83
AC_SUBST(ESOUND_CFLAGS)
84
AC_SUBST(ESOUND_LIBS)
26
85
27
if test "x$enable_gtk_v2" != "xno"; then
28
	printf "checking for GTK - version >= 2.0.0... "
29
	GTK_CFLAGS=`pkg-config --cflags gtk+-2.0 gthread-2.0 2> /dev/null`
30
else
31
	GTK_CFLAGS=""
32
fi
33
86
34
if test "x${GTK_CFLAGS}" != "x"; then
87
if test "$enable_threads" != "no"; then
35
	if test "x$enable_gtk_v2" != "xno"; then
88
	GTK_LIBS=`pkg-config --libs gtk+-2.0 gthread-2.0 libgtkhtml-2.0  2>/dev/null`
36
		echo yes
37
	fi
38
	if test "$enable_threads" != "no"; then
39
		GTK_LIBS=`pkg-config --libs gtk+-2.0 gthread-2.0 2> /dev/null`
40
	else
41
		GTK_LIBS=`pkg-config --libs gtk+-2.0 2> /dev/null`
42
	fi
43
	CFLAGS="${CFLAGS} ${GTK_CFLAGS}"
44
	LIBS="${LIBS} ${GTK_LIBS}"
45
	AC_DEFINE(USE_GTK2)
46
else
47
	if test "x$enable_gtk_v2" != "xno"; then
48
		echo no
49
	fi
50
	AM_PATH_GTK(1.2.0, ,
51
            AC_MSG_WARN(Cannot find GTK: Is gtk-config in path?),
52
			gthread)
53
dnl            AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?), gthread)
54
55
	if test "x${GTK_CFLAGS}" = 'x'; then
56
		echo "*** gtk-config not found, running scripts/my-gtk-config"
57
		CFLAGS="${CFLAGS} `scripts/my-gtk-config --cflags`"
58
		echo "***     CFLAGS now '${CFLAGS}'"
59
		LIBS="${LIBS} `scripts/my-gtk-config --libs`"
60
		echo "***     LIBS now '${LIBS}'"
61
	fi
62
63
	if test "$gdk_pixbuf" = yes; then
64
	  AC_PATH_PROG(gdkpixbufpath, gdk-pixbuf-config)
65
	  AC_MSG_CHECKING(for gdk-pixbuf >= 0.8)
66
	  GDK_PIXBUF_CFLAGS=`$gdkpixbufpath --cflags 2>/dev/null`
67
	  GDK_PIXBUF_LIBS=`$gdkpixbufpath --libs 2>/dev/null`
68
	  if test "_$GDK_PIXBUF_CFLAGS" = _; then
69
		AC_MSG_RESULT([not found, will attempt to use 'convert' for images])
70
	  else
71
		vers=`$gdkpixbufpath --version`
72
		case $vers
73
		in
74
		  gdk-pixbuf-0.[[01234567]]) gdk_pixbuf_ok=false ;;
75
		  *) gdk_pixbuf_ok=true ;;
76
		esac
77
		if $gdk_pixbuf_ok; then
78
		  AC_MSG_RESULT(found)
79
		  gdk_pixbuf=yes
80
		  AC_DEFINE(USE_GDK_PIXBUF)
81
		  LIBS="${LIBS} $GDK_PIXBUF_LIBS"
82
		  CFLAGS="${CFLAGS} $GDK_PIXBUF_CFLAGS"
83
		else
84
		  gdk_pixbuf=no
85
		  AC_MSG_RESULT([version too old, building without gdk-pixbuf])
86
		fi
87
	  fi
88
	fi
89
fi
89
fi
90
90
91
ac_system=`uname -s | cut -c1-6`
91
ac_system=`uname -s | cut -c1-6`
Lines 93-130 Link Here
93
	CFLAGS="${CFLAGS} -fnative-struct"
93
	CFLAGS="${CFLAGS} -fnative-struct"
94
fi
94
fi
95
95
96
96
dnl Not needed really?
97
AC_CHECK_LIB( c_r, pthread_create, LIBS="$LIBS -lc_r", )
97
AC_CHECK_LIB( c_r, pthread_create, LIBS="$LIBS -lc_r", )
98
98
99
dnl check for jasper here
100
AC_CHECK_LIB(jasper, jas_init, [JASPER_LIBS="-ljasper"], [
101
		     AC_MSG_ERROR(cannot find jasper library)])
102
AC_SUBST(JASPER_LIBS)
103
104
# check for libccvt
105
# libccvt is a part of the camserv project but is not automatically 
106
# installed. You will need to manually copy libccvt.a to /usr/lib and
107
# ccvt.h to /usr/include or something similar. 
108
AC_CHECK_HEADER(ccvt.h)
109
AC_CHECK_LIB(ccvt, ccvt_420p_rgb24)
110
99
dnl Set PACKAGE_DATA_DIR in config.h.
111
dnl Set PACKAGE_DATA_DIR in config.h.
100
if test "x${datadir}" = 'x${prefix}/share'; then
112
dnl if test "x${datadir}" = 'x${prefix}/share'; then
101
  if test "x${prefix}" = "xNONE"; then
113
dnl   if test "x${prefix}" = "xNONE"; then
102
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
114
dnl    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", [])
103
  else
115
dnl  else
104
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
116
dnl    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [])
105
  fi
117
dnl  fi
106
else
118
dnl else
107
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
119
dnl   AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", [])
108
fi
120
dnl fi
121
122
dnl set EXPANDED_DATADIR in config.h
123
DATADIR_TMP="$datadir"
124
EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
125
AC_SUBST(EXPANDED_DATADIR)
126
AC_DEFINE_UNQUOTED([EXPANDED_DATADIR],"$EXPANDED_DATADIR", [Default data dir])
127
128
dnl set EXPANDED_LIBEXECDIR in config.h
129
LIBEXECDIR_TMP="$libexecdir"
130
EXPANDED_LIBEXECDIR=`eval echo $LIBEXECDIR_TMP`
131
AC_SUBST(EXPANDED_LIBEXECDIR)
132
AC_DEFINE_UNQUOTED([EXPANDED_LIBEXECDIR],"$EXPANDED_LIBEXECDIR", [Location for the webcam binaries])
133
134
PACKAGE_DATA_DIR_TMP="$datadir/${PACKAGE}"
135
PACKAGE_DATA_DIR=`eval echo $PACKAGE_DATA_DIR_TMP`
136
AC_SUBST(PACKAGE_DATA_DIR)
137
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR,"$PACKAGE_DATA_DIR", [Location for package data])
109
138
110
dnl Set PACKAGE_SOURCE_DIR in config.h.
139
dnl Set PACKAGE_SOURCE_DIR in config.h.
111
packagesrcdir=`cd $srcdir && pwd`
140
packagesrcdir=`cd $srcdir && pwd`
112
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
141
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Location for sources])
113
142
114
if test "$enable_pixmaps" != "no"; then
143
if test "$enable_pixmaps" != "no"; then
115
	AC_DEFINE(SHOW_STATUS_PIXMAPS)
144
	AC_DEFINE(SHOW_STATUS_PIXMAPS, [], [Enable status pixmaps])
116
else
145
else
117
    echo "*** status pixmaps disabled"
146
    echo "*** status pixmaps disabled"
118
fi
147
fi
119
148
120
if test "$enable_threads" != "no"; then
149
if test "$enable_threads" != "no"; then
121
	AC_DEFINE(USE_PTHREAD_CREATE)
150
	AC_DEFINE(USE_PTHREAD_CREATE, [], [Enable pthread_create])
122
else
151
else
123
    echo "*** pthread_create disabled"
152
    echo "*** pthread_create disabled"
124
fi
153
fi
125
154
126
if test "x$enable_debug" != "x"; then
155
if test "x$enable_debug" != "x"; then
127
	AC_DEFINE_UNQUOTED(DBG_LEVEL, $enable_debug )
156
	AC_DEFINE_UNQUOTED(DBG_LEVEL, $enable_debug, [Set debug level] )
128
	echo "*** DBG_LEVEL set to ${enable_debug}"
157
	echo "*** DBG_LEVEL set to ${enable_debug}"
129
else
158
else
130
	AC_DEFINE(DBG_LEVEL, 0 )
159
	AC_DEFINE(DBG_LEVEL, 0 )
Lines 132-145 Link Here
132
161
133
if test "x$enable_interface" != "x"; then
162
if test "x$enable_interface" != "x"; then
134
	if test "x$enable_interface" = "xxtext"; then
163
	if test "x$enable_interface" = "xxtext"; then
135
		AC_DEFINE(GYACH_INT_XTEXT)
164
		AC_DEFINE(GYACH_INT_XTEXT, [],
165
		    [text interface set to gtk_xtext widget])
136
		echo "*** gyach text interface set to gtk_xtext widget"
166
		echo "*** gyach text interface set to gtk_xtext widget"
137
	else
167
	else
138
		if test "x$enable_interface" = "xhtml"; then
168
		if test "x$enable_interface" = "xhtml"; then
139
			AC_DEFINE(GYACH_INT_HTML)
169
			AC_DEFINE(GYACH_INT_HTML, [],
170
			    [text interface set to gtk_html widget])
140
			echo "*** gyach text interface set to gtk_html widget"
171
			echo "*** gyach text interface set to gtk_html widget"
141
		else
172
		else
142
			AC_DEFINE(GYACH_INT_TEXT)
173
			AC_DEFINE(GYACH_INT_TEXT, [], 
174
			    [text interface set to gtk_text widget])
143
			echo "*** gyach text interface set to gtk_text widget"
175
			echo "*** gyach text interface set to gtk_text widget"
144
		fi
176
		fi
145
	fi
177
	fi
Lines 158-165 Link Here
158
fi
190
fi
159
changequote([,])dnl
191
changequote([,])dnl
160
192
161
AC_OUTPUT([
193
prefix=$old_prefix
194
exec_prefix=$old_exec_prefix
195
196
AC_CONFIG_FILES([
162
Makefile
197
Makefile
163
src/Makefile
198
src/Makefile
199
src/webcam/Makefile
164
])
200
])
201
AC_OUTPUT
165
202
(-)pyvoice-gyach-1.0.7.orig/gyach/src/Makefile.am (-6 / +37 lines)
Lines 1-11 Link Here
1
## Process this file with automake to produce Makefile.in
1
## Process this file with automake to produce Makefile.in
2
2
3
SUBDIRS = webcam
4
3
INCLUDES = \
5
INCLUDES = \
4
	@GTK_CFLAGS@
6
	@GTHREAD_CFLAGS@ \
7
	@GTKHTML_CFLAGS@ \
8
	@ESOUND_CFLAGS@ \
9
	-DLOCALEDIR=\"$(localedir)\"
5
10
6
bin_PROGRAMS = gyach
11
bin_PROGRAMS = gyache
7
12
8
gyach_SOURCES = \
13
gyache_SOURCES = \
9
	aliases.c aliases.h \
14
	aliases.c aliases.h \
10
	callbacks.c callbacks.h \
15
	callbacks.c callbacks.h \
11
	commands.c commands.h \
16
	commands.c commands.h \
Lines 23-30 Link Here
23
	roomlist.c roomlist.h \
28
	roomlist.c roomlist.h \
24
	users.c users.h \
29
	users.c users.h \
25
	util.c util.h \
30
	util.c util.h \
26
	yahoochat.c yahoochat.h
31
	bootprevent.c bootprevent.h \
27
32
	yahoochat.c yahoochat.h \
33
	ycht.c ycht.h \
34
	profname.c profname.h \
35
	packet_handler.c packet_handler.h \
36
	animations.c animations.h \
37
	conference.c conference.h \
38
	sounds.c sounds.h \
39
	fonts.c fonts.h \
40
	plugin_api.h \
41
	plugins.c plugins.h \
42
	prflang.c prflang.h \
43
	voice_chat.c \
44
	gytreeview.c gytreeview.h \
45
	webconnect.c webconnect.h \
46
	spamcheck.c \
47
	pmwindow.c \
48
	setupwindow2.c \
49
	fader.c \
50
	htmlrender.c \
51
	tuxvironments.c \
52
	yab.c \
53
	webcam.c webcam.h \
54
	trayicon.c trayicon.h \
55
	yahoo_sha.c yahoo_authenticate.h \
56
	sha.c sha.h \
57
	yahoo_fn.c yahoo_fn.h \
58
	roomui.c
28
59
29
gyach_LDADD = @GTK_LIBS@
60
gyache_LDADD = @GTHREAD_LIBS@ @GTKHTML_LIBS@ @ESOUND_LIBS@ @LIBLTDL@
30
61
(-)pyvoice-gyach-1.0.7.orig/gyach/src/webcam/Makefile.am (+14 lines)
Line 0 Link Here
1
libexec_PROGRAMS = gyache-webcam gyache-upload
2
libexec_SCRIPTS = pywebcam.py
3
4
gyache_webcam_SOURCES = main.c gyachewebcam.c gyacheupload.h gyachewebcam.h
5
gyache_upload_SOURCES = gyacheupload-main.c gyacheupload-v4l.c gyacheupload-ui.c ../gytreeview.c ../gytreeview.h gyachewebcam.h
6
7
gyache_webcam_LDADD = @GTK_LIBS@ @JASPER_LIBS@
8
gyache_upload_LDADD = @GTK_LIBS@ @JASPER_LIBS@
9
10
EXTRA_SCRIPTS = pywebcam.py
11
EXTRA_DIST = pywebcam.py
12
13
INCLUDES = $(DEPS_CFLAGS) -DLOCALEDIR=\"$(localedir)\" @GTKHTML_CFLAGS@ -I../
14
#LIBS = $(DEPS_LIBS)
(-)pyvoice-gyach-1.0.7.orig/gyach/src/webcam/gyacheupload-ui.c (-1 / +1 lines)
Lines 48-54 Link Here
48
*/
48
*/
49
49
50
# include "gyacheupload.h"
50
# include "gyacheupload.h"
51
#include "gytreeview.h"
51
#include "../gytreeview.h"
52
# include <jasper/jasper.h>
52
# include <jasper/jasper.h>
53
53
54
#define yahoo_put32(buf, data) ( \
54
#define yahoo_put32(buf, data) ( \
(-)pyvoice-gyach-1.0.7.orig/gyach/src/webcam/gyacheupload-v4l.c (-56 / +215 lines)
Lines 47-53 Link Here
47
	and Copyright (C) 1999-2002, Torrey Searle <tsearle@uci.edu>
47
	and Copyright (C) 1999-2002, Torrey Searle <tsearle@uci.edu>
48
*/
48
*/
49
49
50
# include "gyacheupload.h"
50
#ifdef HAVE_CONFIG_H
51
#  include "config.h"
52
#endif
53
54
#include "gyacheupload.h"
51
55
52
/* ******************************* */
56
/* ******************************* */
53
/*      PATCHES BELOW for webcams with OV519 sensors and 
57
/*      PATCHES BELOW for webcams with OV519 sensors and 
Lines 71-77 Link Here
71
/* Uncomment the line below to enable contributed but UNTESTED patch to support
75
/* Uncomment the line below to enable contributed but UNTESTED patch to support
72
	cameras with OV519 chips - includes double-buffering support */
76
	cameras with OV519 chips - includes double-buffering support */
73
77
74
 /* #define USE_VIDEO_OV519 1  */
78
#define USE_MULTICAM_SUPPORT 1
75
79
76
80
77
/* Uncomment the following definition to enable the use of the
81
/* Uncomment the following definition to enable the use of the
Lines 81-90 Link Here
81
 * modify the definitions of INCLUDE and gyach_LDADD in the Makefile
85
 * modify the definitions of INCLUDE and gyach_LDADD in the Makefile
82
 * to refer to the ccvt source and built libraries.
86
 * to refer to the ccvt source and built libraries.
83
 */
87
 */
84
/* #define USE_CCVT 1 */
85
88
86
#ifdef USE_CCVT
89
/* NC: should be detected automatically from ./configure */
87
#include "ccvt.h"
90
91
/* #define HAVE_LIBCCVT 1 */
92
93
#ifdef HAVE_LIBCCVT
94
#  include "ccvt.h"
88
#endif
95
#endif
89
96
90
int exit_on_error=0;
97
int exit_on_error=0;
Lines 95-101 Link Here
95
 struct video_capability grab_cap;
102
 struct video_capability grab_cap;
96
 struct video_mmap grab_buf;
103
 struct video_mmap grab_buf;
97
104
98
#ifdef USE_VIDEO_OV519
105
#ifdef USE_MULTICAM_SUPPORT
99
static struct video_mbuf mbuf;
106
static struct video_mbuf mbuf;
100
#endif
107
#endif
101
108
Lines 105-123 Link Here
105
 int pnm_size;
112
 int pnm_size;
106
 unsigned char *rgb_buf;
113
 unsigned char *rgb_buf;
107
114
115
static char webcamrc_path[256];
108
extern int app_debugger;
116
extern int app_debugger;
109
117
110
/* Hard-coding my own favorite cam settings into here...
111
    everybody else can update theirs from the config window */
112
113
int fix_color=0;
118
int fix_color=0;
119
int skip_rgb24 = 0;
114
120
115
121
/* #ifdef USE_MULTICAM_SUPPORT
116
#ifdef USE_VIDEO_OV519
117
int hue=32767, contrast=32767, brightness=32767, colour=32767;
122
int hue=32767, contrast=32767, brightness=32767, colour=32767;
118
#else
123
#else */
119
int hue=47104, contrast=65280, brightness=65280, colour=17152;
124
int hue=47104, contrast=65280, brightness=65280, colour=17152;
120
#endif
125
/* #endif */
126
127
#define dir_exists(x) (access((x), R_OK) == 0)
121
128
122
unsigned char* grab_one(int *, int *);
129
unsigned char* grab_one(int *, int *);
123
int grab_init();
130
int grab_init();
Lines 183-195 Link Here
183
	return;
190
	return;
184
	} 
191
	} 
185
192
186
187
#ifdef USE_VIDEO_OV519
188
 current_pixbuf=gdk_pixbuf_new_from_data(grabit,GDK_COLORSPACE_RGB,FALSE,8,x,y,x*grab_pic.depth/8,NULL,NULL);
193
 current_pixbuf=gdk_pixbuf_new_from_data(grabit,GDK_COLORSPACE_RGB,FALSE,8,x,y,x*grab_pic.depth/8,NULL,NULL);
189
#else
190
 current_pixbuf=gdk_pixbuf_new_from_data(grabit,GDK_COLORSPACE_RGB,FALSE,8,320,240,320*grab_pic.depth/8,NULL,NULL);
191
#endif
192
193
194
194
	gtk_image_set_from_pixbuf(GTK_IMAGE(current_image), current_pixbuf);
195
	gtk_image_set_from_pixbuf(GTK_IMAGE(current_image), current_pixbuf);
195
	gdk_pixbuf_unref(current_pixbuf);
196
	gdk_pixbuf_unref(current_pixbuf);
Lines 242-263 Link Here
242
	if (brightness > -1) grab_pic.brightness=brightness;
243
	if (brightness > -1) grab_pic.brightness=brightness;
243
	if (colour > -1) grab_pic.colour=colour;
244
	if (colour > -1) grab_pic.colour=colour;
244
245
245
#ifdef USE_VIDEO_OV519
246
	/* first we try RGB24 */
246
	/* hardcoded... */
247
	grab_pic.depth = 24;
247
	grab_pic.depth = 24;
248
	grab_pic.palette = VIDEO_PALETTE_RGB24;
248
	grab_pic.palette = VIDEO_PALETTE_RGB24;
249
#endif
249
	if (ioctl(grab_fd, VIDIOCSPICT, &grab_pic) < 0 || skip_rgb24) {
250
		/* RGB24 not supported we try YUV420P */
251
		grab_pic.palette = VIDEO_PALETTE_YUV420P;
252
		if (ioctl(grab_fd, VIDIOCSPICT, &grab_pic) < 0) {
253
			/* try other palettes here... */
254
		} else return;
255
	} else return;
250
256
251
	if (ioctl(grab_fd, VIDIOCSPICT, &grab_pic) == -1) {
252
		show_error_dialog("An error occurred at 'ioctl VIDIOCSPICT'.\nCould not set camera properties.");
257
		show_error_dialog("An error occurred at 'ioctl VIDIOCSPICT'.\nCould not set camera properties.");
253
		return; 
254
		}
255
}	
258
}	
256
	
259
	
257
void set_video_device(char *myvdev) {
260
void set_video_device(char *myvdev) {
258
	v_device=strdup(myvdev);
261
	v_device=strdup(myvdev);
259
}
262
}
260
263
264
/* read webcamrc configuration file */
265
void read_webcamrc () {
266
	FILE *f;
267
	char line[256];
268
269
	snprintf(webcamrc_path, sizeof(webcamrc_path), 
270
			 "%s/.yahoorc/gyach/webcamrc", getenv("HOME"));
271
	
272
	if ((f = fopen(webcamrc_path, "r")) == NULL) {
273
		/* noconfig available */
274
		return;
275
	}
276
	while (fgets(line, sizeof(line), f)) {
277
		char *p, *key, *value;
278
		/* strip comments */
279
		if ((p = strchr(line, '#'))) *p = '\0';
280
		if ( (key = strtok(line, "=")) && (value = strtok(NULL, "\n"))) {
281
			if (strcmp(key,"width")==0) 
282
				x = atoi(value);
283
284
			else if (strcmp(key,"height") == 0)
285
				y = atoi(value);
286
287
			else if (strcmp(key, "fix_color") == 0)
288
				fix_color = atoi(value);
289
290
			else if (strcmp(key, "hue") == 0)
291
				hue = atoi(value);
292
293
			else if (strcmp(key, "contrast") == 0)
294
				contrast = atoi(value);
295
296
			else if (strcmp(key, "brightness") == 0)
297
				brightness = atoi(value);
298
299
			else if (strcmp(key, "colour") == 0)
300
				colour = atoi(value);
301
302
			else if (strcmp(key, "skip_rgb24") == 0)
303
				skip_rgb24 = atoi(value);
304
305
		} else {
306
			fprintf(stderr, "Problems in %s\n", webcamrc_path);
307
		}		
308
	}
309
	fclose(f);
310
}
311
312
void write_webcamrc() {
313
	FILE *f;
314
	
315
	/* create ~/.yahoorc/gyach dir if it does not exist (it should) */
316
	snprintf(webcamrc_path, sizeof(webcamrc_path), "%s/.yahoorc", 
317
			 getenv("HOME"));
318
	if (!dir_exists(webcamrc_path))
319
		mkdir(webcamrc_path, 0700);
320
321
	snprintf(webcamrc_path, sizeof(webcamrc_path), "%s/.yahoorc/gyach", 
322
			 getenv("HOME"));
323
	if (!dir_exists(webcamrc_path))
324
		mkdir(webcamrc_path, 0700);
325
326
	snprintf(webcamrc_path, sizeof(webcamrc_path), 
327
			 "%s/.yahoorc/gyach/webcamrc", getenv("HOME"));
328
329
	if ((f = fopen(webcamrc_path, "w")) == NULL) {
330
		fprintf(stderr, "Problems when writing configuration to %s\n",
331
				webcamrc_path);
332
		return;
333
	}
334
	fprintf(f, "width=%i\n"
335
			"height=%i\n"
336
			"fix_color=%i\n"
337
			"hue=%i\n"
338
			"contrast=%i\n"
339
			"brightness=%i\n"
340
			"colour=%i\n"
341
			"skip_rgb24=%i\n",
342
			x, y, fix_color, hue, contrast, brightness, colour, skip_rgb24);
343
	fclose(f);
344
}
345
346
261
void init_cam () {
347
void init_cam () {
262
	signal (SIGINT, _sighandler);
348
	signal (SIGINT, _sighandler);
263
	if (!v_device) {
349
	if (!v_device) {
Lines 268-279 Link Here
268
			show_error_dialog("No Video4Linux device was specified.");
354
			show_error_dialog("No Video4Linux device was specified.");
269
			return;
355
			return;
270
			}
356
			}
357
	read_webcamrc();
271
	grab_init();
358
	grab_init();
272
	set_picture();
359
	set_picture();
273
}
360
}
274
361
275
362
276
#ifdef USE_VIDEO_OV519
363
#ifdef USE_MULTICAM_SUPPORT
277
int grab_init() {
364
int grab_init() {
278
        if ((grab_fd = open(v_device,O_RDWR)) == -1 ) {
365
        if ((grab_fd = open(v_device,O_RDWR)) == -1 ) {
279
		show_error_dialog("Could not open Video4Linux device.\nThe device may already be in use.");
366
		show_error_dialog("Could not open Video4Linux device.\nThe device may already be in use.");
Lines 283-315 Link Here
283
		show_error_dialog("An error occurred at 'ioctl VIDIOCGCAP'.\nWrong device.");
370
		show_error_dialog("An error occurred at 'ioctl VIDIOCGCAP'.\nWrong device.");
284
		return 0; 
371
		return 0; 
285
		}
372
		}
373
	if (!(grab_cap.type & VID_TYPE_CAPTURE)) {
374
        show_error_dialog("Fatal: grab device does not handle capture\n");
375
		return 0;
376
    }
377
286
	memset (&grab_pic, 0, sizeof(struct video_picture));
378
	memset (&grab_pic, 0, sizeof(struct video_picture));
287
	snprintf(webcam_description, 3, "%s",  "");
379
	memset(webcam_description, '\0', sizeof(webcam_description));
288
	strncpy(webcam_description, grab_cap.name ,28);
380
	snprintf(webcam_description, sizeof(webcam_description), "%s %s",
289
	strcat(webcam_description, " V4L1");
381
			 grab_cap.name, " V4L1");
382
290
	if (ioctl (grab_fd, VIDIOCGPICT, &grab_pic) == -1) {
383
	if (ioctl (grab_fd, VIDIOCGPICT, &grab_pic) == -1) {
291
		show_error_dialog("An error occurred at 'ioctl VIDIOCGPICT'.");
384
		show_error_dialog("An error occurred at 'ioctl VIDIOCGPICT'.");
292
		return 0; 
385
		return 0; 
293
		}
386
		}
294
	
387
	
295
296
	/* The line below cannot work: we must force use of RGB24 for 
297
	    PNM image creation */
298
	/* grab_buf.format=grab_pic.palette; */ 
299
300
	/* A V4L device supporting the VIDEO_PALETTE_RGB24
301
	   ( 24bit RGB) color palette is REQUIRED, Gdk-Pixbuf 
302
	   can only handle RGB Color spaces, so no support for 
303
	   greyscale palettes or cams using non-standard, weirdo palettes 
304
	   at this time */
305
306
	grab_buf.format = VIDEO_PALETTE_RGB24;
307
	grab_buf.frame  = 0;
308
	grab_buf.width  = x;
309
	grab_buf.height = y;
310
	grab_size = x * y * w;
311
	set_picture();
312
313
	if (ioctl (grab_fd, VIDIOCGMBUF, &mbuf) < 0) {
388
	if (ioctl (grab_fd, VIDIOCGMBUF, &mbuf) < 0) {
314
		show_error_dialog("An error occurred at 'ioctl VIDIOCGMBUF'.");
389
		show_error_dialog("An error occurred at 'ioctl VIDIOCGMBUF'.");
315
		return 0; 
390
		return 0; 
Lines 322-334 Link Here
322
		return 0;
397
		return 0;
323
	}
398
	}
324
399
400
	grab_buf.frame  = 0;
401
	grab_buf.width  = x;
402
	grab_buf.height = y;
403
	grab_size = x * y * w;
404
	set_picture();
405
325
	/* grab first frame */
406
	/* grab first frame */
407
	grab_buf.format = VIDEO_PALETTE_RGB24;
408
	if (ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf) <0 || skip_rgb24) {
409
		printf("grabbing rgb24 failed\n");
410
		/* some cam's don't support grabbing RBG24. try YUV420P */
411
		grab_buf.format = VIDEO_PALETTE_YUV420P;
412
		if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) {
413
#ifdef HAVE_LIBCCVT			
414
			/* try YUV422 before we give up if we have CCVT */
415
			/*			grab_buf.format = VIDEO_PALETTE_YUV422;
326
	if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) {
416
	if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) {
327
		show_error_dialog("An error occurred at 'ioctl VIDIOCMCAPTURE'.");
417
		show_error_dialog("An error occurred at 'ioctl VIDIOCMCAPTURE'.");
328
		return 0; 
418
		return 0; 
329
	}
419
	}
330
	if (mbuf.frames > 1) grab_buf.frame = 1 - grab_buf.frame;
420
			*/
331
421
#else
422
			show_error_dialog("An error occurred at 'ioctl VIDIOCMCAPTURE'.");
423
			return 0; 
424
#endif
425
		}
426
	}
427
	grab_buf.frame +=1;
428
	if (grab_buf.frame >= mbuf.frames) grab_buf.frame = 0;
429
	init_pnm_buf();
332
	return(1);
430
	return(1);
333
	}
431
	}
334
432
Lines 384-392 Link Here
384
	brightness=tbrightness;
482
	brightness=tbrightness;
385
	fix_color=tfc;
483
	fix_color=tfc;
386
	set_picture();
484
	set_picture();
485
	write_webcamrc();
387
}
486
}
388
487
389
#ifndef USE_CCVT
488
#ifndef HAVE_LIBCCVT
390
489
391
/* The following conversion routines were taken from drivers/usb/ov511.c
490
/* The following conversion routines were taken from drivers/usb/ov511.c
392
 * in the Mandrake Linux 2.4.21 kernel.
491
 * in the Mandrake Linux 2.4.21 kernel.
Lines 495-507 Link Here
495
	}
594
	}
496
}
595
}
497
596
498
#endif	/* !USE_CCVT */
597
#endif	/* !HAVE_LIBCCVT */
499
598
500
599
501
600
502
#ifdef USE_VIDEO_OV519
601
#ifdef USE_MULTICAM_SUPPORT
503
602
504
unsigned char* grab_one(int *width, int *height) {
603
unsigned char* grab_one(int *width, int *height) {
604
	char *frame_buf;
505
	set_picture();
605
	set_picture();
506
606
507
		if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) {
607
		if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) {
Lines 509-523 Link Here
509
			return NULL; 
609
			return NULL; 
510
	}
610
	}
511
611
512
	if (mbuf.frames > 1) grab_buf.frame = 1 - grab_buf.frame;
612
	/* switch frame if cam support double buf */
613
	grab_buf.frame +=1;
614
	if (grab_buf.frame >= mbuf.frames) grab_buf.frame = 0;
615
	//	if (mbuf.frames > 1) grab_buf.frame = 1 - grab_buf.frame;
513
				if (-1 == ioctl(grab_fd,VIDIOCSYNC,&grab_buf)) {
616
				if (-1 == ioctl(grab_fd,VIDIOCSYNC,&grab_buf)) {
514
					show_error_dialog("An error occurred at 'ioctl VIDIOCSYNC'.");
617
					show_error_dialog("An error occurred at 'ioctl VIDIOCSYNC'.");
515
					return NULL; 
618
					return NULL; 
516
	}
619
	}
517
	if (fix_color) {fix_colour(grab_data + mbuf.offsets[grab_buf.frame], x, y); }
620
621
	frame_buf = grab_data + mbuf.offsets[grab_buf.frame];
518
				 	*width  = grab_buf.width;
622
				 	*width  = grab_buf.width;
519
				 	*height = grab_buf.height;
623
				 	*height = grab_buf.height;
520
	return grab_data + mbuf.offsets[grab_buf.frame];
624
625
#ifdef HAVE_LIBCCVT
626
	switch (grab_buf.format) {
627
		/* if we have ccvt we must check the yuyv converting also */
628
629
		/*
630
	case VIDEO_PALETTE_YUV422: {
631
		if (fix_color) 
632
			ccvt_yuyv_bgr24(*width,	*height, frame_buf,	rgb_buf);
633
		else 
634
			ccvt_yuyv_rgb24(*width,	*height, frame_buf,	rgb_buf);
635
		break;
636
	}
637
		*/
638
	case VIDEO_PALETTE_YUV420P: {
639
		/* let ccvt do the bgr->rgb convertion */
640
		if (fix_color) 
641
			ccvt_420p_bgr24(*width,	*height, frame_buf,	rgb_buf);
642
		else 
643
			ccvt_420p_rgb24(*width,	*height, frame_buf, rgb_buf);
644
		return rgb_buf;
645
	}
646
647
	case VIDEO_PALETTE_RGB24: {
648
		if (fix_color) fix_colour(frame_buf, x, y); 
649
		return frame_buf;
650
	}
651
	default: {
652
		printf("oups...\n");
653
		return NULL;
654
	}
655
	} /* switch */
656
657
#else /* HAVE_LIBCCVT */
658
659
	switch (grab_buf.format) {
660
	case VIDEO_PALETTE_YUV420P: {
661
		yuv420p_to_rgb(frame_buf, rgb_buf, 24);
662
		if (fix_color) fix_colour(rgb_buf, x, y); 
663
		break;
664
	}
665
	case VIDEO_PALETTE_RGB24: {
666
		if (fix_color) fix_colour(frame_buf, x, y); 
667
		return frame_buf;
668
	}
669
	default: {
670
		printf("oups...\n");
671
		return NULL;
672
	}
673
674
	} /* switch */
675
676
#endif /* HAVE_LIBCCVT */
677
678
	return rgb_buf;
521
}
679
}
522
680
523
#else
681
#else
Lines 529-534 Link Here
529
	set_picture();
687
	set_picture();
530
688
531
	for (;;) {
689
	for (;;) {
690
		grab_buf.format = VIDEO_PALETTE_RGB24;
532
		ret = ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf);
691
		ret = ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf);
533
		if (ret == -1) {
692
		if (ret == -1) {
534
			/* Some drivers (such as pwc) don't support capturing
693
			/* Some drivers (such as pwc) don't support capturing
Lines 553-559 Link Here
553
				*height = grab_buf.height;
712
				*height = grab_buf.height;
554
				if (grab_buf.format == VIDEO_PALETTE_YUV420P) {
713
				if (grab_buf.format == VIDEO_PALETTE_YUV420P) {
555
					/* Convert from YUV420P to RGB24. */
714
					/* Convert from YUV420P to RGB24. */
556
#ifdef USE_CCVT
715
#ifdef HAVE_LIBCCVT
557
					ccvt_420p_rgb24(grab_buf.width,
716
					ccvt_420p_rgb24(grab_buf.width,
558
							grab_buf.height,
717
							grab_buf.height,
559
							grab_data,
718
							grab_data,
(-)pyvoice-gyach-1.0.7.orig/gyach/src/webcam.c (-9 / +9 lines)
Lines 98-104 Link Here
98
			launcher=malloc(256);
98
			launcher=malloc(256);
99
			if (!launcher) {return ;}
99
			if (!launcher) {return ;}
100
100
101
			snprintf(launcher,254, "%s/webcam/gyache-upload", PACKAGE_DATA_DIR); 
101
			snprintf(launcher,254,  EXPANDED_LIBEXECDIR "/gyache-upload"); 
102
102
103
			if ( stat( launcher, &sbuf ))  {
103
			if ( stat( launcher, &sbuf ))  {
104
				char wmsg[304];
104
				char wmsg[304];
Lines 118-125 Link Here
118
			launcher=malloc(10642);
118
			launcher=malloc(10642);
119
			if (!launcher) { free(myfriends); return ;}
119
			if (!launcher) { free(myfriends); return ;}
120
120
121
			snprintf(launcher,10640, "%s/webcam/gyache-upload \"%s\" \"%s\" \"%s\"  \"%s\" &",
121
			snprintf(launcher,10640, EXPANDED_LIBEXECDIR "/gyache-upload \"%s\" \"%s\" \"%s\"  \"%s\" &",
122
			PACKAGE_DATA_DIR, get_default_profile_name(), key, webcam_device , myfriends
122
			get_default_profile_name(), key, webcam_device , myfriends
123
			); 
123
			); 
124
124
125
			my_system(launcher);
125
			my_system(launcher);
Lines 143-151 Link Here
143
143
144
			/* C-based cam viewer */
144
			/* C-based cam viewer */
145
		if (! launchertype) { 
145
		if (! launchertype) { 
146
		snprintf(launcher,250, "%s/webcam/gyache-webcam", PACKAGE_DATA_DIR); 
146
		snprintf(launcher,250, EXPANDED_LIBEXECDIR "/gyache-webcam"); 
147
									} else {   /* Python-based viewer */
147
									} else {   /* Python-based viewer */
148
		snprintf(launcher,250, "%s/webcam/pywebcam.py", PACKAGE_DATA_DIR); 
148
		snprintf(launcher,250, EXPANDED_LIBEXECDIR "/pywebcam.py"); 
149
											  }
149
											  }
150
150
151
		if ( stat( launcher, &sbuf ))  {
151
		if ( stat( launcher, &sbuf ))  {
Lines 157-168 Link Here
157
157
158
158
159
		if (! launchertype) {  /* C-based viewer */
159
		if (! launchertype) {  /* C-based viewer */
160
		snprintf(launcher,382, "%s/webcam/gyache-webcam \"%s\" \"%s\" \"%s\" &",
160
		snprintf(launcher,382, EXPANDED_LIBEXECDIR "/gyache-webcam \"%s\" \"%s\" \"%s\" &",
161
		PACKAGE_DATA_DIR, lastcamwho, get_default_profile_name(), key
161
		lastcamwho, get_default_profile_name(), key
162
		); 
162
		); 
163
									} else { /* Python-based viewer */
163
									} else { /* Python-based viewer */
164
		snprintf(launcher,382, "python %s/webcam/pywebcam.py \"%s\" \"%s\" \"%s\" &",
164
		snprintf(launcher,382, "python " EXPANDED_LIBEXECDIR "/pywebcam.py \"%s\" \"%s\" \"%s\" &",
165
		PACKAGE_DATA_DIR, lastcamwho, get_default_profile_name(), key
165
		lastcamwho, get_default_profile_name(), key
166
		); 
166
		); 
167
											 }
167
											 }
168
168
(-)pyvoice-gyach-1.0.7.orig/setup.py (+26 lines)
Line 0 Link Here
1
#~/usr/bin/env python
2
3
from distutils.core import setup, Extension
4
5
setup(name="pyvoice",
6
	version="0.9",
7
	ext_modules=[Extension('pyesd', ['pytsp/pyesd.c','pytsp/pyesd.i'],
8
			library_dirs=['/usr/lib64'],
9
			libraries=['esd', 
10
				   'audiofile', 
11
				   'm', 
12
				   'asound'
13
				   ]
14
			),
15
		Extension('pytsp',['pytsp/pytruespeech.c','pytsp/pytsp.i'],
16
		library_dirs=['/usr/lib64'],
17
		libraries=['esd', 
18
			   'audiofile', 
19
			   'm', 
20
			   'asound'
21
			   ]
22
			)
23
		],
24
	package_dir = {"":"pyvoice"},
25
	py_modules=["pyvoice","pyvoiceui"]
26
	)

Return to bug 76127