1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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
|