diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-12-06 13:50:27 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-12-06 13:51:34 +0100 |
commit | c3fa6add58288dda34c88a6c0c9e0cc79f29169b (patch) | |
tree | e0ed68be17afcef4b47239155ca714f430b48f7c /libavfilter/vf_field.c | |
parent | 3942294fd595942dbc04b912ea6e2bbbd07464b8 (diff) | |
download | ffmpeg-c3fa6add58288dda34c88a6c0c9e0cc79f29169b.tar.gz |
lavfi/field: switch to filter_frame API
Diffstat (limited to 'libavfilter/vf_field.c')
-rw-r--r-- | libavfilter/vf_field.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/libavfilter/vf_field.c b/libavfilter/vf_field.c index c9ac42b20a..67c00258f3 100644 --- a/libavfilter/vf_field.c +++ b/libavfilter/vf_field.c @@ -82,33 +82,21 @@ static int config_props_output(AVFilterLink *outlink) return 0; } -static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) { FieldContext *field = inlink->dst->priv; - AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); AVFilterLink *outlink = inlink->dst->outputs[0]; int i; - if (!outpicref) - return AVERROR(ENOMEM); - - outpicref->video->h = outlink->h; - outpicref->video->interlaced = 0; + inpicref->video->h = outlink->h; + inpicref->video->interlaced = 0; for (i = 0; i < field->nb_planes; i++) { if (field->type == FIELD_TYPE_BOTTOM) - outpicref->data[i] = inpicref->data[i] + inpicref->linesize[i]; - outpicref->linesize[i] = 2 * inpicref->linesize[i]; + inpicref->data[i] = inpicref->data[i] + inpicref->linesize[i]; + inpicref->linesize[i] = 2 * inpicref->linesize[i]; } - return ff_start_frame(outlink, outpicref); -} - -static int draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) -{ - FieldContext *field = inlink->dst->priv; - int y1 = (y + (field->type == FIELD_TYPE_TOP)) / 2; - int h1 = (h + (field->type == FIELD_TYPE_TOP)) / 2; - return ff_draw_slice(inlink->dst->outputs[0], y1, h1, slice_dir); + return ff_filter_frame(outlink, inpicref); } static const AVFilterPad field_inputs[] = { @@ -116,9 +104,7 @@ static const AVFilterPad field_inputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = ff_null_get_video_buffer, - .start_frame = start_frame, - .draw_slice = draw_slice, - .end_frame = ff_null_end_frame, + .filter_frame = filter_frame, }, { NULL } }; |