lavfi: switch to AVFrame.

Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
This commit is contained in:
Anton Khirnov
2012-11-28 08:41:07 +01:00
parent 77b2cd7b41
commit 7e350379f8
59 changed files with 1061 additions and 942 deletions

View File

@ -43,33 +43,29 @@ static int config_input(AVFilterLink *link)
return 0;
}
static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
int w, int h)
static AVFrame *get_video_buffer(AVFilterLink *link, int w, int h)
{
FlipContext *flip = link->dst->priv;
AVFilterBufferRef *picref;
AVFrame *frame;
int i;
if (!(perms & AV_PERM_NEG_LINESIZES))
return ff_default_get_video_buffer(link, perms, w, h);
picref = ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
if (!picref)
frame = ff_get_video_buffer(link->dst->outputs[0], w, h);
if (!frame)
return NULL;
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
if (picref->data[i]) {
picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];
picref->linesize[i] = -picref->linesize[i];
if (frame->data[i]) {
frame->data[i] += ((h >> vsub) - 1) * frame->linesize[i];
frame->linesize[i] = -frame->linesize[i];
}
}
return picref;
return frame;
}
static int filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
static int filter_frame(AVFilterLink *link, AVFrame *frame)
{
FlipContext *flip = link->dst->priv;
int i;