Rename AVFilterPicRef to AVFilterBufferRef.

The struct is going to be used for storing audio buffer references as
well, and the new name is more generic.

Patch by S.N. Hemanth Meenakshisundaram @smeenaks@ucsd@edu@.

Originally committed as revision 24730 to svn://svn.ffmpeg.org/ffmpeg/trunk
oldabi
S.N. Hemanth Meenakshisundaram 15 years ago committed by Stefano Sabatini
parent e11b104a68
commit ecc8dada37
  1. 6
      ffmpeg.c
  2. 10
      ffplay.c
  3. 16
      libavfilter/avfilter.c
  4. 36
      libavfilter/avfilter.h
  5. 10
      libavfilter/defaults.c
  6. 2
      libavfilter/internal.h
  7. 2
      libavfilter/vf_aspect.c
  8. 4
      libavfilter/vf_crop.c
  9. 14
      libavfilter/vf_pad.c
  10. 8
      libavfilter/vf_pixdesctest.c
  11. 6
      libavfilter/vf_scale.c
  12. 2
      libavfilter/vf_slicify.c
  13. 4
      libavfilter/vf_unsharp.c
  14. 6
      libavfilter/vf_vflip.c
  15. 2
      libavfilter/vsink_nullsink.c
  16. 2
      libavfilter/vsrc_buffer.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;

@ -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;

@ -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);

@ -25,7 +25,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 28
#define LIBAVFILTER_VERSION_MINOR 29
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@ -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;
@ -139,14 +139,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
@ -323,7 +323,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
@ -331,7 +331,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
@ -388,7 +388,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 */
@ -398,7 +398,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
@ -410,7 +410,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);
@ -419,7 +419,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);
/**
@ -530,10 +530,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;
};
/**
@ -564,7 +564,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);
/**
@ -590,7 +590,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.

@ -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);
}

@ -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);

@ -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;

@ -129,10 +129,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;

@ -83,7 +83,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;
@ -221,11 +221,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;
@ -241,10 +241,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;
@ -292,7 +292,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;
@ -427,7 +427,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;

@ -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++) {

@ -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)

@ -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;

@ -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);

@ -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;

@ -18,7 +18,7 @@
#include "avfilter.h"
static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
{
}

@ -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,

Loading…
Cancel
Save