From 7e350379f87e7f74420b4813170fe808e2313911 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 28 Nov 2012 08:41:07 +0100 Subject: lavfi: switch to AVFrame. Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead. --- libavfilter/vf_transpose.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'libavfilter/vf_transpose.c') diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index d7a173989f..d1a77c4bfd 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -121,35 +121,35 @@ static int config_props_output(AVFilterLink *outlink) return 0; } -static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in) +static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterLink *outlink = inlink->dst->outputs[0]; TransContext *trans = inlink->dst->priv; - AVFilterBufferRef *out; + AVFrame *out; int plane; - out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); + out = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!out) { - avfilter_unref_bufferp(&in); + av_frame_free(&in); return AVERROR(ENOMEM); } out->pts = in->pts; - if (in->video->pixel_aspect.num == 0) { - out->video->pixel_aspect = in->video->pixel_aspect; + if (in->sample_aspect_ratio.num == 0) { + out->sample_aspect_ratio = in->sample_aspect_ratio; } else { - out->video->pixel_aspect.num = in->video->pixel_aspect.den; - out->video->pixel_aspect.den = in->video->pixel_aspect.num; + out->sample_aspect_ratio.num = in->sample_aspect_ratio.den; + out->sample_aspect_ratio.den = in->sample_aspect_ratio.num; } for (plane = 0; out->data[plane]; plane++) { int hsub = plane == 1 || plane == 2 ? trans->hsub : 0; int vsub = plane == 1 || plane == 2 ? trans->vsub : 0; int pixstep = trans->pixsteps[plane]; - int inh = in->video->h>>vsub; - int outw = out->video->w>>hsub; - int outh = out->video->h>>vsub; + int inh = in->height >> vsub; + int outw = out->width >> hsub; + int outh = out->height >> vsub; uint8_t *dst, *src; int dstlinesize, srclinesize; int x, y; @@ -194,7 +194,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in) } } - avfilter_unref_bufferp(&in); + av_frame_free(&in); return ff_filter_frame(outlink, out); } @@ -203,7 +203,6 @@ static const AVFilterPad avfilter_vf_transpose_inputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, - .min_perms = AV_PERM_READ, }, { NULL } }; -- cgit v1.2.3