forked from tTh/FloatImg
video-infos can now print a title
This commit is contained in:
parent
4aaed6f322
commit
c3852b4dee
@ -232,35 +232,51 @@ fprintf(stderr, "%s not implemented\n", __func__);
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
static void help(int k)
|
||||||
void help(int k)
|
|
||||||
{
|
{
|
||||||
puts("Options :");
|
puts("Options :");
|
||||||
puts("\t-d\tselect the video device");
|
puts("\t-d\t\tselect the video device");
|
||||||
puts("\t-K\tset the K parameter");
|
puts("\t-K\t\tset the K parameter");
|
||||||
puts("\t-l\tlist video devices");
|
puts("\t-l\t\tlist video devices");
|
||||||
puts("\t-v\tincrease verbosity");
|
puts("\t-T bla\t\tadd a title");
|
||||||
|
puts("\t-v\t\tincrease verbosity");
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
static void print_title(char *txt)
|
||||||
|
{
|
||||||
|
int foo, l;
|
||||||
|
|
||||||
|
l = strlen(txt);
|
||||||
|
for (foo=0; foo<l+18; foo++) putchar('*'); puts("");
|
||||||
|
printf("****** %s ******\n", txt);
|
||||||
|
for (foo=0; foo<l+18; foo++) putchar('*'); puts("\n");
|
||||||
|
}
|
||||||
|
/* --------------------------------------------------------------------- */
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int foo, opt;
|
int foo, opt;
|
||||||
|
|
||||||
char *device = "/dev/video0";
|
char *device = "/dev/video0";
|
||||||
|
char *title = NULL;
|
||||||
int K = 0;
|
int K = 0;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "d:hK:lv")) != -1) {
|
while ((opt = getopt(argc, argv, "d:hK:lT:v")) != -1) {
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'd': device = optarg; break;
|
case 'd': device = optarg; break;
|
||||||
case 'h': help(0); break;
|
case 'h': help(0); break;
|
||||||
case 'K': K = atol(optarg); break;
|
case 'K': K = atol(optarg); break;
|
||||||
case 'l': liste_des_devices(0); break;
|
case 'l': liste_des_devices(0); break;
|
||||||
|
case 'T': title = optarg; break;
|
||||||
case 'v': verbosity++; break;
|
case 'v': verbosity++; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NULL != title) {
|
||||||
|
print_title(title);
|
||||||
|
}
|
||||||
|
|
||||||
foo = show_webcam_infos(device, "", K);
|
foo = show_webcam_infos(device, "", K);
|
||||||
fprintf(stderr, "\n\tshow_webcam_infos -> %d\n", foo);
|
fprintf(stderr, "\n\tshow_webcam_infos -> %d\n", foo);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user