]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - streamer.c
Updated list of used libraries for omkized version of FFmpeg.
[frescor/streamer.git] / streamer.c
index 38e46b9bc4c8e8ed3b7d6bcd51919f8eabfa492b..b11021213624facf83bdc7093cdd5f459a44ab89 100644 (file)
@@ -1,27 +1,34 @@
+/*
+ *  Copyright (c) 2008 Luca Abeni
+ *
+ *  This is free software; see GPL.txt
+ */
 #include <unistd.h>
 #include <stdlib.h>
 
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
+#include <libavformat/avformat.h>
+#include <libavdevice/avdevice.h>
+#include <libswscale/swscale.h>
 
 #include "input.h"
 #include "output.h"
 #include "codec.h"
 #include "rt.h"
 
+static const char *sdp_file = "sdp.txt";
 static const char *vdev = "/dev/video0";
 static const char *dst = "224.10.20.30";
 static int dport = 20000;
 static int width = 352;
 static int height = 288;
-static int fps = 25;
+int fps = 25;
 
-static void sdp_print(AVFormatContext *s)
+static void sdp_print(AVFormatContext *s, const char *fname)
 {
     char sdp[2048];
     FILE *f;
 
-    f = fopen("sdp.txt", "w");
+    f = fopen(fname, "w");
     avf_sdp_create(&s, 1, sdp, sizeof(sdp));
     fprintf(f, "%s\n", sdp);
     fclose(f);
@@ -87,7 +94,7 @@ int main(int argc, char *argv[])
   codec_connect(s->streams[0]->codec, os->streams[0]->codec);
   out_codec_open(os);
   dump_format(os, 0, os->filename, 1);
-  sdp_print(os);
+  sdp_print(os, sdp_file);
   done = 0;
   while (!done) {
     AVPacket *pkt;
@@ -99,7 +106,7 @@ int main(int argc, char *argv[])
       AVPacket *opkt;
 
       pkt->pts += s->streams[pkt->stream_index]->start_time;
-      rt_job_start(pkt->pts);
+      //rt_job_start(pkt->pts);
       f = pkt_decode(s, pkt);
       if (f) {
         opkt = pkt_encode(os, f);
@@ -107,7 +114,7 @@ int main(int argc, char *argv[])
           pkt_send(os, opkt);
         }
       }
-      rt_job_end();
+      //rt_job_end();
       av_free_packet(pkt);
     }
   }