[FFmpeg-devel] [PATCH v3 2/2] libavformat: add WebP demuxer

Zlomek, Josef josef at pex.com
Thu Aug 27 06:42:58 EEST 2020


On Wed, Aug 26, 2020 at 11:16 AM Andreas Rheinhardt <
andreas.rheinhardt at gmail.com> wrote:

> Josef Zlomek:
> >  tests/ref/fate/exif-image-webp              |   8 +-
> >  tests/ref/fate/webp-rgb-lena-lossless       |   2 +-
> >  tests/ref/fate/webp-rgb-lena-lossless-rgb24 |   2 +-
> >  tests/ref/fate/webp-rgb-lossless            |   2 +-
> >  tests/ref/fate/webp-rgb-lossy-q80           |   2 +-
> >  tests/ref/fate/webp-rgba-lossless           |   2 +-
> >  tests/ref/fate/webp-rgba-lossy-q80          |   2 +-
>
> Great that you also add so many tests for the new demuxer.
>

These are just adjustments of existing tests because of change of behaviour
(timing, headers passed in side data).
I did not know how to add test files so I did not add new tests yet, I will
include new tests in the next version of patches.
I have found how to do it here:
https://ffmpeg.org/fate.html#toc-Uploading-new-samples-to-the-fate-suite

>  12 files changed, 773 insertions(+), 10 deletions(-)
> >  create mode 100644 libavformat/webpdec.c
> >
> > +    if (headers && headers->data) {
> > +        uint8_t *side_data = av_memdup(headers->data, headers->size);
> > +        if (!side_data)
> > +            return AVERROR(ENOMEM);
> > +
> > +        ret = av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
> > +                                      side_data, headers->size);
>
> It is better to use av_packet_new_side_data() here: It takes care of the
> case when the buffer could be allocated, but reallocating the side-data
> array fails; and it also adds padding to the allocated buffer. Side data
> of type AV_PKT_DATA_NEW_EXTRADATA should have it.
>

Thank you for the tip, I will change that.

Josef


More information about the ffmpeg-devel mailing list