[FFmpeg-devel] [PATCH 2/2] vf_pad: port to new drawutils API.

Stefano Sabatini stefasab at gmail.com
Tue Mar 13 00:59:31 CET 2012


On date Monday 2012-03-12 21:32:59 +0100, Nicolas George encoded:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/vf_pad.c        |  121 ++++++++++++++-----------------------------
>  tests/ref/lavfi/pixfmts_pad |    6 ++
>  2 files changed, 46 insertions(+), 81 deletions(-)
> 
> 
> We may want to wait until ticket #1058 is fixed, as the hash for yuva444p
> will change.
> 
> I have checked visually the other colorspaces, and the color seem fine.
> 
> 
> diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
> index 9b2d5cf..320cc8a 100644
> --- a/libavfilter/vf_pad.c
> +++ b/libavfilter/vf_pad.c
> @@ -67,22 +67,7 @@ enum var_name {
>  
>  static int query_formats(AVFilterContext *ctx)
>  {
> -    static const enum PixelFormat pix_fmts[] = {
> -        PIX_FMT_ARGB,         PIX_FMT_RGBA,
> -        PIX_FMT_ABGR,         PIX_FMT_BGRA,
> -        PIX_FMT_RGB24,        PIX_FMT_BGR24,
> -
> -        PIX_FMT_YUV444P,      PIX_FMT_YUV422P,
> -        PIX_FMT_YUV420P,      PIX_FMT_YUV411P,
> -        PIX_FMT_YUV410P,      PIX_FMT_YUV440P,
> -        PIX_FMT_YUVJ444P,     PIX_FMT_YUVJ422P,
> -        PIX_FMT_YUVJ420P,     PIX_FMT_YUVJ440P,
> -        PIX_FMT_YUVA420P,
> -
> -        PIX_FMT_NONE
> -    };
> -
> -    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
> +    avfilter_set_common_pixel_formats(ctx, ff_draw_supported_pixel_formats(0));
>      return 0;
>  }
>  
> @@ -96,10 +81,9 @@ typedef struct {
>      char x_expr[256];       ///< width  expression string
>      char y_expr[256];       ///< height expression string
>  
> -    uint8_t color[4];       ///< color expressed either in YUVA or RGBA colorspace for the padding area
> -    uint8_t *line[4];
> -    int      line_step[4];
> -    int hsub, vsub;         ///< chroma subsampling values

> +    uint8_t rgba_color[4];  ///< color expressed either in YUVA or RGBA colorspace for the padding area

I suppose you can update the doxy.

[...]

Looks fine otherwise, very nice job, thanks.
-- 
FFmpeg = Freak & Fanciful Moronic Programmable Elaborated Gladiator


More information about the ffmpeg-devel mailing list