[FFmpeg-devel] [PATCH] Implement avfilter_add_colorspaces()

Michael Niedermayer michaelni
Sun Jan 3 01:49:50 CET 2010


On Sun, Jan 03, 2010 at 01:32:46AM +0100, Stefano Sabatini wrote:
> On date Saturday 2010-01-02 21:10:49 +0100, Michael Niedermayer encoded:
> > On Sat, Jan 02, 2010 at 07:46:02PM +0100, Stefano Sabatini wrote:
> > > On date Saturday 2010-01-02 18:44:44 +0100, Michael Niedermayer encoded:
> > > > On Sat, Jan 02, 2010 at 12:42:55AM +0100, Stefano Sabatini wrote:
> > > > > On date Friday 2010-01-01 22:03:56 +0100, Michael Niedermayer encoded:
> > > > > > On Fri, Jan 01, 2010 at 01:32:32PM +0100, Stefano Sabatini wrote:
> > > > > [...]
> > > > > > > Index: libavfilter-soc/ffmpeg/libavfilter/avfilter.h
> > > > > > > ===================================================================
> > > > > > > --- libavfilter-soc.orig/ffmpeg/libavfilter/avfilter.h	2009-12-30 01:24:53.000000000 +0100
> > > > > > > +++ libavfilter-soc/ffmpeg/libavfilter/avfilter.h	2010-01-01 13:10:31.000000000 +0100
> > > > > > > @@ -192,6 +192,14 @@
> > > > > > >  AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
> > > > > > >  
> > > > > > >  /**
> > > > > > > + * Adds pix_fmt to the list of formats in formats.
> > > > > > > + *
> > > > > > > + * @return 0 in case of success or AVERROR(ENOMEM) if the formats list
> > > > > > > + * cannot be re-allocated.
> > > > > > > + */
> > > > > > 
> > > > > > I think ive said it in the past already, plase keep API/ABI in a way that is
> > > > > > not so locked down we need to bump the major version every day.
> > > > > > >= 0 success
> > > > > > <0 error code for example ENOMEM
> > > > > 
> > > > > Updated.
> > > > [...]
> > > > > +int avfilter_add_colorspace(AVFilterFormats *formats, enum PixelFormat pix_fmt)
> > > > > +{
> > > > > +    formats->formats = av_realloc(formats->formats,
> > > > > +                                  sizeof(formats->formats) * ++formats->format_count);
> > > > > +    if (!formats->formats)
> > > > > +        return AVERROR(ENOMEM);
> > > > 
> > > > memleak
> > > 
> > > New try.
> > > -- 
> > > FFmpeg = Faboulous Fiendish Murdering Philosofic Enhanced Guide
> > 
> > >  avfilter.h |    8 ++++++++
> > >  formats.c  |   13 +++++++++++++
> > >  2 files changed, 21 insertions(+)
> > > dd6cdbf8d6daefaf27db426a4f9ee3d774b9f028  implement-add-colorspace.patch
> > > Index: libavfilter-soc/ffmpeg/libavfilter/avfilter.h
> > > ===================================================================
> > > --- libavfilter-soc.orig/ffmpeg/libavfilter/avfilter.h	2010-01-01 16:07:31.000000000 +0100
> > > +++ libavfilter-soc/ffmpeg/libavfilter/avfilter.h	2010-01-02 00:39:40.000000000 +0100
> > > @@ -192,6 +192,14 @@
> > >  AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
> > >  
> > >  /**
> > > + * Adds pix_fmt to the list of formats in formats.
> > 
> > rename it please, using "formats" to refer to 2 different things is not
> > a good idea. You yourself managed to mix ** and * due to it apparently
> 
> I renamed the first "formats" to "pixel formats", and added some more
> words to visually separate the first "pixel formats" from the second
> "formats".
> 
> Regards.
> -- 
> FFmpeg = Free Faboulous Muttering Purposeless Evil Genius

>  avfilter.h |    8 ++++++++
>  formats.c  |   13 +++++++++++++
>  2 files changed, 21 insertions(+)
> dd1d83587003fe4ed57d43a0fbaec3cc508802a5  implement-add-colorspace.patch
> Index: libavfilter-soc/ffmpeg/libavfilter/avfilter.h
> ===================================================================
> --- libavfilter-soc.orig/ffmpeg/libavfilter/avfilter.h	2010-01-01 16:07:31.000000000 +0100
> +++ libavfilter-soc/ffmpeg/libavfilter/avfilter.h	2010-01-03 01:29:04.000000000 +0100
> @@ -192,6 +192,14 @@
>  AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
>  
>  /**
> + * Adds pix_fmt to the list of pixel formats contained in formats.
> + *
> + * @return a non negative value in case of success, or a negative
> + * value corresponding to an AVERROR code in case of error
> + */
> +int avfilter_add_colorspace(AVFilterFormats *formats, enum PixelFormat pix_fmt);

please use something like this:

/**
 * Adds pix_fmt to the list of formats contained in avff.
 *
 * @return a non negative value in case of success, or a negative
 * value corresponding to an AVERROR code in case of error
 */
int avfilter_add_colorspace(AVFilterFormats *avff, enum PixelFormat pix_fmt);

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100103/87529594/attachment.pgp>



More information about the ffmpeg-devel mailing list