[FFmpeg-devel] [PATCH] Add 'drawgrid' video filter

Stefano Sabatini stefasab at gmail.com
Mon May 13 13:51:31 CEST 2013


On date Monday 2013-05-13 14:40:57 +0300, Andrey Utkin encoded:
> 2013/5/13 Stefano Sabatini <stefasab at gmail.com>:
> >> +static int pixel_belongs_to_grid(DrawGridContext *drawgrid, int x, int y)
> >
> > inline, pure
> 
> You mean adding such specificator words? Before "static"?

Yes, check libavutil/attributes.h (OTOH I see no functions in
libavfilter make use of pure/const, but sure it can't hurt).

> 
> >> +static const AVOption drawgrid_options[] = {
> >> +    { "x",         "Set horizontal offset", OFFSET(x),         AV_OPT_TYPE_INT,    { .i64 = 0 },       INT_MIN,  INT_MAX,  FLAGS },
> >> +    { "y",         "Set vertical offset",   OFFSET(y),         AV_OPT_TYPE_INT,    { .i64 = 0 },       INT_MIN,  INT_MAX,  FLAGS },
> >> +    { "width",     "Width of grid cell",    OFFSET(w),         AV_OPT_TYPE_INT,    { .i64 = 0 },       0,        INT_MAX,  FLAGS },
> >> +    { "w",         "Width of grid cell",    OFFSET(w),         AV_OPT_TYPE_INT,    { .i64 = 0 },       0,        INT_MAX,  FLAGS },
> >> +    { "height",    "Height of grid cell",   OFFSET(h),         AV_OPT_TYPE_INT,    { .i64 = 0 },       0,        INT_MAX,  FLAGS },
> >> +    { "h",         "Height of grid cell",   OFFSET(h),         AV_OPT_TYPE_INT,    { .i64 = 0 },       0,        INT_MAX,  FLAGS },
> >> +    { "color",     "Color of the grid",     OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
> >> +    { "c",         "Color of the grid",     OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
> >> +    { "thickness", "Grid line thickness",   OFFSET(thickness), AV_OPT_TYPE_INT,    {.i64=1},           0,        INT_MAX,  FLAGS },
> >> +    { "t",         "Grid line thickness",   OFFSET(thickness), AV_OPT_TYPE_INT,    {.i64=1},           0,        INT_MAX,  FLAGS },
> >
> > set horizontal offset
> > set vertical offset
> > etc ...
> 

> You mean descriptions should not start with capital letter? Sorry, i
> just saw both variants around, and thought i should start with
> capital.

Yes and should specify a verb, I'm aware both variants are present in
the codebase but we should settle for this one.
-- 
FFmpeg = Furious and Free Merciless Patchable Elitist Ghost


More information about the ffmpeg-devel mailing list