summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <>2012-01-10 22:48:42 +0100
committerJohns <johns98@gmx.net>2012-01-10 22:48:42 +0100
commit712b2e0de1cf9b0ff3706ce44c079e748399c0d4 (patch)
tree97aed2716d8fb2e40484c419fb453bb78bec84e1
parent54f92e67fc4864b86e313dabbf726f00b3268562 (diff)
downloadvdr-plugin-softhddevice-712b2e0de1cf9b0ff3706ce44c079e748399c0d4.tar.gz
vdr-plugin-softhddevice-712b2e0de1cf9b0ff3706ce44c079e748399c0d4.tar.bz2
Patch collection from Christian Ruppert.
Move objects before $LIBS to avoid link failures with --as-needed. Do not override CFLAGS for video test. Rearrange *FLAGS incl. some minor fixes. Don't override VDRDIR, LIBDIR and TMPDIR in makefile. Don't abuse LDFLAGS in makefile. Define CC in makefile. Include GL/gl.h for the GL_COLOR_BUFFER_BIT definition. VideoInit() needs an argument.
-rw-r--r--ChangeLog14
-rw-r--r--Makefile71
-rw-r--r--video.c3
3 files changed, 53 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index 944a032..6ddeddb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
+User Christian Rupper
+Date: Tue Jan 10 22:33:14 CET 2012
+
+ Move objects before $LIBS to avoid link failures with --as-needed.
+ Do not override CFLAGS for video test.
+ Rearrange *FLAGS incl. some minor fixes.
+ Don't override VDRDIR, LIBDIR and TMPDIR in makefile.
+ Don't abuse LDFLAGS in makefile.
+ Define CC in makefile.
+ Include GL/gl.h for the GL_COLOR_BUFFER_BIT definition.
+ VideoInit() needs an argument.
+
User johns
-Date:
+Date: Tue Jan 10 22:32:50 CET 2012
Add main menu entry, which suspends the plugin.
Add support for resize window.
diff --git a/Makefile b/Makefile
index 2208319..46c961f 100644
--- a/Makefile
+++ b/Makefile
@@ -26,40 +26,17 @@ CONFIG += $(shell pkg-config --exists alsa && echo "-DUSE_ALSA")
### The C++ compiler and options:
+CC ?= gcc
CXX ?= g++
-CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Woverloaded-virtual -fPIC
-override CXXFLAGS += $(DEFINES) $(INCLUDES)
CFLAGS ?= -g -O2 -W -Wall -Wextra -Winit-self \
- -Wdeclaration-after-statement -fPIC
-#CFLAGS += -Werror
-override CFLAGS += $(DEFINES) $(INCLUDES) \
- $(shell pkg-config --cflags libavcodec libavformat) \
- `pkg-config --cflags x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
- xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
- `pkg-config --cflags gl glu` \
- $(if $(findstring USE_VDPAU,$(CONFIG)), \
- `pkg-config --cflags vdpau`) \
- $(if $(findstring USE_VAAPI,$(CONFIG)), \
- `pkg-config --cflags libva-x11 libva-glx libva`) \
- $(if $(findstring USE_ALSA,$(CONFIG)), \
- `pkg-config --cflags alsa`)
-override LDFLAGS += -lrt \
- $(shell pkg-config --libs libavcodec libavformat) \
- `pkg-config --libs x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
- xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
- `pkg-config --libs gl glu` \
- $(if $(findstring USE_VDPAU,$(CONFIG)), \
- `pkg-config --libs vdpau`) \
- $(if $(findstring USE_VAAPI,$(CONFIG)), \
- `pkg-config --libs libva-x11 libva-glx libva`) \
- $(if $(findstring USE_ALSA,$(CONFIG)), \
- `pkg-config --libs alsa`)
+ -Wdeclaration-after-statement
+CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Woverloaded-virtual
### The directory environment:
-VDRDIR = ../../..
-LIBDIR = ../../lib
-TMPDIR = /tmp
+VDRDIR ?= ../../..
+LIBDIR ?= ../../lib
+TMPDIR ?= /tmp
### Make sure that necessary options are included:
@@ -78,12 +55,40 @@ APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDI
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
-### Includes and Defines (add further entries here):
+### Includes, Defines and dependencies (add further entries here):
INCLUDES += -I$(VDRDIR)/include
DEFINES += $(CONFIG) -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+_CFLAGS = $(DEFINES) $(INCLUDES) \
+ $(shell pkg-config --cflags libavcodec libavformat) \
+ `pkg-config --cflags x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
+ xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
+ `pkg-config --cflags gl glu` \
+ $(if $(findstring USE_VDPAU,$(CONFIG)), \
+ `pkg-config --cflags vdpau`) \
+ $(if $(findstring USE_VAAPI,$(CONFIG)), \
+ `pkg-config --cflags libva-x11 libva-glx libva`) \
+ $(if $(findstring USE_ALSA,$(CONFIG)), \
+ `pkg-config --cflags alsa`)
+
+#override _CFLAGS += -Werror
+override CXXFLAGS += $(_CFLAGS)
+override CFLAGS += $(_CFLAGS)
+
+LIBS += -lrt \
+ $(shell pkg-config --libs libavcodec libavformat) \
+ `pkg-config --libs x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
+ xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
+ `pkg-config --libs gl glu` \
+ $(if $(findstring USE_VDPAU,$(CONFIG)), \
+ `pkg-config --libs vdpau`) \
+ $(if $(findstring USE_VAAPI,$(CONFIG)), \
+ `pkg-config --libs libva-x11 libva-glx libva`) \
+ $(if $(findstring USE_ALSA,$(CONFIG)), \
+ `pkg-config --libs alsa`)
+
### The object files (add further files here):
OBJS = $(PLUGIN).o softhddev.o video.o audio.o codec.o ringbuffer.o
@@ -137,7 +142,7 @@ i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS) Makefile
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ $(LDFLAGS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -fPIC $(OBJS) -o $@ $(LIBS)
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: $(I18Npo) clean
@@ -163,5 +168,5 @@ indent:
done
video_test: video.c
- $(CC) -DVIDEO_TEST -DVERSION='"$(VERSION)"' $(CFLAGS) $(LDFLAGS) $(LIBS) \
- -O0 -g -o $@ $<
+ $(CC) -DVIDEO_TEST -DVERSION='"$(VERSION)"' $(CFLAGS) $(LDFLAGS) $< $(LIBS) \
+ -o $@
diff --git a/video.c b/video.c
index 729f473..a796858 100644
--- a/video.c
+++ b/video.c
@@ -98,6 +98,7 @@
#endif
#ifdef USE_GLX
+#include <GL/gl.h> // For GL_COLOR_BUFFER_BIT
#include <GL/glx.h>
// only for gluErrorString
#include <GL/glu.h>
@@ -7078,7 +7079,7 @@ int main(int argc, char *const argv[])
//
// main loop
//
- VideoInit();
+ VideoInit(NULL);
VideoOsdInit();
for (;;) {
VideoRenderOverlay();