[FFmpeg-devel] [PATCH 1/7] lavfi/tile: allow named arguments.

Clément Bœsch ubitux at gmail.com
Sat Nov 10 21:07:52 CET 2012


On Fri, Nov 09, 2012 at 12:06:33AM +0100, Nicolas George wrote:
> L'octidi 18 brumaire, an CCXXI, Clément Bœsch a écrit :
> > ---
> >  libavfilter/vf_tile.c | 29 ++++++++++++++++++++++-------
> >  1 file changed, 22 insertions(+), 7 deletions(-)
> > 
> > diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c
> > index 52d53eb..716cc46 100644
> > --- a/libavfilter/vf_tile.c
> > +++ b/libavfilter/vf_tile.c
> > @@ -23,6 +23,7 @@
> >   * tile video filter
> >   */
> >  
> > +#include "libavutil/opt.h"
> >  #include "libavutil/pixdesc.h"
> >  #include "avfilter.h"
> >  #include "drawutils.h"
> > @@ -31,6 +32,7 @@
> >  #include "internal.h"
> >  
> >  typedef struct {
> > +    const AVClass *class;
> >      unsigned w, h;
> >      unsigned current;
> >      FFDrawContext draw;
> > @@ -39,17 +41,29 @@ typedef struct {
> >  
> >  #define REASONABLE_SIZE 1024
> >  
> > +#define OFFSET(x) offsetof(TileContext, x)
> > +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
> > +
> > +static const AVOption tile_options[] = {
> > +    { "size", "set tile size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "6x5"}, 0, 0, FLAGS },
> > +    { "s",    "set tile size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "6x5"}, 0, 0, FLAGS },
> 
> I would prefer if this file stays below the 80 columns limit. Breaking both
> these lines before {.str} seems to be enough.
> 

The AVOption arrays are one of the very few exceptions where I think
breaking the lines really harms the readability a lot. But you are the
maintainer of the filter, so be it. Consider it changed locally.

> Apart from that, LGTM.

I'll push this tomorrow.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121110/1c8fc698/attachment.asc>


More information about the ffmpeg-devel mailing list