[FFmpeg-soc] [PATCH] Rename AVFilterPicRef->AVFilterBufferRef

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Aug 2 11:00:38 CEST 2010


On date Sunday 2010-08-01 23:41:57 -0700, S.N. Hemanth Meenakshisundaram encoded:
> This is to allow AVFilterBufferRef to be used for both audio and video.
> 
> ---
>  doc/APIchanges               |    6 ++++++
>  ffmpeg.c                     |    6 +++---
>  ffplay.c                     |   10 +++++-----
>  libavfilter/avfilter.c       |   16 ++++++++--------
>  libavfilter/avfilter.h       |   34 +++++++++++++++++-----------------
>  libavfilter/defaults.c       |   10 +++++-----
>  libavfilter/internal.h       |    2 +-
>  libavfilter/vf_aspect.c      |    2 +-
>  libavfilter/vf_crop.c        |    4 ++--
>  libavfilter/vf_drawbox.c     |    4 ++--
>  libavfilter/vf_drawtext.c    |    8 ++++----
>  libavfilter/vf_fade.c        |   10 +++++-----
>  libavfilter/vf_fifo.c        |    4 ++--
>  libavfilter/vf_fps.c         |    4 ++--
>  libavfilter/vf_hflip.c       |    4 ++--
>  libavfilter/vf_negate.c      |    4 ++--
>  libavfilter/vf_overlay.c     |   18 +++++++++---------
>  libavfilter/vf_pad.c         |   14 +++++++-------
>  libavfilter/vf_pixdesctest.c |    8 ++++----
>  libavfilter/vf_rotate.c      |    6 +++---
>  libavfilter/vf_scale.c       |    6 +++---
>  libavfilter/vf_setpts.c      |    6 +++---
>  libavfilter/vf_slicify.c     |    2 +-
>  libavfilter/vf_split.c       |    2 +-
>  libavfilter/vf_transpose.c   |    8 ++++----
>  libavfilter/vf_unsharp.c     |    4 ++--
>  libavfilter/vf_vflip.c       |    6 +++---
>  libavfilter/vsink_nullsink.c |    2 +-
>  libavfilter/vsrc_buffer.c    |    2 +-
>  libavfilter/vsrc_movie.c     |    4 ++--
>  30 files changed, 111 insertions(+), 105 deletions(-)
> 
> 
> 

> diff --git a/doc/APIchanges b/doc/APIchanges
> index b9de6d1..5dba97f 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,12 @@ libavutil:   2009-03-08
>  
>  API changes, most recent first:
>  
> +2010-08-01 - r24519 - lavfi 1.27.1 - rename AVFilterPicRef
> +  Rename AVFilterPicRef->AVFilterBufferRef
> +
> +2010-08-01 - r24519 - lavfi 1.27.0 - move format field
> +  Move the format field to AVFilterPicRef from AVFilterBuffer
> +
>  2010-07-27 - r24518 - lavcore 0.1.0 - parseutils.h
>    Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate()
>    defined in libavcodec in favor of the newly added functions
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 6f70516..67dcb9a 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -313,7 +313,7 @@ typedef struct AVInputStream {
>      AVFilterContext *input_video_filter;
>      AVFrame *filter_frame;
>      int has_filter_frame;
> -    AVFilterPicRef *picref;
> +    AVFilterBufferRef *picref;
>  #endif
>  } AVInputStream;
>  
> @@ -361,10 +361,10 @@ static int output_query_formats(AVFilterContext *ctx)
>  }
>  
>  static int get_filtered_video_pic(AVFilterContext *ctx,
> -                                  AVFilterPicRef **picref, AVFrame *pic2,
> +                                  AVFilterBufferRef **picref, AVFrame *pic2,
>                                    uint64_t *pts)
>  {
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>  
>      if(avfilter_request_frame(ctx->inputs[0]))
>          return -1;
> diff --git a/ffplay.c b/ffplay.c
> index c976f09..9b523de 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -105,7 +105,7 @@ typedef struct VideoPicture {
>      enum PixelFormat pix_fmt;
>  
>  #if CONFIG_AVFILTER
> -    AVFilterPicRef *picref;
> +    AVFilterBufferRef *picref;
>  #endif
>  } VideoPicture;
>  
> @@ -1560,7 +1560,7 @@ typedef struct {
>  static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
>  {
>      AVFilterContext *ctx = codec->opaque;
> -    AVFilterPicRef  *ref;
> +    AVFilterBufferRef  *ref;
>      int perms = AV_PERM_WRITE;
>      int i, w, h, stride[4];
>      unsigned edge;
> @@ -1609,7 +1609,7 @@ static void input_release_buffer(AVCodecContext *codec, AVFrame *pic)
>  
>  static int input_reget_buffer(AVCodecContext *codec, AVFrame *pic)
>  {
> -    AVFilterPicRef *ref = pic->opaque;
> +    AVFilterBufferRef *ref = pic->opaque;
>  
>      if (pic->data[0] == NULL) {
>          pic->buffer_hints |= FF_BUFFER_HINTS_READABLE;
> @@ -1656,7 +1656,7 @@ static void input_uninit(AVFilterContext *ctx)
>  static int input_request_frame(AVFilterLink *link)
>  {
>      FilterPriv *priv = link->src->priv;
> -    AVFilterPicRef *picref;
> +    AVFilterBufferRef *picref;
>      int64_t pts = 0;
>      AVPacket pkt;
>      int ret;
> @@ -1741,7 +1741,7 @@ static int output_query_formats(AVFilterContext *ctx)
>  static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
>                                      int64_t *pts, int64_t *pos)
>  {
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>  
>      if(avfilter_request_frame(ctx->inputs[0]))
>          return -1;
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index c040a9c..c2061e2 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -45,16 +45,16 @@ const char *avfilter_license(void)
>  #define link_dpad(link)     link->dst-> input_pads[link->dstpad]
>  #define link_spad(link)     link->src->output_pads[link->srcpad]
>  
> -AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)
> +AVFilterBufferRef *avfilter_ref_pic(AVFilterBufferRef *ref, int pmask)
>  {
> -    AVFilterPicRef *ret = av_malloc(sizeof(AVFilterPicRef));
> +    AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
>      *ret = *ref;
>      ret->perms &= pmask;
>      ret->pic->refcount ++;
>      return ret;
>  }
>  
> -void avfilter_unref_pic(AVFilterPicRef *ref)
> +void avfilter_unref_pic(AVFilterBufferRef *ref)
>  {
>      if(!(--ref->pic->refcount))
>          ref->pic->free(ref->pic);
> @@ -171,7 +171,7 @@ int avfilter_config_links(AVFilterContext *filter)
>      return 0;
>  }
>  
> -void ff_dprintf_picref(void *ctx, AVFilterPicRef *picref, int end)
> +void ff_dprintf_picref(void *ctx, AVFilterBufferRef *picref, int end)
>  {
>      dprintf(ctx,
>              "picref[%p data[%p, %p, %p, %p] linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64" a:%d/%d s:%dx%d]%s",
> @@ -194,9 +194,9 @@ void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
>              end ? "\n" : "");
>  }
>  
> -AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
> +AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
>  {
> -    AVFilterPicRef *ret = NULL;
> +    AVFilterBufferRef *ret = NULL;
>  
>      FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " perms:%d w:%d h:%d\n", perms, w, h);
>  
> @@ -242,9 +242,9 @@ int avfilter_poll_frame(AVFilterLink *link)
>  
>  /* XXX: should we do the duplicating of the picture ref here, instead of
>   * forcing the source filter to do it? */
> -void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
> -    void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
> +    void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
>      AVFilterPad *dst = &link_dpad(link);
>  
>      FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_picref(NULL, picref, 1);
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index 6625052..08e1d95 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -62,7 +62,7 @@ typedef struct AVFilterPad     AVFilterPad;
>  /**
>   * A reference-counted buffer data type used by the filter system. Filters
>   * should not store pointers to this structure directly, but instead use the
> - * AVFilterPicRef structure below.
> + * AVFilterBufferRef structure below.
>   */
>  typedef struct AVFilterBuffer
>  {
> @@ -96,7 +96,7 @@ typedef struct AVFilterBuffer
>   *
>   * TODO: add anything necessary for frame reordering
>   */
> -typedef struct AVFilterPicRef
> +typedef struct AVFilterBufferRef
>  {
>      AVFilterBuffer *pic;        ///< the picture that this is a reference to
>      uint8_t *data[4];           ///< picture data for each plane
> @@ -114,13 +114,13 @@ typedef struct AVFilterPicRef
>  
>      int interlaced;             ///< is frame interlaced
>      int top_field_first;
> -} AVFilterPicRef;
> +} AVFilterBufferRef;
>  
>  /**
>   * Copy properties of src to dst, without copying the actual video
>   * data.
>   */
> -static inline void avfilter_copy_picref_props(AVFilterPicRef *dst, AVFilterPicRef *src)
> +static inline void avfilter_copy_picref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
>  {
>      dst->pts             = src->pts;
>      dst->pos             = src->pos;
> @@ -137,14 +137,14 @@ static inline void avfilter_copy_picref_props(AVFilterPicRef *dst, AVFilterPicRe
>   * @return      a new reference to the picture with the same properties as the
>   *              old, excluding any permissions denied by pmask
>   */
> -AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask);
> +AVFilterBufferRef *avfilter_ref_pic(AVFilterBufferRef *ref, int pmask);
>  
>  /**
>   * Remove a reference to a picture. If this is the last reference to the
>   * picture, the picture itself is also automatically freed.
>   * @param ref reference to the picture
>   */
> -void avfilter_unref_pic(AVFilterPicRef *ref);
> +void avfilter_unref_pic(AVFilterBufferRef *ref);
>  
>  /**
>   * A list of supported formats for one end of a filter link. This is used
> @@ -321,7 +321,7 @@ struct AVFilterPad
>       *
>       * Input video pads only.
>       */
> -    void (*start_frame)(AVFilterLink *link, AVFilterPicRef *picref);
> +    void (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref);
>  
>      /**
>       * Callback function to get a buffer. If NULL, the filter system will
> @@ -329,7 +329,7 @@ struct AVFilterPad
>       *
>       * Input video pads only.
>       */
> -    AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
> +    AVFilterBufferRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
>  
>      /**
>       * Callback called after the slices of a frame are completely sent. If
> @@ -386,7 +386,7 @@ struct AVFilterPad
>  };
>  
>  /** default handler for start_frame() for video inputs */
> -void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
> +void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
>  /** default handler for draw_slice() for video inputs */
>  void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
>  /** default handler for end_frame() for video inputs */
> @@ -396,7 +396,7 @@ int avfilter_default_config_output_link(AVFilterLink *link);
>  /** default handler for config_props() for video inputs */
>  int avfilter_default_config_input_link (AVFilterLink *link);
>  /** default handler for get_video_buffer() for video inputs */
> -AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,
> +AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link,
>                                                    int perms, int w, int h);
>  /**
>   * A helper for query_formats() which sets all links to the same list of
> @@ -408,7 +408,7 @@ void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
>  int avfilter_default_query_formats(AVFilterContext *ctx);
>  
>  /** start_frame() handler for filters which simply pass video along */
> -void avfilter_null_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
> +void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
>  
>  /** draw_slice() handler for filters which simply pass video along */
>  void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
> @@ -417,7 +417,7 @@ void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
>  void avfilter_null_end_frame(AVFilterLink *link);
>  
>  /** get_video_buffer() handler for filters which simply pass video along */
> -AVFilterPicRef *avfilter_null_get_video_buffer(AVFilterLink *link,
> +AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link,
>                                                    int perms, int w, int h);
>  
>  /**
> @@ -528,10 +528,10 @@ struct AVFilterLink
>       * for the destination. This should not be accessed directly by the
>       * filters.
>       */
> -    AVFilterPicRef *srcpic;
> +    AVFilterBufferRef *srcpic;
>  
> -    AVFilterPicRef *cur_pic;
> -    AVFilterPicRef *outpic;
> +    AVFilterBufferRef *cur_pic;
> +    AVFilterBufferRef *outpic;
>  };
>  
>  /**
> @@ -562,7 +562,7 @@ int avfilter_config_links(AVFilterContext *filter);
>   * @return      A reference to the picture. This must be unreferenced with
>   *              avfilter_unref_pic when you are finished with it.
>   */
> -AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
> +AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
>                                            int w, int h);
>  
>  /**
> @@ -588,7 +588,7 @@ int avfilter_poll_frame(AVFilterLink *link);
>   *               portion. The receiving filter will free this reference when
>   *               it no longer needs it.
>   */
> -void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
> +void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
>  
>  /**
>   * Notifie the next filter that the current frame has finished.
> diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
> index ab7be77..6d4a3c1 100644
> --- a/libavfilter/defaults.c
> +++ b/libavfilter/defaults.c
> @@ -32,10 +32,10 @@ static void avfilter_default_free_buffer(AVFilterBuffer *ptr)
>  /* TODO: set the buffer's priv member to a context structure for the whole
>   * filter chain.  This will allow for a buffer pool instead of the constant
>   * alloc & free cycle currently implemented. */
> -AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
> +AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
>  {
>      AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
> -    AVFilterPicRef *ref = av_mallocz(sizeof(AVFilterPicRef));
> +    AVFilterBufferRef *ref = av_mallocz(sizeof(AVFilterBufferRef));
>      int i, tempsize;
>      char *buf;
>  
> @@ -65,7 +65,7 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms,
>      return ref;
>  }
>  
> -void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      AVFilterLink *out = NULL;
>  
> @@ -168,7 +168,7 @@ int avfilter_default_query_formats(AVFilterContext *ctx)
>      return 0;
>  }
>  
> -void avfilter_null_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      avfilter_start_frame(link->dst->outputs[0], picref);
>  }
> @@ -183,7 +183,7 @@ void avfilter_null_end_frame(AVFilterLink *link)
>      avfilter_end_frame(link->dst->outputs[0]);
>  }
>  
> -AVFilterPicRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
> +AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
>  {
>      return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
>  }
> diff --git a/libavfilter/internal.h b/libavfilter/internal.h
> index 9ddde36..3687726 100644
> --- a/libavfilter/internal.h
> +++ b/libavfilter/internal.h
> @@ -26,7 +26,7 @@
>  
>  #include "avfilter.h"
>  
> -void ff_dprintf_picref(void *ctx, AVFilterPicRef *picref, int end);
> +void ff_dprintf_picref(void *ctx, AVFilterBufferRef *picref, int end);
>  
>  void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);
>  
> diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
> index 2627722..bd18649 100644
> --- a/libavfilter/vf_aspect.c
> +++ b/libavfilter/vf_aspect.c
> @@ -56,7 +56,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
>      return 0;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      AspectContext *aspect = link->dst->priv;
>  
> diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
> index 6bfee03..357df97 100644
> --- a/libavfilter/vf_crop.c
> +++ b/libavfilter/vf_crop.c
> @@ -157,10 +157,10 @@ static int config_output(AVFilterLink *link)
>      return 0;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      CropContext *crop = link->dst->priv;
> -    AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
> +    AVFilterBufferRef *ref2 = avfilter_ref_pic(picref, ~0);
>      int i;
>  
>      ref2->w        = crop->w;
> diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
> index 4357d11..164f869 100644
> --- a/libavfilter/vf_drawbox.c
> +++ b/libavfilter/vf_drawbox.c
> @@ -92,7 +92,7 @@ static int config_input(AVFilterLink *link)
>      return 0;
>  }
>  
> -static void draw_box(AVFilterPicRef *pic, BoxContext* context, box_color color)
> +static void draw_box(AVFilterBufferRef *pic, BoxContext* context, box_color color)
>  {
>      int x, y;
>      int channel;
> @@ -121,7 +121,7 @@ static void end_frame(AVFilterLink *link)
>  {
>      BoxContext *context = link->dst->priv;
>      AVFilterLink *output = link->dst->outputs[0];
> -    AVFilterPicRef *pic = link->cur_pic;
> +    AVFilterBufferRef *pic = link->cur_pic;
>  
>      draw_box(pic,context,context->color);
>  
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 9796920..5cfe391 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -293,7 +293,7 @@ static int config_input(AVFilterLink *link)
>      yuv_color[2] = pic_ref->data[2][((x) >> (hsub)) + ((y) >> (vsub)) * pic_ref->linesize[2]]; \
>  }
>  
> -static inline void draw_glyph(AVFilterPicRef *pic_ref, FT_Bitmap *bitmap, unsigned int x,
> +static inline void draw_glyph(AVFilterBufferRef *pic_ref, FT_Bitmap *bitmap, unsigned int x,
>                                unsigned int y, unsigned int width, unsigned int height,
>                                unsigned char yuv_fgcolor[4], unsigned char yuv_bgcolor[4],
>                                short int outline, int hsub, int vsub)
> @@ -349,7 +349,7 @@ static inline void draw_glyph(AVFilterPicRef *pic_ref, FT_Bitmap *bitmap, unsign
>      }
>  }
>  
> -static inline void drawbox(AVFilterPicRef *pic_ref, unsigned int x, unsigned int y,
> +static inline void drawbox(AVFilterBufferRef *pic_ref, unsigned int x, unsigned int y,
>                             unsigned int width, unsigned int height,
>                             unsigned char yuv_color[4], int hsub, int vsub)
>  {
> @@ -377,7 +377,7 @@ static inline void drawbox(AVFilterPicRef *pic_ref, unsigned int x, unsigned int
>      }
>  }
>  
> -static void draw_text(AVFilterContext *ctx, AVFilterPicRef *pic_ref, int width, int height)
> +static void draw_text(AVFilterContext *ctx, AVFilterBufferRef *pic_ref, int width, int height)
>  {
>      DrawTextContext *dtext = ctx->priv;
>      FT_Face face = dtext->face;
> @@ -461,7 +461,7 @@ static void draw_text(AVFilterContext *ctx, AVFilterPicRef *pic_ref, int width,
>  static void end_frame(AVFilterLink *link)
>  {
>      AVFilterLink *output = link->dst->outputs[0];
> -    AVFilterPicRef *pic_ref = link->cur_pic;
> +    AVFilterBufferRef *pic_ref = link->cur_pic;
>  
>      draw_text(link->dst, pic_ref, pic_ref->w, pic_ref->h);
>  
> diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
> index 9a75fa4..6888c58 100644
> --- a/libavfilter/vf_fade.c
> +++ b/libavfilter/vf_fade.c
> @@ -100,16 +100,16 @@ static int config_props(AVFilterLink *link)
>      return 0;
>  }
>  
> -static AVFilterPicRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
> +static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
>  {
> -    AVFilterPicRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0],
> +    AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0],
>                                                         perms, w, h);
>      return picref;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
> -    AVFilterPicRef *outpicref = avfilter_ref_pic(picref, ~0);
> +    AVFilterBufferRef *outpicref = avfilter_ref_pic(picref, ~0);
>  
>      link->dst->outputs[0]->outpic = outpicref;
>  
> @@ -133,7 +133,7 @@ static void end_frame(AVFilterLink *link)
>  static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  {
>      FadeContext *fade = link->dst->priv;
> -    AVFilterPicRef *outpic = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic;
>      uint8_t *p;
>      int i, j, plane;
>  
> diff --git a/libavfilter/vf_fifo.c b/libavfilter/vf_fifo.c
> index fe4c657..6c591f5 100644
> --- a/libavfilter/vf_fifo.c
> +++ b/libavfilter/vf_fifo.c
> @@ -23,7 +23,7 @@
>  
>  typedef struct BufPic
>  {
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>      struct BufPic  *next;
>  } BufPic;
>  
> @@ -53,7 +53,7 @@ static av_cold void uninit(AVFilterContext *ctx)
>      }
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      BufferContext *buf = link->dst->priv;
>  
> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
> index ef8d108..6f9be00 100644
> --- a/libavfilter/vf_fps.c
> +++ b/libavfilter/vf_fps.c
> @@ -26,7 +26,7 @@
>  typedef struct {
>      uint64_t timebase;
>      uint64_t pts;
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>      int videoend;
>      int has_frame;
>  } FPSContext;
> @@ -54,7 +54,7 @@ static av_cold void uninit(AVFilterContext *ctx)
>      if(fps->pic) avfilter_unref_pic(fps->pic);
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      FPSContext *fps = link->dst->priv;
>      if(fps->pic) avfilter_unref_pic(fps->pic);
> diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
> index 1c40159..0ae9ec6 100644
> --- a/libavfilter/vf_hflip.c
> +++ b/libavfilter/vf_hflip.c
> @@ -53,8 +53,8 @@ static int config_props(AVFilterLink *link)
>  static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  {
>      FlipContext    *flip = link->dst->priv;
> -    AVFilterPicRef *in   = link->cur_pic;
> -    AVFilterPicRef *out  = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *in   = link->cur_pic;
> +    AVFilterBufferRef *out  = link->dst->outputs[0]->outpic;
>      uint8_t *inrow, *outrow;
>      int i, j, plane;
>  
> diff --git a/libavfilter/vf_negate.c b/libavfilter/vf_negate.c
> index 4a36ce9..c2b31de 100644
> --- a/libavfilter/vf_negate.c
> +++ b/libavfilter/vf_negate.c
> @@ -67,8 +67,8 @@ static int config_props(AVFilterLink *link)
>  static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  {
>      NegContext *neg = link->dst->priv;
> -    AVFilterPicRef *in  = link->cur_pic;
> -    AVFilterPicRef *out = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *in  = link->cur_pic;
> +    AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
>      uint8_t *inrow, *outrow;
>      int i, j, plane;
>  
> diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
> index defc5b8..69d24e8 100644
> --- a/libavfilter/vf_overlay.c
> +++ b/libavfilter/vf_overlay.c
> @@ -50,7 +50,7 @@ typedef struct {
>       *  pics[1][0..1] are pictures for the sub image.
>       *  pics[x][0]    are previously outputted images.
>       *  pics[x][1]    are queued, yet unused frames for each input. */
> -    AVFilterPicRef *pics[2][2];
> +    AVFilterBufferRef *pics[2][2];
>  
>      int bpp;                    //< bytes per pixel
>      int hsub, vsub;             //< chroma subsampling
> @@ -168,7 +168,7 @@ static void shift_input(OverlayContext *over, int idx)
>      over->pics[idx][1] = NULL;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      OverlayContext *over = link->dst->priv;
>      /* There shouldn't be any previous queued frame in this queue */
> @@ -201,8 +201,8 @@ static int lower_timestamp(OverlayContext *over)
>      return (over->pics[0][1]->pts > over->pics[1][1]->pts);
>  }
>  
> -static void copy_image_rgb(AVFilterPicRef *dst, int x, int y,
> -                           AVFilterPicRef *src, int w, int h, int bpp)
> +static void copy_image_rgb(AVFilterBufferRef *dst, int x, int y,
> +                           AVFilterBufferRef *src, int w, int h, int bpp)
>  {
>      AVPicture pic;
>  
> @@ -249,8 +249,8 @@ static void copy_blended(uint8_t* out, int out_linesize,
>      }
>  }
>  
> -static void copy_image_yuv(AVFilterPicRef *dst, int x, int y,
> -                           AVFilterPicRef *src, int w, int h,
> +static void copy_image_yuv(AVFilterBufferRef *dst, int x, int y,
> +                           AVFilterBufferRef *src, int w, int h,
>                             int bpp, int hsub, int vsub)
>  {
>      AVPicture pic;
> @@ -282,8 +282,8 @@ static void copy_image_yuv(AVFilterPicRef *dst, int x, int y,
>      }
>  }
>  
> -static void copy_image(AVFilterPicRef *dst, int x, int y,
> -                       AVFilterPicRef *src, int w, int h,
> +static void copy_image(AVFilterBufferRef *dst, int x, int y,
> +                       AVFilterBufferRef *src, int w, int h,
>                         int bpp, int hsub, int vsub)
>  {
>      if (dst->format == PIX_FMT_YUV420P)
> @@ -294,7 +294,7 @@ static void copy_image(AVFilterPicRef *dst, int x, int y,
>  
>  static int request_frame(AVFilterLink *link)
>  {
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>      OverlayContext *over = link->src->priv;
>      int idx;
>      int x, y, w, h;
> diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
> index bfa2dd5..603f874 100644
> --- a/libavfilter/vf_pad.c
> +++ b/libavfilter/vf_pad.c
> @@ -82,7 +82,7 @@ static int fill_line_with_color(uint8_t *line[4], int line_step[4], int w, uint8
>      return 0;
>  }
>  
> -static void draw_rectangle(AVFilterPicRef *outpic, uint8_t *line[4], int line_step[4],
> +static void draw_rectangle(AVFilterBufferRef *outpic, uint8_t *line[4], int line_step[4],
>                             int hsub, int vsub, int x, int y, int w, int h)
>  {
>      int i, plane;
> @@ -220,11 +220,11 @@ static int config_output(AVFilterLink *outlink)
>      return 0;
>  }
>  
> -static AVFilterPicRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
> +static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
>  {
>      PadContext *pad = inlink->dst->priv;
>  
> -    AVFilterPicRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms,
> +    AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms,
>                                                         w + (pad->w - pad->in_w),
>                                                         h + (pad->h - pad->in_h));
>      int plane;
> @@ -240,10 +240,10 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *inlink, int perms, int w,
>      return picref;
>  }
>  
> -static void start_frame(AVFilterLink *inlink, AVFilterPicRef *inpicref)
> +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
>  {
>      PadContext *pad = inlink->dst->priv;
> -    AVFilterPicRef *outpicref = avfilter_ref_pic(inpicref, ~0);
> +    AVFilterBufferRef *outpicref = avfilter_ref_pic(inpicref, ~0);
>      int plane;
>  
>      inlink->dst->outputs[0]->outpic = outpicref;
> @@ -291,7 +291,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir,
>  static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  {
>      PadContext *pad = link->dst->priv;
> -    AVFilterPicRef *outpic = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic;
>  
>      y += pad->y;
>  
> @@ -426,7 +426,7 @@ static int color_config_props(AVFilterLink *inlink)
>  static int color_request_frame(AVFilterLink *link)
>  {
>      ColorContext *color = link->src->priv;
> -    AVFilterPicRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
> +    AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
>      picref->pixel_aspect = (AVRational) {1, 1};
>      picref->pts          = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q);
>      picref->pos          = 0;
> diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c
> index 179e2a8..c9397b5 100644
> --- a/libavfilter/vf_pixdesctest.c
> +++ b/libavfilter/vf_pixdesctest.c
> @@ -48,11 +48,11 @@ static int config_props(AVFilterLink *inlink)
>      return 0;
>  }
>  
> -static void start_frame(AVFilterLink *inlink, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
>  {
>      PixdescTestContext *priv = inlink->dst->priv;
>      AVFilterLink *outlink    = inlink->dst->outputs[0];
> -    AVFilterPicRef *outpicref;
> +    AVFilterBufferRef *outpicref;
>      int i;
>  
>      outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
> @@ -80,8 +80,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterPicRef *picref)
>  static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
>  {
>      PixdescTestContext *priv = inlink->dst->priv;
> -    AVFilterPicRef *inpic    = inlink->cur_pic;
> -    AVFilterPicRef *outpic   = inlink->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *inpic    = inlink->cur_pic;
> +    AVFilterBufferRef *outpic   = inlink->dst->outputs[0]->outpic;
>      int i, c, w = inlink->w;
>  
>      for (c = 0; c < priv->pix_desc->nb_components; c++) {
> diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
> index fe085e4..7b8d725 100644
> --- a/libavfilter/vf_rotate.c
> +++ b/libavfilter/vf_rotate.c
> @@ -112,8 +112,8 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  static void end_frame(AVFilterLink *link)
>  {
>      RotContext *rot = link->dst->priv;
> -    AVFilterPicRef *in  = link->cur_pic;
> -    AVFilterPicRef *out = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *in  = link->cur_pic;
> +    AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
>      int i, j, plane;
>  
>      /* luma plane */
> @@ -163,7 +163,7 @@ static void end_frame(AVFilterLink *link)
>      avfilter_unref_pic(out);
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      AVFilterLink *out = link->dst->outputs[0];
>  
> diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> index c75cf7c..4608de5 100644
> --- a/libavfilter/vf_scale.c
> +++ b/libavfilter/vf_scale.c
> @@ -142,11 +142,11 @@ static int config_props(AVFilterLink *outlink)
>      return !scale->sws;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      ScaleContext *scale = link->dst->priv;
>      AVFilterLink *outlink = link->dst->outputs[0];
> -    AVFilterPicRef *outpicref;
> +    AVFilterBufferRef *outpicref;
>  
>      scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
>      scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
> @@ -169,7 +169,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
>  {
>      ScaleContext *scale = link->dst->priv;
>      int out_h;
> -    AVFilterPicRef *cur_pic = link->cur_pic;
> +    AVFilterBufferRef *cur_pic = link->cur_pic;
>      const uint8_t *data[4];
>  
>      if (scale->slice_y == 0 && slice_dir == -1)
> diff --git a/libavfilter/vf_setpts.c b/libavfilter/vf_setpts.c
> index 8e1c104..050ae55 100644
> --- a/libavfilter/vf_setpts.c
> +++ b/libavfilter/vf_setpts.c
> @@ -90,16 +90,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
>      return !setpts->expr;
>  }
>  
> -static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
> +static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
>                                          int w, int h)
>  {
>      return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      SetPTSContext *setpts = link->dst->priv;
> -    AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
> +    AVFilterBufferRef *ref2 = avfilter_ref_pic(picref, ~0);
>  
>  
>      if (setpts->const_values[POV_STARTPTS] == AV_NOPTS_VALUE)
> diff --git a/libavfilter/vf_slicify.c b/libavfilter/vf_slicify.c
> index 35e05da..dadfd26 100644
> --- a/libavfilter/vf_slicify.c
> +++ b/libavfilter/vf_slicify.c
> @@ -57,7 +57,7 @@ static int config_props(AVFilterLink *link)
>      return 0;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      SliceContext *slice = link->dst->priv;
>  
> diff --git a/libavfilter/vf_split.c b/libavfilter/vf_split.c
> index 2acb6ea..0742210 100644
> --- a/libavfilter/vf_split.c
> +++ b/libavfilter/vf_split.c
> @@ -21,7 +21,7 @@
>  
>  #include "avfilter.h"
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      avfilter_start_frame(link->dst->outputs[0],
>                           avfilter_ref_pic(picref, ~AV_PERM_WRITE));
> diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
> index a9c4e13..21b5dd9 100644
> --- a/libavfilter/vf_transpose.c
> +++ b/libavfilter/vf_transpose.c
> @@ -67,9 +67,9 @@ static int config_props_output(AVFilterLink *link)
>  static void end_frame(AVFilterLink *link)
>  {
>      TransContext *trans = link->dst->priv;
> -    AVFilterPicRef *in  = link->cur_pic;
> -    AVFilterPicRef *out = link->dst->outputs[0]->outpic;
> -    AVFilterPicRef *pic = link->cur_pic;
> +    AVFilterBufferRef *in  = link->cur_pic;
> +    AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *pic = link->cur_pic;
>      AVFilterLink *output = link->dst->outputs[0];
>      int i, j, plane;
>  
> @@ -94,7 +94,7 @@ static void end_frame(AVFilterLink *link)
>      avfilter_unref_pic(out);
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      AVFilterLink *out = link->dst->outputs[0];
>  
> diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
> index d2314a3..81d950e 100644
> --- a/libavfilter/vf_unsharp.c
> +++ b/libavfilter/vf_unsharp.c
> @@ -195,8 +195,8 @@ static av_cold void uninit(AVFilterContext *ctx)
>  static void end_frame(AVFilterLink *link)
>  {
>      UnsharpContext *unsharp = link->dst->priv;
> -    AVFilterPicRef *in  = link->cur_pic;
> -    AVFilterPicRef *out = link->dst->outputs[0]->outpic;
> +    AVFilterBufferRef *in  = link->cur_pic;
> +    AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
>  
>      unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w,            link->h,             &unsharp->luma);
>      unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);
> diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
> index 0dfcb35..9d5d75f 100644
> --- a/libavfilter/vf_vflip.c
> +++ b/libavfilter/vf_vflip.c
> @@ -39,13 +39,13 @@ static int config_input(AVFilterLink *link)
>      return 0;
>  }
>  
> -static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
> +static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
>                                          int w, int h)
>  {
>      FlipContext *flip = link->dst->priv;
>      int i;
>  
> -    AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
> +    AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
>                                                         perms, w, h);
>  
>      for (i = 0; i < 4; i ++) {
> @@ -60,7 +60,7 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
>      return picref;
>  }
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>      FlipContext *flip = link->dst->priv;
>      int i;
> diff --git a/libavfilter/vsink_nullsink.c b/libavfilter/vsink_nullsink.c
> index d11912f..1dea200 100644
> --- a/libavfilter/vsink_nullsink.c
> +++ b/libavfilter/vsink_nullsink.c
> @@ -18,7 +18,7 @@
>  
>  #include "avfilter.h"
>  
> -static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
> +static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
>  {
>  }
>  
> diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c
> index 57dea94..aa7cb45 100644
> --- a/libavfilter/vsrc_buffer.c
> +++ b/libavfilter/vsrc_buffer.c
> @@ -105,7 +105,7 @@ static int config_props(AVFilterLink *link)
>  static int request_frame(AVFilterLink *link)
>  {
>      BufferSourceContext *c = link->src->priv;
> -    AVFilterPicRef *picref;
> +    AVFilterBufferRef *picref;
>  
>      if (!c->has_frame) {
>          av_log(link->src, AV_LOG_ERROR,
> diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
> index 8286535..e617e43 100644
> --- a/libavfilter/vsrc_movie.c
> +++ b/libavfilter/vsrc_movie.c
> @@ -40,7 +40,7 @@ typedef struct {
>      AVFrame          *frame;
>  
>      int w, h;
> -    AVFilterPicRef *pic;
> +    AVFilterBufferRef *pic;
>  } MovieContext;
>  
>  static int movie_init(AVFilterContext *ctx)
> @@ -219,7 +219,7 @@ static int movie_get_frame(AVFilterLink *link)
>  
>  static int request_frame(AVFilterLink *link)
>  {
> -    AVFilterPicRef *out;
> +    AVFilterBufferRef *out;
>      MovieContext *mv = link->src->priv;
>  
>      movie_get_frame(link);

Looks fine to me.


More information about the FFmpeg-soc mailing list