[FFmpeg-devel] [PATCH] frei0r wrapper

Michael Niedermayer michaelni
Wed Sep 8 14:42:23 CEST 2010


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

[...]
> +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


> +

> +    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

[...]
> +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 {}


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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/1ba8bd48/attachment.pgp>



More information about the ffmpeg-devel mailing list