]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - streamer.c
Allow to select video4linux version 1 formant from commandline.
[frescor/streamer.git] / streamer.c
index b11021213624facf83bdc7093cdd5f459a44ab89..4185c1689f8e3808311de72c43ff158d8d1de3cf 100644 (file)
 
 static const char *sdp_file = "sdp.txt";
 static const char *vdev = "/dev/video0";
-static const char *dst = "224.10.20.30";
+static const char *dst = "127.0.0.1";
 static int dport = 20000;
 static int width = 352;
 static int height = 288;
 int fps = 25;
+static const char *impform = "video4linux2";
 
 static void sdp_print(AVFormatContext *s, const char *fname)
 {
@@ -38,7 +39,7 @@ static int args_parse(int argc, char *argv[])
 {
   int v;
 
-  while ((v = getopt(argc, argv, "w:h:r:d:")) >= 0) {
+  while ((v = getopt(argc, argv, "w:h:r:d:m:i:")) >= 0) {
     switch (v) {
       case 'w':
         width = atoi(optarg);
@@ -55,6 +56,13 @@ static int args_parse(int argc, char *argv[])
       case 'm':
         dst = optarg;
         break;
+      case 'i':
+        impform = optarg;
+       if(!strcmp(impform, "v4l"))
+         impform = "video4linux";
+       else if(!strcmp(impform, "v4l2"))
+         impform = "video4linux2";
+        break;
       default: /* ’?’ */
         fprintf(stderr, "%s: illegal option %c\n", argv[0], v);
         exit(-1);
@@ -75,7 +83,7 @@ int main(int argc, char *argv[])
 
   args_parse(argc, argv);
 
-  s = open_input_stream(vdev, width, height, fps);
+  s = open_input_stream(vdev, width, height, fps, impform);
   if (s == NULL) {
     fprintf(stderr, "Cannot open input file %s\n", vdev);