Commit 5d4890d7 authored by S.N. Hemanth Meenakshisundaram's avatar S.N. Hemanth Meenakshisundaram Committed by Stefano Sabatini

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
parent 7fce481a
......@@ -368,10 +368,10 @@ static int get_filtered_video_pic(AVFilterContext *ctx,
if(avfilter_request_frame(ctx->inputs[0]))
return -1;
if(!(pic = ctx->inputs[0]->cur_pic))
if(!(pic = ctx->inputs[0]->cur_buf))
return -1;
*picref = pic;
ctx->inputs[0]->cur_pic = NULL;
ctx->inputs[0]->cur_buf = NULL;
*pts = pic->pts;
......
......@@ -1745,9 +1745,9 @@ static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
if(avfilter_request_frame(ctx->inputs[0]))
return -1;
if(!(pic = ctx->inputs[0]->cur_pic))
if(!(pic = ctx->inputs[0]->cur_buf))
return -1;
ctx->inputs[0]->cur_pic = NULL;
ctx->inputs[0]->cur_buf = NULL;
frame->opaque = pic;
*pts = pic->pts;
......
......@@ -262,14 +262,14 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
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->srcpic = picref;
avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic);
link->cur_buf = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
link->src_buf = picref;
avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
}
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)
......@@ -283,9 +283,9 @@ void avfilter_end_frame(AVFilterLink *link)
/* unreference the source picture if we're feeding the destination filter
* a copied version dues to permission issues */
if(link->srcpic) {
avfilter_unref_buffer(link->srcpic);
link->srcpic = NULL;
if(link->src_buf) {
avfilter_unref_buffer(link->src_buf);
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);
/* 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;
for(i = 0; i < 4; i ++) {
if(link->srcpic->data[i]) {
src[i] = link->srcpic-> data[i] +
(y >> (i==0 ? 0 : vsub)) * link->srcpic-> linesize[i];
dst[i] = link->cur_pic->data[i] +
(y >> (i==0 ? 0 : vsub)) * link->cur_pic->linesize[i];
if(link->src_buf->data[i]) {
src[i] = link->src_buf-> data[i] +
(y >> (i==0 ? 0 : vsub)) * link->src_buf-> linesize[i];
dst[i] = link->cur_buf->data[i] +
(y >> (i==0 ? 0 : vsub)) * link->cur_buf->linesize[i];
} else
src[i] = dst[i] = NULL;
}
for(i = 0; i < 4; i ++) {
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;
for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {
memcpy(dst[i], src[i], planew);
src[i] += link->srcpic ->linesize[i];
dst[i] += link->cur_pic->linesize[i];
src[i] += link->src_buf ->linesize[i];
dst[i] += link->cur_buf->linesize[i];
}
}
}
......
......@@ -25,7 +25,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 30
#define LIBAVFILTER_VERSION_MINOR 31
#define LIBAVFILTER_VERSION_MICRO 0
#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
* filters.
*/
AVFilterBufferRef *srcpic;
AVFilterBufferRef *src_buf;
AVFilterBufferRef *cur_pic;
AVFilterBufferRef *outpic;
AVFilterBufferRef *cur_buf;
AVFilterBufferRef *out_buf;
};
/**
......
......@@ -73,9 +73,9 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
out = link->dst->outputs[0];
if(out) {
out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
avfilter_copy_buffer_ref_props(out->outpic, picref);
avfilter_start_frame(out, avfilter_ref_buffer(out->outpic, ~0));
out->out_buf = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
avfilter_copy_buffer_ref_props(out->out_buf, picref);
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)
out = link->dst->outputs[0];
avfilter_unref_buffer(link->cur_pic);
link->cur_pic = NULL;
avfilter_unref_buffer(link->cur_buf);
link->cur_buf = NULL;
if(out) {
if(out->outpic) {
avfilter_unref_buffer(out->outpic);
out->outpic = NULL;
if(out->out_buf) {
avfilter_unref_buffer(out->out_buf);
out->out_buf = NULL;
}
avfilter_end_frame(out);
}
......
......@@ -247,7 +247,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int plane;
inlink->dst->outputs[0]->outpic = outpicref;
inlink->dst->outputs[0]->out_buf = outpicref;
for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
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)
{
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)
......@@ -282,7 +282,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir,
}
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,
0, bar_y, pad->w, bar_h);
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)
{
PadContext *pad = link->dst->priv;
AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic;
AVFilterBufferRef *outpic = link->dst->outputs[0]->out_buf;
y += pad->y;
......
......@@ -55,9 +55,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
AVFilterBufferRef *outpicref;
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);
outpicref = outlink->outpic;
outpicref = outlink->out_buf;
avfilter_copy_buffer_ref_props(outpicref, picref);
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)
{
PixdescTestContext *priv = inlink->dst->priv;
AVFilterBufferRef *inpic = inlink->cur_pic;
AVFilterBufferRef *outpic = inlink->dst->outputs[0]->outpic;
AVFilterBufferRef *inpic = inlink->cur_buf;
AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf;
int i, c, w = inlink->w;
for (c = 0; c < priv->pix_desc->nb_components; c++) {
......
......@@ -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);
avfilter_copy_buffer_ref_props(outpicref, picref);
outlink->outpic = outpicref;
outlink->out_buf = outpicref;
av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,
(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;
int out_h;
AVFilterBufferRef *cur_pic = link->cur_pic;
AVFilterBufferRef *cur_pic = link->cur_buf;
const uint8_t *data[4];
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];
out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,
link->dst->outputs[0]->outpic->data,
link->dst->outputs[0]->outpic->linesize);
link->dst->outputs[0]->out_buf->data,
link->dst->outputs[0]->out_buf->linesize);
if (slice_dir == -1)
scale->slice_y -= out_h;
......
......@@ -195,8 +195,8 @@ static av_cold void uninit(AVFilterContext *ctx)
static void end_frame(AVFilterLink *link)
{
UnsharpContext *unsharp = link->dst->priv;
AVFilterBufferRef *in = link->cur_pic;
AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
AVFilterBufferRef *in = link->cur_buf;
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[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment