aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-12-03 09:32:40 +0100
committerGravatar wm4 <wm4@nowhere>2015-12-03 09:32:40 +0100
commit17507b593506ad820cfabbe2fcec208ffe9d073f (patch)
treec32ad98d4ddbcbe6f62dfef397e72ed7081fe282 /video
parent57e691b9011e9bdcc4fbc53a484f80057c65a891 (diff)
vo_opengl: require --enable-gpl3 for nnedi
There are claims that nnedi3.c doesn't constitute its own new implementation, but is derived from existing HLSL or OpenCL shaders distributed under the LGPLv3 license. Until these are resolved, do the "correct" thing and require --enable-gpl3 to build nnedi.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/nnedi3.c23
-rw-r--r--video/out/opengl/nnedi3.h3
-rw-r--r--video/out/opengl/video.c7
3 files changed, 31 insertions, 2 deletions
diff --git a/video/out/opengl/nnedi3.c b/video/out/opengl/nnedi3.c
index 681aad5813..bb200b0f7a 100644
--- a/video/out/opengl/nnedi3.c
+++ b/video/out/opengl/nnedi3.c
@@ -18,10 +18,15 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
+ *
+ * The shader portions may have been derived from existing LGPLv3 shaders
+ * (see below), possibly making this file effectively LGPLv3.
*/
#include "nnedi3.h"
+#if HAVE_NNEDI
+
#include <assert.h>
#include <stdint.h>
#include <float.h>
@@ -233,3 +238,21 @@ void pass_nnedi3(GL *gl, struct gl_shader_cache *sc, int planes, int tex_num,
i, tex_num, tex_num, tex_num, i, tex_mul);
}
}
+
+#else
+
+const struct m_sub_options nnedi3_conf = {0};
+
+
+const float* get_nnedi3_weights(const struct nnedi3_opts *conf, int *size)
+{
+ return NULL;
+}
+
+void pass_nnedi3(GL *gl, struct gl_shader_cache *sc, int planes, int tex_num,
+ int step, float tex_mul, const struct nnedi3_opts *conf,
+ struct gl_transform *transform)
+{
+}
+
+#endif
diff --git a/video/out/opengl/nnedi3.h b/video/out/opengl/nnedi3.h
index be69f34c78..837383c6f6 100644
--- a/video/out/opengl/nnedi3.h
+++ b/video/out/opengl/nnedi3.h
@@ -23,9 +23,12 @@
#ifndef MP_GL_NNEDI3_H
#define MP_GL_NNEDI3_H
+#include "config.h"
#include "common.h"
#include "utils.h"
+#define HAVE_NNEDI HAVE_GPL3
+
#define NNEDI3_UPLOAD_UBO 0
#define NNEDI3_UPLOAD_SHADER 1
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index f07fbb104b..6f3aba249c 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -459,8 +459,11 @@ const struct m_sub_options gl_video_conf = {
OPT_FLOAT("sharpen", unsharp, 0),
OPT_CHOICE("prescale", prescale, 0,
({"none", 0},
- {"superxbr", 1},
- {"nnedi3", 2})),
+ {"superxbr", 1}
+#if HAVE_NNEDI
+ , {"nnedi3", 2}
+#endif
+ )),
OPT_INTRANGE("prescale-passes",
prescale_passes, 0, 1, MAX_PRESCALE_PASSES),
OPT_FLOATRANGE("prescale-downscaling-threshold",