[Pkg-spca5xx-devel] r232 - in /spcaview/branches/upstream/current: Changelog README http-java-applet/ jconfig.h picture.c spcav4l.c spcav4l.h spcaview.c tcputils.h utils.c version.h
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Wed Jan 2 07:38:49 UTC 2008
Author: kelmo-guest
Date: Wed Jan 2 07:38:49 2008
New Revision: 232
URL: http://svn.debian.org/wsvn/?sc=1&rev=232
Log:
[svn-upgrade] Integrating new upstream version, spcaview (20071224.dfsg)
Removed:
spcaview/branches/upstream/current/http-java-applet/
Modified:
spcaview/branches/upstream/current/Changelog
spcaview/branches/upstream/current/README
spcaview/branches/upstream/current/jconfig.h
spcaview/branches/upstream/current/picture.c
spcaview/branches/upstream/current/spcav4l.c
spcaview/branches/upstream/current/spcav4l.h
spcaview/branches/upstream/current/spcaview.c
spcaview/branches/upstream/current/tcputils.h
spcaview/branches/upstream/current/utils.c
spcaview/branches/upstream/current/version.h
Modified: spcaview/branches/upstream/current/Changelog
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/Changelog?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/Changelog (original)
+++ spcaview/branches/upstream/current/Changelog Wed Jan 2 07:38:49 2008
@@ -1,4 +1,14 @@
/************* Changelog spcaview *****************/
+06/11/2006:
+version 1.1.8
+ Add bridge pac7311 pac207 vc0321 vc0323
+06/11/2006:
+version 1.1.7
+ FIX broken s key feature !! Who know it was broken ??
+ FIX 160x120 jpeg decoder for 422 stream
+28/08/2006:
+version 1.1.6
+ Add Flicker filters 50Hz 60Hz No flickers Thanks Serge A. Suchkov
10/12/2005:
version 1.1.5rc2
Add ioctl to spcav4l.c spcav4l.h
Modified: spcaview/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/README?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/README (original)
+++ spcaview/branches/upstream/current/README Wed Jan 2 07:38:49 2008
@@ -132,6 +132,7 @@
key w contrast down
key s screenshoot
key j autoexposure ON/OFF (with some webcams)
+ key l Flicker filter 50/60/No
key h frame rate down
key g frame rate up
key d quality up (with some webcams)
Modified: spcaview/branches/upstream/current/jconfig.h
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/jconfig.h?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/jconfig.h (original)
+++ spcaview/branches/upstream/current/jconfig.h Wed Jan 2 07:38:49 2008
@@ -8,15 +8,19 @@
#define VIDEO_PALETTE_JPEG 21
#define SWAP_RGB 1
int bpp;
+/* our own ioctl */
struct video_param {
int chg_para;
#define CHGABRIGHT 1
#define CHGQUALITY 2
+#define CHGLIGHTFREQ 3
#define CHGTINTER 4
__u8 autobright;
__u8 quality;
__u16 time_interval;
-};
+ __u8 light_freq;
+};
+
/* Our private ioctl */
#define SPCAGVIDIOPARAM _IOR('v',BASE_VIDIOCPRIVATE + 1,struct video_param)
#define SPCASVIDIOPARAM _IOW('v',BASE_VIDIOCPRIVATE + 2,struct video_param)
@@ -29,8 +33,9 @@
YUYV,
GREY,
GBRG,
-};
-
+ UNOW,
+};
+#if 0
#define BRIDGE_SPCA505 0
#define BRIDGE_SPCA506 1
#define BRIDGE_SPCA501 2
@@ -52,6 +57,34 @@
#define BRIDGE_MR97311 18
#define MAX_BRIDGE 19
+#endif
+
+enum {
+ BRIDGE_SPCA505 = 0,
+ BRIDGE_SPCA506,
+ BRIDGE_SPCA501,
+ BRIDGE_SPCA508,
+ BRIDGE_SPCA504,
+ BRIDGE_SPCA500,
+ BRIDGE_SPCA504B,
+ BRIDGE_SPCA533,
+ BRIDGE_SPCA504C,
+ BRIDGE_SPCA561,
+ BRIDGE_SPCA536,
+ BRIDGE_SONIX,
+ BRIDGE_ZC3XX,
+ BRIDGE_CX11646,
+ BRIDGE_TV8532,
+ BRIDGE_ETOMS,
+ BRIDGE_SN9CXXX,
+ BRIDGE_MR97311,
+ BRIDGE_PAC207,
+ BRIDGE_VC0321,
+ BRIDGE_VC0323,
+ BRIDGE_PAC7311,
+ BRIDGE_UNKNOW,
+ MAX_BRIDGE,
+};
struct palette_list {
int num;
const char *name;
@@ -61,7 +94,7 @@
int num;
const char *name;
};
-
+#if 0
static struct bridge_list Blist[]={
{BRIDGE_SPCA505,"SPCA505"},
@@ -85,6 +118,35 @@
{BRIDGE_MR97311,"MR97311"},
{-1,NULL}
};
+#endif
+
+static struct bridge_list Blist[]={
+
+ {BRIDGE_SPCA505,"SPCA505"},
+ {BRIDGE_SPCA506,"SPCA506"},
+ {BRIDGE_SPCA501,"SPCA501"},
+ {BRIDGE_SPCA508,"SPCA508"},
+ {BRIDGE_SPCA504,"SPCA504"},
+ {BRIDGE_SPCA500,"SPCA500"},
+ {BRIDGE_SPCA504B,"SPCA504B"},
+ {BRIDGE_SPCA533,"SPCA533"},
+ {BRIDGE_SPCA504C,"SPCA504C"},
+ {BRIDGE_SPCA561,"SPCA561"},
+ {BRIDGE_SPCA536,"SPCA536"},
+ {BRIDGE_SONIX,"SN9C102"},
+ {BRIDGE_ZC3XX,"ZC301-2"},
+ {BRIDGE_CX11646,"CX11646"},
+ {BRIDGE_TV8532,"TV8532"},
+ {BRIDGE_ETOMS,"ET61XX51"},
+ {BRIDGE_SN9CXXX,"SN9CXXX"},
+ {BRIDGE_MR97311,"MR97311"},
+ {BRIDGE_PAC207, "PAC207BCA"},
+ {BRIDGE_VC0321, "VC0321"},
+ {BRIDGE_VC0323, "VC0323"},
+ {BRIDGE_PAC7311, "PAC7311"},
+ {BRIDGE_UNKNOW,"UNKNOW"},
+ {-1,NULL}
+};
/* Camera type jpeg yuvy yyuv yuyv grey gbrg*/
static struct palette_list Plist[] ={
{JPEG,"JPEG"},
@@ -108,7 +170,6 @@
(bridge) == BRIDGE_SPCA561 ? spca561_ext_modes : \
(bridge) == BRIDGE_SPCA536 ? spca536_ext_modes : \
(bridge) == BRIDGE_SONIX ? sonix_ext_modes : \
- (bridge) == BRIDGE_ZR364XX ? zr364xx_ext_modes : \
(bridge) == BRIDGE_ZC3XX ? zc3xx_ext_modes : \
(bridge) == BRIDGE_CX11646 ? cx11646_ext_modes : \
(bridge) == BRIDGE_SN9CXXX ? sn9c102p_ext_modes : \
Modified: spcaview/branches/upstream/current/picture.c
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/picture.c?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/picture.c (original)
+++ spcaview/branches/upstream/current/picture.c Wed Jan 2 07:38:49 2008
@@ -76,18 +76,18 @@
if(mode == PICTWRD)
snprintf(filename,13,"%s",name);
if (mode == PICTURE || mode == PICTWRD){
- foutpict = fopen (filename, "wb");
+ foutpict = fopen (filename, "wb");
}
if (format == VIDEO_PALETTE_JPEG)
{
sizeout = get_jpegsize( src,sizein);
if (mode == PICTURE || mode == PICTWRD){
- printf (" picture jpeg %s\n", filename);
- fwrite (src, sizeof (char), sizeout, foutpict);
- fclose (foutpict);
+ printf (" picture jpeg %s\n", filename);
+ fwrite (src, sizeof (char), sizeout, foutpict);
+ fclose (foutpict);
} else {
if(AVI_write_frame ( fd,(unsigned char *) src,sizeout) < 0)
- printf ("write error on avi out \n");
+ printf ("GetjpegPicture write error on avi out \n");
}
}
else
Modified: spcaview/branches/upstream/current/spcav4l.c
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/spcav4l.c?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/spcav4l.c (original)
+++ spcaview/branches/upstream/current/spcav4l.c Wed Jan 2 07:38:49 2008
@@ -45,13 +45,16 @@
{BRIDGE_SPCA561,"SPCA561"},
{BRIDGE_SPCA536,"SPCA536"},
{BRIDGE_SONIX,"SN9C102"},
- {BRIDGE_ZR364XX,"ZR364XX"},
{BRIDGE_ZC3XX,"ZC301-2"},
{BRIDGE_CX11646,"CX11646"},
{BRIDGE_TV8532,"TV8532"},
{BRIDGE_ETOMS,"ET61XX51"},
{BRIDGE_SN9CXXX,"SN9CXXX"},
{BRIDGE_MR97311,"MR97311"},
+ {BRIDGE_PAC207, "PAC207BCA"},
+ {BRIDGE_VC0321, "VC0321"},
+ {BRIDGE_VC0323, "VC0323"},
+ {BRIDGE_PAC7311, "PAC7311"},
{BRIDGE_UNKNOW,"UNKNOW"},
{-1,NULL}
};
@@ -823,7 +826,7 @@
for (i = 0; i < MAX_BRIDGE -1; i++)
{
size = strlen (Blist[i].name) ;
- printf ("is_spca %s \n",Blist[i].name);
+ // printf ("is_spca %s \n",Blist[i].name);
if (strncmp (BridgeName, Blist[i].name, size) == 0)
{
find = i;
@@ -852,6 +855,7 @@
i = YYUV;
break;
case BRIDGE_SPCA501:
+ case BRIDGE_VC0321:
i = YUYV;
break;
case BRIDGE_SPCA508:
@@ -863,17 +867,19 @@
case BRIDGE_SPCA504B:
case BRIDGE_SPCA533:
case BRIDGE_SPCA504C:
- case BRIDGE_ZR364XX:
case BRIDGE_ZC3XX:
case BRIDGE_CX11646:
case BRIDGE_SN9CXXX:
- case BRIDGE_MR97311:
+ case BRIDGE_MR97311:
+ case BRIDGE_VC0323:
+ case BRIDGE_PAC7311:
i = JPEG;
break;
case BRIDGE_ETOMS:
case BRIDGE_SONIX:
case BRIDGE_SPCA561:
case BRIDGE_TV8532:
+ case BRIDGE_PAC207:
i = GBRG;
break;
default:
Modified: spcaview/branches/upstream/current/spcav4l.h
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/spcav4l.h?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/spcav4l.h (original)
+++ spcaview/branches/upstream/current/spcav4l.h Wed Jan 2 07:38:49 2008
@@ -93,13 +93,16 @@
BRIDGE_SPCA561,
BRIDGE_SPCA536,
BRIDGE_SONIX,
- BRIDGE_ZR364XX,
BRIDGE_ZC3XX,
BRIDGE_CX11646,
BRIDGE_TV8532,
BRIDGE_ETOMS,
BRIDGE_SN9CXXX,
BRIDGE_MR97311,
+ BRIDGE_PAC207,
+ BRIDGE_VC0321,
+ BRIDGE_VC0323,
+ BRIDGE_PAC7311,
BRIDGE_UNKNOW,
MAX_BRIDGE,
};
Modified: spcaview/branches/upstream/current/spcaview.c
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/spcaview.c?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/spcaview.c (original)
+++ spcaview/branches/upstream/current/spcaview.c Wed Jan 2 07:38:49 2008
@@ -239,7 +239,7 @@
status = pthread_mutex_unlock (&mypict->mutex);
if (status != 0) {fprintf(stderr,"Unlock error!\n"); exit(-1);}
/******* EXIT the MONITOR ************/
-// printf("Condition was accept, data.value=%d\n",pictFlag);
+//printf("Condition was accept, data.value=%d\n",pictFlag);
}
return NULL;
@@ -1265,6 +1265,40 @@
spcaPrintParam (fd,videoparam);
}
+
+static void spcaSetLightFrequency(int fd, struct video_param * videoparam, int light_freq)
+{
+ videoparam->chg_para = CHGLIGHTFREQ;
+ videoparam->light_freq = light_freq;
+ if(ioctl(fd,SPCASVIDIOPARAM, videoparam) == -1){
+ printf ("light freqency error !!\n");
+ } else
+ spcaPrintParam (fd,videoparam);
+}
+
+static int spcaSwitchLightFrequency(int fd, struct video_param * videoparam)
+{
+ int light_freq;
+ if(ioctl(fd,SPCAGVIDIOPARAM, videoparam) == -1){
+ printf ("wrong spca5xx device\n");
+ } else {
+ light_freq = videoparam->light_freq;
+ if(light_freq == 50)
+ light_freq +=10;
+ else if(light_freq == 60)
+ light_freq = 0;
+ else if(light_freq == 0)
+ light_freq = 50;
+ if(light_freq)
+ printf ("Current light frequency filter: %d Hz\n", light_freq);
+ else
+ printf ("Current light frequency filter: NoFliker\n");
+ spcaSetLightFrequency(fd,videoparam,light_freq);
+ }
+ return light_freq;
+}
+
+
static void spcaSetTimeInterval(int fd, struct video_param *videoparam, unsigned short time)
{
if (time < 1000) {
@@ -1293,8 +1327,8 @@
if(ioctl(fd,SPCAGVIDIOPARAM, videoparam) == -1){
printf ("wrong spca5xx device\n");
} else
- printf("quality %d autoexpo %d Timeframe %d \n",
- videoparam->quality,videoparam->autobright,videoparam->time_interval);
+ printf("quality %d autoexpo %d Timeframe %d lightfreq %d\n",
+ videoparam->quality,videoparam->autobright,videoparam->time_interval, videoparam->light_freq);
}
static void qualityUp(int fd,struct video_param *videoparam)
{
@@ -1639,7 +1673,9 @@
// SDL_PauseAudioIn(0); // start record
initAudio = 1;
}
- }
+ } else
+ mypict.mode = PICTURE;
+
/* Allocate tmp buffer for one frame. */
@@ -1660,16 +1696,8 @@
if (interval && videoOn){
// set_timer(interval);
- /* allocate the buffer for photos */
-
- if (outputfile) {
- mypict.mode = AVIPICT;
- } else {
- mypict.mode = PICTURE;
- }
-
SDL_SetTimer((Uint32) interval,callback_timer);
- }
+ }
i = 0;
while (run && Oneshoot) {
@@ -1715,6 +1743,7 @@
synctime = SDL_GetTicks ();
/*here the frame is in tmp ready to used */
if (pictFlag){
+ // printf("get Picture condition \n");
wstatus = pthread_mutex_lock (&mypict.mutex);
if (wstatus != 0) {fprintf(stderr,"Lock error!\n"); exit(-1);}
memcpy (mypict.data,tmp,frame_size);
@@ -1883,6 +1912,7 @@
case SDLK_s:
/* should get the next frame available */
pictFlag = 1;
+ printf ("\nPicture asked\n");
break;
case SDLK_v:
videopict.colour += 0x200; // = saturation ?
@@ -1919,6 +1949,9 @@
case SDLK_f:
qualityDown(fd, &videoparam); //decrease quality
break;
+ case SDLK_l:
+ spcaSwitchLightFrequency(fd, &videoparam); //switch light frequency filter
+ break;
case SDLK_q:
printf ("\nStop asked\n");
run = 0;
@@ -2221,7 +2254,7 @@
resize16 (pict,dst,owidth,oheight,width,height) ;
free(dst);
}
-
+#if 0
static int
isSpcaChip (const char *BridgeName)
{
@@ -2268,7 +2301,7 @@
case BRIDGE_SPCA533:
case BRIDGE_SPCA504C:
case BRIDGE_SPCA536:
- case BRIDGE_ZR364XX:
+// case BRIDGE_ZR364XX:
case BRIDGE_ZC3XX:
case BRIDGE_CX11646:
case BRIDGE_SN9CXXX:
@@ -2289,7 +2322,85 @@
}
return i;
}
-
+ #endif
+ static int
+isSpcaChip (const char *BridgeName)
+{
+ int i = -1;
+ int find = -1;
+ int size = 0;
+
+ /* Spca506 return more with channel video, cut it */
+
+ /* return Bridge otherwhise -1 */
+ for (i = 0; i < MAX_BRIDGE -1; i++)
+ {
+ size = strlen (Blist[i].name) ;
+ // printf ("is_spca %s \n",Blist[i].name);
+ if (strncmp (BridgeName, Blist[i].name, size) == 0)
+ {
+ find = i;
+ break;
+ }
+ }
+
+ return find;
+}
+
+static int
+getStreamId (const char *BridgeName)
+{
+ int i = -1;
+ int match = -1;
+/* return Stream_id otherwhise -1 */
+ if ((match = isSpcaChip (BridgeName)) < 0)
+ {
+ printf ("Not an Spca5xx Camera !!\n");
+ return match;
+ }
+ switch (match)
+ {
+ case BRIDGE_SPCA505:
+ case BRIDGE_SPCA506:
+ i = YYUV;
+ break;
+ case BRIDGE_SPCA501:
+ case BRIDGE_VC0321:
+ i = YUYV;
+ break;
+ case BRIDGE_SPCA508:
+ i = YUVY;
+ break;
+ case BRIDGE_SPCA536:
+ case BRIDGE_SPCA504:
+ case BRIDGE_SPCA500:
+ case BRIDGE_SPCA504B:
+ case BRIDGE_SPCA533:
+ case BRIDGE_SPCA504C:
+ case BRIDGE_ZC3XX:
+ case BRIDGE_CX11646:
+ case BRIDGE_SN9CXXX:
+ case BRIDGE_MR97311:
+ case BRIDGE_VC0323:
+ case BRIDGE_PAC7311:
+ i = JPEG;
+ break;
+ case BRIDGE_ETOMS:
+ case BRIDGE_SONIX:
+ case BRIDGE_SPCA561:
+ case BRIDGE_TV8532:
+ case BRIDGE_PAC207:
+ i = GBRG;
+ break;
+ default:
+ i = UNOW; // -1;
+ printf ("Unable to find a StreamId !!\n");
+ break;
+
+ }
+ return i;
+}
+
static int
probeSize (const char *BridgeName, int *width, int *height)
{ int bridge = -1;
Modified: spcaview/branches/upstream/current/tcputils.h
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/tcputils.h?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/tcputils.h (original)
+++ spcaview/branches/upstream/current/tcputils.h Wed Jan 2 07:38:49 2008
@@ -23,7 +23,7 @@
#ifndef TCPUTILS_H
#define TCPUTILS_H
-
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
Modified: spcaview/branches/upstream/current/utils.c
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/utils.c?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/utils.c (original)
+++ spcaview/branches/upstream/current/utils.c Wed Jan 2 07:38:49 2008
@@ -560,8 +560,8 @@
intheight = getword();
intwidth = getword();
- if ((intheight & 15) || (intwidth & 15)){
-
+ //if ((intheight & 15) || (intwidth & 15)){
+ if ((intheight & 7) || (intwidth & 15)){
err = ERR_BAD_WIDTH_OR_HEIGHT;
goto error;
}
Modified: spcaview/branches/upstream/current/version.h
URL: http://svn.debian.org/wsvn/spcaview/branches/upstream/current/version.h?rev=232&op=diff
==============================================================================
--- spcaview/branches/upstream/current/version.h (original)
+++ spcaview/branches/upstream/current/version.h Wed Jan 2 07:38:49 2008
@@ -1,2 +1,2 @@
- char version[] = "Spcaview version: 1.1.5 date: 12:12:2005 (C) mxhaard at magic.fr\0";
+ char version[] = "Spcaview version: 1.1.8 date: 25:12:2007 (C) mxhaard at magic.fr\0";
More information about the Pkg-spca5xx-devel
mailing list