Commit 3628fbe0 authored by Vitor Sessak's avatar Vitor Sessak

Adjust the default start_frame() and end_frame() implementations to simplify

the implementation of simple filters.

Commited in SoC by Bobby Bingham on 2007-07-08 16:48:15

Originally committed as revision 11982 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 72e3037a
...@@ -64,13 +64,28 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms) ...@@ -64,13 +64,28 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref) void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
{ {
AVFilterLink *out = link->dst->outputs[0];
link->cur_pic = picref; link->cur_pic = picref;
if(out) {
out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE);
avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
}
} }
void avfilter_default_end_frame(AVFilterLink *link) void avfilter_default_end_frame(AVFilterLink *link)
{ {
AVFilterLink *out = link->dst->outputs[0];
avfilter_unref_pic(link->cur_pic); avfilter_unref_pic(link->cur_pic);
link->cur_pic = NULL; link->cur_pic = NULL;
if(out) {
avfilter_unref_pic(out->outpic);
out->outpic = NULL;
avfilter_end_frame(out);
}
} }
AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask) AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)
......
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