]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - input.c
Proper CPU contracts in streamer
[frescor/streamer.git] / input.c
diff --git a/input.c b/input.c
index 31983349ded44ef959f782b5ee51b94e5ec3a7d9..db09807257546e552dae7bd25e6b520561a7fb5b 100644 (file)
--- a/input.c
+++ b/input.c
@@ -4,7 +4,7 @@
  *  This is free software; see GPL.txt
  */
 #include <string.h>
-#include <avformat.h>
+#include <libavformat/avformat.h>
 #include "input.h"
 
 static uint64_t time_convert(uint64_t time, AVStream *st)
@@ -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);