Rename fields:

AVFilterLink.srcpic    ->  AVFilterLink.src_buf
AVFilterLink.cur_pic   ->  AVFilterLink.cur_buf
AVFilterLink.outpic    ->  AVFilterLink.out_buf

The new names are more generic and more consistent, since the struct
they contain, which was named AVFilterPicRef, has been renamed to
AVFilterBufferRef.

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

Originally committed as revision 24732 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
S.N. Hemanth Meenakshisundaram 2010-08-07 01:15:34 +00:00 committed by Stefano Sabatini
parent 7fce481a69
commit 5d4890d73d
9 changed files with 47 additions and 47 deletions

View File

@ -368,10 +368,10 @@ static int get_filtered_video_pic(AVFilterContext *ctx,
if(avfilter_request_frame(ctx->inputs[0])) if(avfilter_request_frame(ctx->inputs[0]))
return -1; return -1;
if(!(pic = ctx->inputs[0]->cur_pic)) if(!(pic = ctx->inputs[0]->cur_buf))
return -1; return -1;
*picref = pic; *picref = pic;
ctx->inputs[0]->cur_pic = NULL; ctx->inputs[0]->cur_buf = NULL;
*pts = pic->pts; *pts = pic->pts;

View File

@ -1745,9 +1745,9 @@ static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
if(avfilter_request_frame(ctx->inputs[0])) if(avfilter_request_frame(ctx->inputs[0]))
return -1; return -1;
if(!(pic = ctx->inputs[0]->cur_pic)) if(!(pic = ctx->inputs[0]->cur_buf))
return -1; return -1;
ctx->inputs[0]->cur_pic = NULL; ctx->inputs[0]->cur_buf = NULL;
frame->opaque = pic; frame->opaque = pic;
*pts = pic->pts; *pts = pic->pts;

View File

@ -262,14 +262,14 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
link_dpad(link).min_perms, link_dpad(link).rej_perms); link_dpad(link).min_perms, link_dpad(link).rej_perms);
*/ */
link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h); link->cur_buf = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
link->srcpic = picref; link->src_buf = picref;
avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic); avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
} }
else else
link->cur_pic = picref; link->cur_buf = picref;
start_frame(link, link->cur_pic); start_frame(link, link->cur_buf);
} }
void avfilter_end_frame(AVFilterLink *link) void avfilter_end_frame(AVFilterLink *link)
@ -283,9 +283,9 @@ void avfilter_end_frame(AVFilterLink *link)
/* unreference the source picture if we're feeding the destination filter /* unreference the source picture if we're feeding the destination filter
* a copied version dues to permission issues */ * a copied version dues to permission issues */
if(link->srcpic) { if(link->src_buf) {
avfilter_unref_buffer(link->srcpic); avfilter_unref_buffer(link->src_buf);
link->srcpic = NULL; link->src_buf = NULL;
} }
} }
@ -299,29 +299,29 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir); FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
/* copy the slice if needed for permission reasons */ /* copy the slice if needed for permission reasons */
if(link->srcpic) { if(link->src_buf) {
vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
for(i = 0; i < 4; i ++) { for(i = 0; i < 4; i ++) {
if(link->srcpic->data[i]) { if(link->src_buf->data[i]) {
src[i] = link->srcpic-> data[i] + src[i] = link->src_buf-> data[i] +
(y >> (i==0 ? 0 : vsub)) * link->srcpic-> linesize[i]; (y >> (i==0 ? 0 : vsub)) * link->src_buf-> linesize[i];
dst[i] = link->cur_pic->data[i] + dst[i] = link->cur_buf->data[i] +
(y >> (i==0 ? 0 : vsub)) * link->cur_pic->linesize[i]; (y >> (i==0 ? 0 : vsub)) * link->cur_buf->linesize[i];
} else } else
src[i] = dst[i] = NULL; src[i] = dst[i] = NULL;
} }
for(i = 0; i < 4; i ++) { for(i = 0; i < 4; i ++) {
int planew = int planew =
ff_get_plane_bytewidth(link->format, link->cur_pic->w, i); ff_get_plane_bytewidth(link->format, link->cur_buf->w, i);
if(!src[i]) continue; if(!src[i]) continue;
for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) { for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {
memcpy(dst[i], src[i], planew); memcpy(dst[i], src[i], planew);
src[i] += link->srcpic ->linesize[i]; src[i] += link->src_buf ->linesize[i];
dst[i] += link->cur_pic->linesize[i]; dst[i] += link->cur_buf->linesize[i];
} }
} }
} }

View File

@ -25,7 +25,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 30 #define LIBAVFILTER_VERSION_MINOR 31
#define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@ -530,10 +530,10 @@ struct AVFilterLink
* for the destination. This should not be accessed directly by the * for the destination. This should not be accessed directly by the
* filters. * filters.
*/ */
AVFilterBufferRef *srcpic; AVFilterBufferRef *src_buf;
AVFilterBufferRef *cur_pic; AVFilterBufferRef *cur_buf;
AVFilterBufferRef *outpic; AVFilterBufferRef *out_buf;
}; };
/** /**

View File

@ -73,9 +73,9 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
out = link->dst->outputs[0]; out = link->dst->outputs[0];
if(out) { if(out) {
out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h); out->out_buf = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
avfilter_copy_buffer_ref_props(out->outpic, picref); avfilter_copy_buffer_ref_props(out->out_buf, picref);
avfilter_start_frame(out, avfilter_ref_buffer(out->outpic, ~0)); avfilter_start_frame(out, avfilter_ref_buffer(out->out_buf, ~0));
} }
} }
@ -97,13 +97,13 @@ void avfilter_default_end_frame(AVFilterLink *link)
if(link->dst->output_count) if(link->dst->output_count)
out = link->dst->outputs[0]; out = link->dst->outputs[0];
avfilter_unref_buffer(link->cur_pic); avfilter_unref_buffer(link->cur_buf);
link->cur_pic = NULL; link->cur_buf = NULL;
if(out) { if(out) {
if(out->outpic) { if(out->out_buf) {
avfilter_unref_buffer(out->outpic); avfilter_unref_buffer(out->out_buf);
out->outpic = NULL; out->out_buf = NULL;
} }
avfilter_end_frame(out); avfilter_end_frame(out);
} }

View File

@ -247,7 +247,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int plane; int plane;
inlink->dst->outputs[0]->outpic = outpicref; inlink->dst->outputs[0]->out_buf = outpicref;
for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) { for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0; int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
@ -263,7 +263,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static void end_frame(AVFilterLink *link) static void end_frame(AVFilterLink *link)
{ {
avfilter_end_frame(link->dst->outputs[0]); avfilter_end_frame(link->dst->outputs[0]);
avfilter_unref_buffer(link->cur_pic); avfilter_unref_buffer(link->cur_buf);
} }
static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice) static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice)
@ -282,7 +282,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir,
} }
if (bar_h) { if (bar_h) {
draw_rectangle(link->dst->outputs[0]->outpic, draw_rectangle(link->dst->outputs[0]->out_buf,
pad->line, pad->line_step, pad->hsub, pad->vsub, pad->line, pad->line_step, pad->hsub, pad->vsub,
0, bar_y, pad->w, bar_h); 0, bar_y, pad->w, bar_h);
avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir); avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir);
@ -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) static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{ {
PadContext *pad = link->dst->priv; PadContext *pad = link->dst->priv;
AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic; AVFilterBufferRef *outpic = link->dst->outputs[0]->out_buf;
y += pad->y; y += pad->y;

View File

@ -55,9 +55,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
AVFilterBufferRef *outpicref; AVFilterBufferRef *outpicref;
int i; int i;
outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
outlink->w, outlink->h); outlink->w, outlink->h);
outpicref = outlink->outpic; outpicref = outlink->out_buf;
avfilter_copy_buffer_ref_props(outpicref, picref); avfilter_copy_buffer_ref_props(outpicref, picref);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
@ -80,8 +80,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
{ {
PixdescTestContext *priv = inlink->dst->priv; PixdescTestContext *priv = inlink->dst->priv;
AVFilterBufferRef *inpic = inlink->cur_pic; AVFilterBufferRef *inpic = inlink->cur_buf;
AVFilterBufferRef *outpic = inlink->dst->outputs[0]->outpic; AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf;
int i, c, w = inlink->w; int i, c, w = inlink->w;
for (c = 0; c < priv->pix_desc->nb_components; c++) { for (c = 0; c < priv->pix_desc->nb_components; c++) {

View File

@ -154,7 +154,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
avfilter_copy_buffer_ref_props(outpicref, picref); avfilter_copy_buffer_ref_props(outpicref, picref);
outlink->outpic = outpicref; outlink->out_buf = outpicref;
av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den, av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,
(int64_t)picref->pixel_aspect.num * outlink->h * link->w, (int64_t)picref->pixel_aspect.num * outlink->h * link->w,
@ -169,7 +169,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{ {
ScaleContext *scale = link->dst->priv; ScaleContext *scale = link->dst->priv;
int out_h; int out_h;
AVFilterBufferRef *cur_pic = link->cur_pic; AVFilterBufferRef *cur_pic = link->cur_buf;
const uint8_t *data[4]; const uint8_t *data[4];
if (scale->slice_y == 0 && slice_dir == -1) if (scale->slice_y == 0 && slice_dir == -1)
@ -183,8 +183,8 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
data[3] = cur_pic->data[3] + y * cur_pic->linesize[3]; data[3] = cur_pic->data[3] + y * cur_pic->linesize[3];
out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h, out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,
link->dst->outputs[0]->outpic->data, link->dst->outputs[0]->out_buf->data,
link->dst->outputs[0]->outpic->linesize); link->dst->outputs[0]->out_buf->linesize);
if (slice_dir == -1) if (slice_dir == -1)
scale->slice_y -= out_h; scale->slice_y -= out_h;

View File

@ -195,8 +195,8 @@ static av_cold void uninit(AVFilterContext *ctx)
static void end_frame(AVFilterLink *link) static void end_frame(AVFilterLink *link)
{ {
UnsharpContext *unsharp = link->dst->priv; UnsharpContext *unsharp = link->dst->priv;
AVFilterBufferRef *in = link->cur_pic; AVFilterBufferRef *in = link->cur_buf;
AVFilterBufferRef *out = link->dst->outputs[0]->outpic; AVFilterBufferRef *out = link->dst->outputs[0]->out_buf;
unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w, link->h, &unsharp->luma); 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); unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);