File:  [DVB] / margi2 / testsuite / testpattern.c
Revision 1.2: download - view: text, annotated - select for diffs
Thu Mar 15 15:58:16 2001 UTC (23 years, 2 months ago) by mocm
Branches: MAIN
CVS tags: HEAD
- added fast forward and slow motion to dvb api
- tried to add it to DVD api, but it locked up the system with some files
- ffwd and slowmo also lock up the powerbook G4

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

#include <stdio.h>
#include <sys/ioctl.h>

#include "../cvdvext.h"

FILE* device;
struct drawcmd dc;
struct decodercmd decmd;


int main (int argc, char* argv[]) {

//  FILE* picture;

  int outfile,i,verbose;
  videosystem sys=PAL;
  
  i=1;
  outfile=0;
  verbose=0;
  if (argc < 2){
    printf("\
Usage: %s [-v] <device> [<GIF-file>]\n\
-v: verbose on\n\
-p: PAL (default)\n\
-n: NTSC\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]=='p') {
        sys=PAL;
      } else if (argv[i][1]=='n') {
        sys=NTSC;
      } else {  // unknown option
        printf("\
Usage: %s [-v] <device> [<GIF-file>]\n\
-v: verbose on\n\
-p: PAL (default)\n\
-n: NTSC\n\
",argv[0]);
      }
    } else if (!outfile) outfile=i;
    i++;
  }

  if (outfile) {
    if ((device=fopen(argv[outfile],"w"))==NULL) {
      printf("Couldn't open file %s\n",argv[outfile]);
      exit (0);
    }
  } else exit(0);
  
  decmd.cmd=Decoder_Set_Videosystem;
  decmd.param1=sys;
  printf("Set Videosystem: %d\n",DecoderCommand(device,decmd));
    
  dc.x0=-1;
  dc.y0=-1;
  dc.x1=-1;
  dc.y1=-1;
  dc.color=-1;
  dc.cmd=OSD_Open;
  printf("Open: %d\n",OSD_Draw(device,dc));  // Open
  dc.cmd=OSD_Test;
  printf("Test: %d\n",OSD_Draw(device,dc));  // Test

  printf("Press <Return> to continue...");
  getc(stdin);
    
  dc.cmd=OSD_Close; printf("Close: %d\n",OSD_Draw(device,dc));  // Close
  return 0;
}

LinuxTV legacy CVS <linuxtv.org/cvs>