summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/gegl/files/replace-imgconvert-by-swsscale.patch')
-rw-r--r--media-libs/gegl/files/replace-imgconvert-by-swsscale.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch b/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch
new file mode 100644
index 000000000000..2cf5601e1665
--- /dev/null
+++ b/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch
@@ -0,0 +1,58 @@
+Index: gegl-0.0.22/operations/workshop/external/ff-save.c
+===================================================================
+--- gegl-0.0.22.orig/operations/workshop/external/ff-save.c
++++ gegl-0.0.22/operations/workshop/external/ff-save.c
+@@ -19,6 +19,8 @@
+ #include "config.h"
+ #include <glib/gi18n-lib.h>
+
++#include <libswscale/swscale.h>
++
+
+ #ifdef GEGL_CHANT_PROPERTIES
+
+@@ -640,6 +642,7 @@ write_video_frame (GeglChantO *op,
+ int out_size, ret;
+ AVCodecContext *c;
+ AVFrame *picture_ptr;
++ struct SwsContext *img_convert_ctx;
+
+ c = st->codec;
+
+@@ -649,10 +652,22 @@ write_video_frame (GeglChantO *op,
+ to the codec pixel format if needed */
+ fill_yuv_image (op, p->tmp_picture, p->frame_count, c->width,
+ c->height);
+- /* FIXME: img_convert is deprecated. Update code to use sws_scale(). */
++ /* FIXME: img_convert is deprecated. Update code to use sws_scale().
+ img_convert ((AVPicture *) p->picture, c->pix_fmt,
+ (AVPicture *) p->tmp_picture, PIX_FMT_RGB24,
+ c->width, c->height);
++ */
++ img_convert_ctx = sws_getContext(c->width, c->height, c->pix_fmt,
++ c->width, c->height, PIX_FMT_RGB24,
++ SWS_BICUBIC, NULL, NULL, NULL);
++
++ if (img_convert_ctx == NULL)
++ fprintf(stderr, "ff_save: Cannot initialize conversion context.");
++ else
++ {
++ sws_scale(img_convert_ctx, p->tmp_picture->data, p->tmp_picture->linesize,
++ 0, c->height, p->picture->data, p->picture->linesize);
++ }
+ }
+ else
+ {
+Index: gegl-0.0.22/operations/workshop/external/Makefile.am
+===================================================================
+--- gegl-0.0.22.orig/operations/workshop/external/Makefile.am
++++ gegl-0.0.22/operations/workshop/external/Makefile.am
+@@ -21,7 +21,7 @@ endif
+ if HAVE_AVFORMAT
+ ops += ff_save.la
+ ff_save_la_SOURCES = ff-save.c
+-ff_save_la_LIBADD = $(op_libs) $(AVFORMAT_LIBS)
++ff_save_la_LIBADD = $(op_libs) $(AVFORMAT_LIBS) -lswscale
+ ff_save_la_CFLAGS = $(AVFORMAT_CFLAGS)
+ endif
+