[gegl] Replace deprecated avpicture_get_size, avpicture_fill, and av_codec_next
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Replace deprecated avpicture_get_size, avpicture_fill, and av_codec_next
- Date: Sat, 26 Mar 2022 18:36:37 +0000 (UTC)
commit f1115b1762ca35c971a44ae96d0b8e6ed1dc4eac
Author: Behnam Momeni <sbmomeni gmail com>
Date: Fri Mar 4 20:38:31 2022 +0330
Replace deprecated avpicture_get_size, avpicture_fill, and av_codec_next
The avpicture_get_size is replaced by av_image_get_buffer_size.
The avpicture_fill is replaced by av_image_fill_arrays.
The av_codec_next is replaced by av_codec_iterate.
operations/external/ff-save.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/operations/external/ff-save.c b/operations/external/ff-save.c
index cbd2957d6..a34f9fac9 100644
--- a/operations/external/ff-save.c
+++ b/operations/external/ff-save.c
@@ -626,14 +626,15 @@ alloc_picture (int pix_fmt, int width, int height)
picture = av_frame_alloc ();
if (!picture)
return NULL;
- size = avpicture_get_size (pix_fmt, width + 1, height + 1);
+ size = av_image_get_buffer_size(pix_fmt, width + 1, height + 1, 1);
picture_buf = malloc (size);
if (!picture_buf)
{
av_free (picture);
return NULL;
}
- avpicture_fill ((AVPicture *) picture, picture_buf, pix_fmt, width, height);
+ av_image_fill_arrays (picture->data, picture->linesize,
+ picture_buf, pix_fmt, width, height, 1);
return picture;
}
@@ -984,7 +985,8 @@ tfile (GeglProperties *o)
else
{
fprintf (stderr, "didn't find video encoder \"%s\"\navailable codecs: ", o->video_codec);
- while ((codec = av_codec_next (codec)))
+ void *opaque = NULL;
+ while ((codec = av_codec_iterate (&opaque)))
if (av_codec_is_encoder (codec) &&
avcodec_get_type (codec->id) == AVMEDIA_TYPE_VIDEO)
fprintf (stderr, "%s ", codec->name);
@@ -1000,7 +1002,8 @@ tfile (GeglProperties *o)
else
{
fprintf (stderr, "didn't find audio encoder \"%s\"\navailable codecs: ", o->audio_codec);
- while ((codec = av_codec_next (codec)))
+ void *opaque = NULL;
+ while ((codec = av_codec_iterate (&opaque)))
if (av_codec_is_encoder (codec) &&
avcodec_get_type (codec->id) == AVMEDIA_TYPE_AUDIO)
fprintf (stderr, "%s ", codec->name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]