summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib/libv4l/libv4l2/Makefile
diff options
context:
space:
mode:
authorThierry MERLE <thierry.merle@free.fr>2008-07-01 21:11:29 +0200
committerThierry MERLE <thierry.merle@free.fr>2008-07-01 21:11:29 +0200
commit0d3f75db47da8e0a51eab041eb401bfb6f309174 (patch)
tree26c040de64f866bf61c13e6a4cd53f65a2147051 /v4l2-apps/lib/libv4l/libv4l2/Makefile
parent096cff3723440c08b1e706007cfdfda445409476 (diff)
downloadmediapointer-dvb-s2-0d3f75db47da8e0a51eab041eb401bfb6f309174.tar.gz
mediapointer-dvb-s2-0d3f75db47da8e0a51eab041eb401bfb6f309174.tar.bz2
v4l2-library: libv4l2 and v4l2convert
From: Hans de Goede <j.w.r.degoede at hhs.nl> libv4l2 offers v4l2_ prefixed versions of open/close/etc. The API is 100% the same as directly opening /dev/videoX using regular open/close/etc, the big difference is that format conversion is done if necessary when capturing. That is if you (try to) set a capture format which is not supported by the cam, but is supported by libv4lconvert, then the try_fmt / set_fmt will succeed as if the cam supports the format and on dqbuf / read the data will be converted for you and returned in the request format. v4l2convert: open/close/ioctl/mmap/munmap library call wrapper doing format conversion for v4l2 applications which want to be able to simply capture bgr24 / yuv420 from v4l2 devices with more exotic frame formats. Signed-off-by: Hans de Goede <j.w.r.degoede at hhs.nl> Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Diffstat (limited to 'v4l2-apps/lib/libv4l/libv4l2/Makefile')
-rw-r--r--v4l2-apps/lib/libv4l/libv4l2/Makefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/v4l2-apps/lib/libv4l/libv4l2/Makefile b/v4l2-apps/lib/libv4l/libv4l2/Makefile
new file mode 100644
index 000000000..c5463800b
--- /dev/null
+++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile
@@ -0,0 +1,52 @@
+CC = gcc
+LD = gcc
+
+CPPFLAGS = -fPIC -I../include -I../../../../linux/include
+
+CFLAGS := -g -O1
+CFLAGS += -Wall -W -Wno-unused -Wpointer-arith -Wstrict-prototypes
+
+LDFLAGS = -shared
+
+V4L2_OBJS = libv4l2.o log.o ../libv4lconvert/libv4lconvert.so
+V4L2_LIB = libv4l2.so
+V4L2CONVERT = v4l2convert.so
+V4L2CONVERT_O = v4l2convert.o libv4l2.so
+TARGETS = $(V4L2_LIB) $(V4L2CONVERT)
+INCLUDES = ../include/libv4l2.h
+
+ifeq ($(LIB_RELEASE),)
+LIB_RELEASE = 0
+endif
+
+ifeq ($(DESTDIR),)
+DESTDIR = /usr/local
+endif
+
+all: $(TARGETS)
+
+$(V4L2_LIB): $(V4L2_OBJS)
+
+$(V4L2CONVERT): $(V4L2CONVERT_O) $(V4L2_LIB)
+
+install: all
+ mkdir -p $(DESTDIR)/include
+ cp $(INCLUDES) $(DESTDIR)/include
+ mkdir -p $(DESTDIR)/lib
+ cp $(V4L2_LIB).$(LIB_RELEASE) $(DESTDIR)/lib
+ cd $(DESTDIR)/lib && \
+ ln -f -s $(V4L2_LIB).$(LIB_RELEASE) $(V4L2_LIB)
+ cp $(V4L2CONVERT).$(LIB_RELEASE) $(DESTDIR)/lib
+ cd $(DESTDIR)/lib && \
+ ln -f -s $(V4L2CONVERT).$(LIB_RELEASE) $(V4L2CONVERT)
+
+clean::
+ rm -f *.so* *.o log *~
+ rm -f *.d
+
+%.o: %.c
+ $(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+%.so:
+ $(CC) $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^
+ ln -f -s $@.$(LIB_RELEASE) $@