Commit b9609848 authored by Stefano Sabatini's avatar Stefano Sabatini

Implement the avfilter_default_draw_slice() handler and use it in

avfilter_draw_slice() when the draw_slice callback is not defined in
the input pad.

Originally committed as revision 16554 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b507ebd1
...@@ -250,6 +250,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h) ...@@ -250,6 +250,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h)
{ {
uint8_t *src[4], *dst[4]; uint8_t *src[4], *dst[4];
int i, j, hsub, vsub; int i, j, hsub, vsub;
void (*draw_slice)(AVFilterLink *, int, int);
/* copy the slice if needed for permission reasons */ /* copy the slice if needed for permission reasons */
if(link->srcpic) { if(link->srcpic) {
...@@ -279,8 +280,9 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h) ...@@ -279,8 +280,9 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h)
} }
} }
if(link_dpad(link).draw_slice) if(!(draw_slice = link_dpad(link).draw_slice))
link_dpad(link).draw_slice(link, y, h); draw_slice = avfilter_default_draw_slice;
draw_slice(link, y, h);
} }
AVFilter *avfilter_get_by_name(const char *name) AVFilter *avfilter_get_by_name(const char *name)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define AVFILTER_AVFILTER_H #define AVFILTER_AVFILTER_H
#define LIBAVFILTER_VERSION_MAJOR 0 #define LIBAVFILTER_VERSION_MAJOR 0
#define LIBAVFILTER_VERSION_MINOR 1 #define LIBAVFILTER_VERSION_MINOR 2
#define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...@@ -349,6 +349,8 @@ struct AVFilterPad ...@@ -349,6 +349,8 @@ struct AVFilterPad
/** default handler for start_frame() for video inputs */ /** default handler for start_frame() for video inputs */
void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref); void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
/** default handler for draw_slice() for video inputs */
void avfilter_default_draw_slice(AVFilterLink *link, int y, int h);
/** default handler for end_frame() for video inputs */ /** default handler for end_frame() for video inputs */
void avfilter_default_end_frame(AVFilterLink *link); void avfilter_default_end_frame(AVFilterLink *link);
/** default handler for config_props() for video outputs */ /** default handler for config_props() for video outputs */
......
...@@ -82,6 +82,17 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref) ...@@ -82,6 +82,17 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
} }
} }
void avfilter_default_draw_slice(AVFilterLink *link, int y, int h)
{
AVFilterLink *out = NULL;
if(link->dst->output_count)
out = link->dst->outputs[0];
if(out)
avfilter_draw_slice(out, y, h);
}
void avfilter_default_end_frame(AVFilterLink *link) void avfilter_default_end_frame(AVFilterLink *link)
{ {
AVFilterLink *out = NULL; AVFilterLink *out = NULL;
......
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