summaryrefslogtreecommitdiff
path: root/libavfilter/vf_transpose.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-28 08:41:07 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 07:37:18 +0100
commit7e350379f87e7f74420b4813170fe808e2313911 (patch)
tree031201839361d40af8b4c829f9c9f179e7d9f58d /libavfilter/vf_transpose.c
parent77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff)
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead.
Diffstat (limited to 'libavfilter/vf_transpose.c')
-rw-r--r--libavfilter/vf_transpose.c25
1 files changed, 12 insertions, 13 deletions
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 }
};