]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - input.c
Allow to select video4linux version 1 formant from commandline.
[frescor/streamer.git] / input.c
diff --git a/input.c b/input.c
index 14353b998172a17688cb50b0ea6b20ed2560b453..db09807257546e552dae7bd25e6b520561a7fb5b 100644 (file)
--- a/input.c
+++ b/input.c
@@ -35,7 +35,7 @@ static void time_base_convert(AVPacket *pkt, AVStream *st)
   }
 }
 
-AVFormatContext *open_input_stream(const char *fname, int w, int h, int fps)
+AVFormatContext *open_input_stream(const char *fname, int w, int h, int fps, const char *impform)
 {
     AVFormatContext *s;
     AVInputFormat *fmt;
@@ -49,7 +49,9 @@ AVFormatContext *open_input_stream(const char *fname, int w, int h, int fps)
     param.pix_fmt = PIX_FMT_YUV420P;
     param.time_base.den = fps;
     param.time_base.num = 1;
-    fmt = av_find_input_format("video4linux2");
+    if(impform == NULL)
+      impform = "video4linux2";
+    fmt = av_find_input_format(impform);
     res = av_open_input_file(&s, fname, fmt, 0, &param);
     if (res < 0) {
         fprintf(stderr, "Error opening %s: %d\n", fname, res);