overlays/ffmpeg-foodogsquared: fix gltransitions filter

Still broken but it can be fixed later.
This commit is contained in:
Gabriel Arazas 2023-09-25 22:22:32 +08:00
parent 9654d7f551
commit c3f095295b
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 51 additions and 13 deletions

View File

@ -1,26 +1,26 @@
diff --git a/libavfilter/Makefile b/libavfilter/Makefile diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index a90ca30ad7..c0fc73be46 100644 index 30cc329fb6..02b4c75470 100644
--- a/libavfilter/Makefile --- a/libavfilter/Makefile
+++ b/libavfilter/Makefile +++ b/libavfilter/Makefile
@@ -367,6 +367,7 @@ OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o @@ -549,6 +549,8 @@ OBJS-$(CONFIG_YAEPBLUR_FILTER) += vf_yaepblur.o
OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o
OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o
OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o
+OBJS-$(CONFIG_GLTRANSITION_FILTER) += vf_gltransition.o +OBJS-$(CONFIG_GLTRANSITION_FILTER) += vf_gltransition.o
+OBJS-$(CONFIG_SHADERTOY_FILTER) += vf_shadertoy.o +OBJS-$(CONFIG_SHADERTOY_FILTER) += vf_shadertoy.o
OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o
OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 6eac828616..0570c1c2aa 100644 index 5ebacfde27..9053f030fb 100644
--- a/libavfilter/allfilters.c --- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c
@@ -357,6 +357,7 @@ extern AVFilter ff_vf_yadif; @@ -516,6 +516,8 @@ extern const AVFilter ff_vf_yaepblur;
extern const AVFilter ff_vf_zmq; extern const AVFilter ff_vf_zmq;
extern const AVFilter ff_vf_zoompan; extern const AVFilter ff_vf_zoompan;
extern const AVFilter ff_vf_zscale; extern const AVFilter ff_vf_zscale;
+extern const AVFilter ff_vf_gltransition; +extern const AVFilter ff_vf_gltransition;
+extern const AVFilter ff_vf_shadertoy; +extern const AVFilter ff_vf_shadertoy;
extern const AVFilter ff_vsrc_allrgb; extern const AVFilter ff_vsrc_allrgb;
extern const AVFilter ff_vsrc_allyuv; extern const AVFilter ff_vsrc_allyuv;

View File

@ -5,25 +5,43 @@ let
owner = "transitive-bullshit"; owner = "transitive-bullshit";
repo = "ffmpeg-gl-transition"; repo = "ffmpeg-gl-transition";
rev = "3639b521aafb30b185de281f94560f298a22d420"; rev = "3639b521aafb30b185de281f94560f298a22d420";
hash = ""; hash = "sha256-py6NVXw3giiRAcVRzsgxU8aKJZInWrubIUT2vOhfuco=";
name = "ffmpeg-gltransition";
}; };
ffmpegShadertoyFilter = prev.fetchFromGitLab { ffmpegShadertoy = prev.fetchFromGitLab {
owner = "kriwkrow"; owner = "kriwkrow";
repo = "ffmpeg_shadertoy_filter"; repo = "ffmpeg_shadertoy_filter";
rev = "eb297df10a104cae2d4ef3f70188d1e84f104532"; rev = "eb297df10a104cae2d4ef3f70188d1e84f104532";
hash = ""; hash = "sha256-Qy5sZgNF/0uNCosj2NZEvyssXU9ln6ZsDjnt/orpt1k=";
name = "ffmpeg-shadertoy";
}; };
in in
{ {
ffmpeg-foodogsquared = prev.ffmpeg-full.overrideAttrs (finalAttrs: prevAttrs: { ffmpeg-foodogsquared = prev.ffmpeg-full.overrideAttrs (finalAttrs: prevAttrs: {
pname = "ffmpeg-foodogsquared"; pname = "ffmpeg-foodogsquared";
srcs = [
prevAttrs.src
ffmpegGLTransitions
ffmpegShadertoy
];
buildInputs = prevAttrs.buildInputs ++ (with prev; [
libGLU
glew
]);
sourceRoot = ".";
patches = prevAttrs.patches ++ [ patches = prevAttrs.patches ++ [
./add-custom-filters.patch ./add-custom-filters.patch
./update-ffmpeg-opengltransition.patch
]; ];
postPatch = prevAttrs.postPatch + '' postUnpack = ''
cp ${ffmpegGLTransitions}/vf_gltransition.c $src/libavfilter cd ./${ffmpegGLTransitions.name}
cp ${ffmpegShadertoyFilter}/vf_shadertoy.c $src/libavfilter cd ../
cp --no-preserve=mode ./${ffmpegGLTransitions.name}/vf_gltransition.c ./ffmpeg/libavfilter
cp --no-preserve=mode ./${ffmpegShadertoy.name}/vf_shadertoy.c ./ffmpeg/libavfilter
cd ffmpeg
''; '';
}); });
} }

View File

@ -0,0 +1,20 @@
diff --git a/libavfilter/vf_gltransition.c b/libavfilter/vf_gltransition.c
--- a/libavfilter/vf_gltransition.c
+++ b/libavfilter/vf_gltransition.c
@@ -133,7 +133,6 @@ static const AVOption gltransition_options[] = {
{ "duration", "transition duration in seconds", OFFSET(duration), AV_OPT_TYPE_DOUBLE, {.dbl=1.0}, 0, DBL_MAX, FLAGS },
{ "offset", "delay before startingtransition in seconds", OFFSET(offset), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0, DBL_MAX, FLAGS },
{ "source", "path to the gl-transition source file (defaults to basic fade)", OFFSET(source), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
- {NULL}
};
FRAMESYNC_DEFINE_CLASS(gltransition, GLTransitionContext, fs);
@@ -570,7 +569,7 @@ AVFilter ff_vf_gltransition = {
.preinit = gltransition_framesync_preinit,
.init = init,
.uninit = uninit,
- .query_formats = query_formats,
+ .query_formats = FILTER_QUERY_FUNC(query_formats),
.activate = activate,
.inputs = gltransition_inputs,
.outputs = gltransition_outputs,