Support for libplacebo API Version 106

Support for LIBPLACEBO with opengl -> needs API >= 106
This commit is contained in:
jojo61
2021-01-10 13:55:09 +01:00
parent 184cc1aa05
commit a7471e8800
3 changed files with 293 additions and 114 deletions

122
Makefile
View File

@@ -1,6 +1,6 @@
#
# Makefile for a Video Disk Recorder plugin
#
#
# $Id: 2a41981a57e5e83036463c6a08c84b86ed9d2be3 $
# The official name of this plugin.
@@ -9,9 +9,9 @@
### Configuration (edit this for your needs)
# config as needed
# comment out if not needed
# what kind of decoder do we make -
# what kind of decoder do we make -
# if VAAPI is enabled the pluginname is softhdvaapi
# if CUVID is enabled the pluginname is softhdcuvid
# if DRM is enabled the pluginname is softhddrm
@@ -19,22 +19,30 @@ VAAPI ?= 0
CUVID ?= 0
# if you enable DRM then the plugin will only run without X server
# only valid for VAAPI
# does not work with libplacebo
# only valid for VAAPI
DRM ?= 0
# use libplacebo - available for both decoders but not for DRM
# use libplacebo -
# available for all decoders but for DRM you need LIBPLACEBO_GL
LIBPLACEBO ?= 1
LIBPLACEBO_GL ?= 0
# use YADIF deint - only available with cuvid
#YADIF=1
# use gamma correction
#GAMMA ?= 0
CONFIG := #-DDEBUG # remove # to enable debug output
#--------------------- no more config needed past this point--------------------------------
# sanitize selections --------
@@ -70,6 +78,8 @@ endif # MAKECMDGOALS!=indent
endif # MAKECMDGOALS!=clean
#--------------------------
PLUGIN = softhdcuvid
# support OPENGLOSD always needed
@@ -126,7 +136,7 @@ TMPDIR ?= /tmp
### The compiler options:
export CFLAGS = $(call PKGCFG,cflags)
export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags)
ifeq ($(CFLAGS),)
@@ -146,33 +156,7 @@ APIVERSION = $(call PKGCFG,apiversion)
### Parse config
ifeq ($(VAAPI),1)
CONFIG += -DVAAPI
#LIBPLACEBO=1
PLUGIN = softhdvaapi
LIBS += -lEGL
endif
ifeq ($(DRM),1)
PLUGIN = softhddrm
CONFIG += -DUSE_DRM -DVAAPI
LIBPLACEBO=0
_CFLAGS += $(shell pkg-config --cflags libdrm)
LIBS += -lgbm -ldrm
LIBS += -lEGL
endif
ifeq ($(CUVID),1)
CONFIG += -DUSE_PIP # PIP support
CONFIG += -DCUVID # enable CUVID decoder
LIBS += -lEGL -lGL
ifeq ($(YADIF),1)
CONFIG += -DYADIF # Yadif only with CUVID
endif
endif
### Parse softhddevice config
ifeq ($(ALSA),1)
CONFIG += -DUSE_ALSA
@@ -201,8 +185,45 @@ _CFLAGS += $(shell pkg-config --cflags freetype2)
LIBS += $(shell pkg-config --libs freetype2)
endif
ifeq ($(VAAPI),1)
CONFIG += -DVAAPI
#LIBPLACEBO=1
PLUGIN = softhdvaapi
endif
ifeq ($(LIBPLACEBO_GL),1)
CONFIG += -DPLACEBO_GL -DPLACEBO
LIBS += -lepoxy
LIBS += -lplacebo
else
LIBS += -lEGL
endif
ifeq ($(LIBPLACEBO),1)
CONFIG += -DPLACEBO
LIBS += -lEGL
LIBS += -lplacebo
endif
ifeq ($(DRM),1)
PLUGIN = softhddrm
CONFIG += -DUSE_DRM -DVAAPI
_CFLAGS += $(shell pkg-config --cflags libdrm)
LIBS += -lgbm -ldrm -lEGL
endif
ifeq ($(CUVID),1)
CONFIG += -DUSE_PIP # PIP support
CONFIG += -DCUVID # enable CUVID decoder
LIBS += -lEGL -lGL
ifeq ($(YADIF),1)
CONFIG += -DYADIF # Yadif only with CUVID
endif
endif
ifeq ($(GAMMA),1)
CONFIG += -DGAMMA
endif
@@ -215,7 +236,7 @@ SOFILE = libvdr-$(PLUGIN).so
#
# Test that libswresample is available
# Test that libswresample is available
#
#ifneq (exists, $(shell pkg-config libswresample && echo exists))
# $(warning ******************************************************************)
@@ -224,7 +245,7 @@ SOFILE = libvdr-$(PLUGIN).so
#endif
#
# Test and set config for libavutil
# Test and set config for libavutil
#
ifneq (exists, $(shell pkg-config libavutil && echo exists))
$(warning ******************************************************************)
@@ -235,7 +256,7 @@ _CFLAGS += $(shell pkg-config --cflags libavutil)
LIBS += $(shell pkg-config --libs libavutil)
#
# Test and set config for libswscale
# Test and set config for libswscale
#
ifneq (exists, $(shell pkg-config libswscale && echo exists))
$(warning ******************************************************************)
@@ -278,19 +299,19 @@ endif
_CFLAGS += $(shell pkg-config --cflags x11 x11-xcb xcb xcb-icccm)
LIBS += -lrt $(shell pkg-config --libs x11 x11-xcb xcb xcb-icccm)
#_CFLAGS += -I/usr/local/cuda/include
_CFLAGS += -I./opengl -I./
LIBS += -L/usr/lib64
LIBS += -L/usr/local/cuda/lib64
ifeq ($(LIBPLACEBO),1)
LIBS += -lplacebo
endif
ifeq ($(CUVID),1)
LIBS += -lcuda -lnvcuvid
#LIBS += -lcuda -L/usr/local/cuda/targets/x86_64-linux/lib -lcudart -lnvcuvid
LIBS += -lcuda -lnvcuvid
endif
LIBS += -lGLEW -lGLU -ldl -lglut
LIBS += -lGLEW -lGLU -ldl -lglut
### Includes and Defines (add further entries here):
INCLUDES +=
@@ -301,16 +322,21 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D_GNU_SOURCE $(CONFIG) \
### Make it standard
override CXXFLAGS += $(_CFLAGS) $(DEFINES) $(INCLUDES) \
-g -W -Wextra -Winit-self -Werror=overloaded-virtual -Wno-unused-parameter
-g -W -Wextra -Winit-self -Werror=overloaded-virtual -Wno-unused-parameter
override CFLAGS += $(_CFLAGS) $(DEFINES) $(INCLUDES) \
-g -W -Wextra -Winit-self -Wdeclaration-after-statement
### The object files (add further files here):
OBJS = softhdcuvid.o softhddev.o video.o audio.o codec.o ringbuffer.o
ifeq ($(OPENGLOSD),1)
OBJS += openglosd.o
OBJS = softhdcuvid.o softhddev.o video.o audio.o codec.o ringbuffer.o openglosd.o
ifeq ($(GAMMA),1)
OBJS += colorramp.o
ifeq ($(DRM),1)
OBJS += gamma-drm.o
else
OBJS += gamma-vidmode.o
endif
endif
SRCS = $(wildcard $(OBJS:.o=.c)) *.cpp
@@ -387,7 +413,9 @@ HDRS= $(wildcard *.h)
indent:
for i in $(SRCS) $(HDRS); do \
VERSION_CONTROL=none indent $$i; \
indent $$i; \
unexpand -a $$i | sed -e s/constconst/const/ > $$i.up; \
mv $$i.up $$i; \
done
video_test: video.c Makefile