Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoLinux1394Cam
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv15899/lib/SRC/VideoLinux1394Cam
Modified Files:
video.c
Log Message:
Rather than hard coding config strings into each test application, we will
now be moving towards putting defaults into each video module and then just
overriding them where needed. I have made the changes for the 1394DC code
as a proof of concept, and fixed up simpleTest to do it this way. Also, on
Linux we can use ARTOOLKIT_CONFIG to override the video string from the
command line if there is nothing supplied by default in the calling app, this
is nice for changing camera parameters without needing a recompile.
Index: video.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoLinux1394Cam/video.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** video.c 4 Sep 2006 08:49:20 -0000 1.7
--- video.c 15 Sep 2006 03:41:14 -0000 1.8
***************
*** 235,240 ****
int ar2VideoDispOption( void )
{
! printf("ARVideo may be configured using one or more of the following options,\n");
! printf("separated by a space:\n\n");
printf(" -node=N\n");
printf(" specifies detected node ID of a FireWire camera (-1: Any).\n");
--- 235,240 ----
int ar2VideoDispOption( void )
{
! printf("\n");
! printf("ARVideo may be configured using one or more of the following options, separated by a space:\n\n");
printf(" -node=N\n");
printf(" specifies detected node ID of a FireWire camera (-1: Any).\n");
***************
*** 249,252 ****
--- 249,254 ----
printf(" (value must be a legal value for this parameter - use coriander to find what they are\n");
printf("\n");
+ printf(" Note that if no config string is supplied, you can override it with the environment variable ARTOOLKIT_CONFIG\n");
+ printf("\n");
return 0;
***************
*** 282,286 ****
vid->status = 0;
! printf ("Processing config string [%s]\n", config);
a = config;
--- 284,305 ----
vid->status = 0;
! /* If no config string is supplied, we should use the environment variable otherwise set a sane default */
! if (!strcmp (config, ""))
! {
! /* None suppplied, lets see if the user supplied one from the shell */
! char *envconf = getenv ("ARTOOLKIT_CONFIG");
! if ((envconf != NULL) && (strcmp (envconf, "")))
! {
! config = envconf;
! printf ("Using config string from environment [%s]\n", config);
! }
! else
! {
! printf ("No config string supplied, assuming 640x480 with YUV411 encoding\n");
! }
! }
! else
! printf ("Using supplied config string [%s]\n", config);
!
a = config;
|