File:  [DVB] / margi2 / testsuite / showstill.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Dec 3 22:41:16 2000 UTC (23 years, 6 months ago) by cvs
Branches: MAIN, CIM
CVS tags: margi043, HEAD
initial public CVS release 

// displays a picture on the OSD of a CVDV DVD decoder card
// (c) Christian Wolff for convergence integrated media 1999/03/03
//

#include "cvdvutil.h"
      
int main (int argc, char* argv[]) {

  int outfile,infile,giffile,i,verbose,width,height,frompic,topic,loop;

  i=1;
  outfile=0;
  infile=0;
  giffile=0;
  verbose=0;
  width=0;
  height=0;
  frompic=0;
  topic=0;
  loop=0;
  if (argc < 2){
    printf("\
Usage: %s [-v] -w<width> -h<height> [-f<fromframe> -t<toframe>] [-l] <device> <pixel-files (.Y, .U, .V)> [<gif-file>]\n\
-v: verbose on\n\
-l: loop\n\
",argv[0]);
	exit(0);
  }    
  while (i<argc) {
    if (argv[i][0]=='-') {  // option
      if (argv[i][1]=='v') {
        verbose=1;    // verbose on
      } else if (argv[i][1]=='w') {
        width=atoi(&argv[i][2]);
      } else if (argv[i][1]=='h') {
        height=atoi(&argv[i][2]);
      } else if (argv[i][1]=='f') {
        frompic=atoi(&argv[i][2]);
      } else if (argv[i][1]=='t') {
        topic=atoi(&argv[i][2]);
      } else if (argv[i][1]=='l') {
        loop=1;
      } else {  // unknown option
        printf("\
Usage: %s [-v] -w<width> -h<height> [-f<fromframe> -t<toframe>] [-l] <device> <pixel-files (.Y, .U, .V)> [<gif-file>]\n\
-v: verbose on\n\
-l: loop\n\
",argv[0]);
      }
    } else if (!outfile) outfile=i;
    else if (!infile) infile=i;
    else if (!giffile) giffile=i;
    i++;
  }

  if (outfile && infile) {
    cvdvutil_open_device(argv[outfile]);
    if (giffile) cvdvutil_gif_show(0,0,-1,argv[giffile]);
    cvdvutil_still_show(width,height,frompic,topic,loop,argv[infile]);
  } else exit(0);

  printf("\nPress <Return> to continue...\n");
  getc(stdin);
  return 0;
}

LinuxTV legacy CVS <linuxtv.org/cvs>