-FFSRC ?= $(FFDIR)
-CPPFLAGS= -I $(FFSRC)
-CFLAGS = -Wall
-CFLAGS += -Wdeclaration-after-statement
-CFLAGS += -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls
-CFLAGS += -Wno-pointer-sign
-LDFLAGS= -L $(FFDIR)/libavutil -L $(FFDIR)/libavcodec -L $(FFDIR)/libavformat -L $(FFDIR)/libavdevice
-LDLIBS = -lavdevice -lavformat -lavcodec -lavutil
+# Generic directory or leaf node makefile for OCERA make framework
-LDLIBS += -lm -lz
-CFLAGS += -g
-
-OBJS = input.o codec.o output.o
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
-ifdef AQUOSA
-CPPFLAGS += -I$(AQUOSA)/include
-LDFLAGS += -L$(AQUOSA)/lib
-LDLIBS += -lqreslib -lqmgrlib -lrt
-OBJS += rt_qosmgr.o
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+ @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
else
-OBJS += rt.o
+include $(MAKERULES_DIR)/Makefile.rules
endif
-
-all: streamer
-
-streamer: streamer.o $(OBJS)
-
-clean:
- rm -f *.o streamer *.d
-
-###################################
-%.d: %.c
- $(CC) $(CPPFLAGS) -MM -MF $@ $<
-
-%.o: %.d
-
--include $(OBJS:.o=.d)
-
--- /dev/null
+#FFSRC ?= $(FFDIR)
+#CPPFLAGS= -I $(FFSRC)
+CFLAGS = -Wall
+CFLAGS += -Wdeclaration-after-statement
+CFLAGS += -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls
+CFLAGS += -Wno-pointer-sign
+CFLAGS += -I /usr/include/ffmpeg
+#LDFLAGS= -L $(FFDIR)/libavutil -L $(FFDIR)/libavcodec -L $(FFDIR)/libavformat -L $(FFDIR)/libavdevice
+#LDLIBS = -lavdevice -lavformat -lavcodec -lavutil
+
+LDLIBS += -lm -lz
+#CFLAGS += -g
+
+ifdef AQUOSA
+CPPFLAGS += -I$(AQUOSA)/include
+LDFLAGS += -L$(AQUOSA)/lib
+LDLIBS += -lqreslib -lqmgrlib -lrt
+OBJS += rt_qosmgr.o
+else
+OBJS += rt.o
+endif
+
+bin_PROGRAMS=streamer
+streamer_SOURCES=streamer.c input.c codec.c output.c
+
+lib_LOADLIBES+= avformat avcodec avutil m z
--- /dev/null
+The video encoder (see the instructions at the end of the email for building it)
+grabs video from a video4linux2 device, encodes it (currently, to mpeg4 video;
+the video encoder will allow to modify some settings in the future), and streams
+it over RTP.
+It can be started as
+ streamer [<options>]
+where the options allow to change the video capture device, the video size and
+frame rate, the destination address, etc...
+
+The SDP needed for receiving the video stream is saved in the "sdp.txt" file.
+
+
+HOW TO BUILD:
+The encoder and streamer is based on ffmpeg's libraries. So, first you have to download
+and compile ffmpeg
+ tar xvzf RTEncoder-v0.1.tgz
+ cd RTEncoder-v0.1
+ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
+ cd ffmpeg
+ ./configure; make
+OR
+
+install deb packages libswscale-dev, libavformat-dev
+
+
+Compile the streamer
+ cd ..
+ make FFDIR=ffmpeg
+It should create a "streamer" executable.
*
* This is free software; see GPL.txt
*/
-#include "libavformat/avformat.h"
+/*#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
-#include "libswscale/swscale.h"
+#include "libswscale/swscale.h"*/
+
+#include <avformat.h>
+#include <avcodec.h>
+#include <swscale.h>
struct resample_data {
struct SwsContext *resample_ctx;
* This is free software; see GPL.txt
*/
#include <string.h>
-#include "libavformat/avformat.h"
+#include <avformat.h>
#include "input.h"
static uint64_t time_convert(uint64_t time, AVStream *st)
*
* This is free software; see GPL.txt
*/
-#include "libavformat/avformat.h"
+#include <avformat.h>
AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type)
#include <unistd.h>
#include <stdlib.h>
-#include "libavformat/avformat.h"
-#include "libavdevice/avdevice.h"
+#include <avformat.h>
+//#include <avdevice.h>
#include "input.h"
#include "output.h"