[FFmpeg-devel] [PATCH] frei0r wrapper

Michael Niedermayer michaelni
Wed Sep 8 16:41:09 CEST 2010


On Wed, Sep 08, 2010 at 04:11:19PM +0200, Stefano Sabatini wrote:
> On date Wednesday 2010-09-08 14:42:23 +0200, Michael Niedermayer encoded:
> > On Tue, Sep 07, 2010 at 01:09:50PM +0200, Stefano Sabatini wrote:
> > > On date Sunday 2010-09-05 23:36:45 +0200, Michael Niedermayer encoded:
> > > > On Sun, Sep 05, 2010 at 10:20:50PM +0200, Stefano Sabatini wrote:
> > > > > On date Sunday 2010-09-05 18:54:17 +0200, Michael Niedermayer encoded:
> > > > > > On Sun, Sep 05, 2010 at 05:33:32PM +0200, Stefano Sabatini wrote:
> > > > > > > On date Sunday 2010-09-05 15:43:23 +0200, Michael Niedermayer encoded:
> > > > > > > > On Mon, Aug 30, 2010 at 08:32:01PM +0200, Stefano Sabatini wrote:
> > > > > > > > [...]
> > > > > > > > 
> > > > > > > > > +
> > > > > > > > > +where @var{filter_path} is the path to the frei0r effect to load, and
> > > > > > > > > + at var{param1}, @var{param2}, ... , @var{paramN} is a list of values
> > > > > > > > > +separated by ":" which specify the parameters for the frei0r effect.
> > > > > > > > > +
> > > > > > > > > +frei0r filters are usually installed in @file{/usr/lib/frei0r-1/}.
> > > > > > > > > +
> > > > > > > > > +A frei0r effect parameter can be a boolean (whose values are specified
> > > > > > > > > +with "true" and "false"), a double, a color (specified by the syntax
> > > > > > > > > + at var{R} @var{G} @var{B}), a position (specified by the syntax
> > > > > > > > > + at var{x} @var{y}) and a string.
> > > > > > > > > +
> > > > > > > > > +The number and kind of parameters depend on the loaded effect. If an
> > > > > > > > > +effect parameter is not specified the default value is set.
> > > > > > > > > +
> > > > > > > > > +Follows some example:
> > > > > > > > > + at example
> > > > > > > > > +# apply the distort0r effect, set the first two double parameters
> > > > > > > > > +frei0r=/usr/lib/frei0r-1/distort0r.so:0.5:0.01
> > > > > > > > 
> > > > > > > > requirering full pathes is lame when all filters are installed in like
> > > > > > > > one place
> > > > > > > 
> > > > > > > Depends on the distro, also you can have the distro filters in one
> > > > > > > place and your own filters into another dir.
> > > > > > 
> > > > > > what are you trying to say?
> > > > > > are you always writing
> > > > > > /bin/ls because excutables can be in several locations and they can be
> > > > > > different according to distro?
> > > > > 
> > > > > That depends on PATH, I added a note in the docs telling the user that
> > > > > she can extend her LD_LIBRARY_PATH in order to avoid to specify the
> > > > > complete effect path.
> > > > 
> > > > IMHO this is still a very poor choice
> > > > its quite unpractical to require users to manually reconfigure their system
> > > > because some developer refuses to write the 3 standard pathes in the code.
> > > > and thats for a odd feature, if every filter required that setup of ffmpeg
> > > > would not be fun anymore
> > > 
> > > Added a list of prefixes to try.
> > 
> > thank you
> > 
> > 
> > [...]
> > > +Some examples follow:
> > > + at example
> > > +# apply the distort0r effect, set the first two double parameters
> > > +frei0r=/usr/lib/frei0r-1/distort0r.so:0.5:0.01
> > 
> > if its looking in that directory then this example is bad as the path
> > is redundant
> 
> Fixed and documentation updated.
>  
> > [...]
> > > +static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
> > > +{
> > > +    Frei0rContext *frei0r = ctx->priv;
> > > +    void *v;
> > > +    double d;
> > > +    f0r_param_color_t col;
> > > +    f0r_param_position_t pos;
> > 
> > a union of the 3 might be simpler
> 
> Yes, it's slightly simpler, fixed.
>  
> > > +
> > 
> > > +    switch (info.type) {
> > > +    case F0R_PARAM_BOOL:
> > > +    {
> > > +        if      (!strcmp(param, "y")) d = 1.0;
> > > +        else if (!strcmp(param, "n")) d = 0.0;
> > > +        else goto fail;
> > > +        v = &d;
> > > +    }
> > > +    break;
> > 
> > the {} is redundant
> 
> Removed.
> 
> > [...]
> > > +static int query_formats(AVFilterContext *ctx)
> > > +{
> > > +    Frei0rContext *frei0r = ctx->priv;
> > > +    AVFilterFormats *formats = NULL;
> > > +
> > 
> > > +    if      (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888)
> > > +        avfilter_add_format(&formats, PIX_FMT_BGRA);
> > > +    else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888)
> > > +        avfilter_add_format(&formats, PIX_FMT_RGBA);
> > > +    else { /* F0R_COLOR_MODEL_PACKED32 */
> > 
> > missing {}
> 
> Added.
> 
> Regards.
> -- 
> FFmpeg = Fucking Friendly Muttering Philosofic Extravagant Gadget

>  configure                |    8 +
>  doc/filters.texi         |   46 ++++++
>  libavfilter/Makefile     |    1 
>  libavfilter/allfilters.c |    1 
>  libavfilter/vf_frei0r.c  |  353 +++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 409 insertions(+)
> 7855ce5610bddfb3724316d7c6a3f90d6e648bcc  0001-Add-frei0r-filter.patch
> From bbf233bd8e13962061b98302dfee5f95d351f011 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Tue, 24 Aug 2010 19:48:57 +0200
> Subject: [PATCH] Add frei0r filter.

shoudl be ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100908/60bd0969/attachment.pgp>



More information about the ffmpeg-devel mailing list