lavfi: remove some draw_slice related code that has become unneeded
Reviewed-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -421,7 +421,7 @@ int avfilter_register(AVFilter *filter)
|
|||||||
for(i=0; filter->inputs && filter->inputs[i].name; i++) {
|
for(i=0; filter->inputs && filter->inputs[i].name; i++) {
|
||||||
const AVFilterPad *input = &filter->inputs[i];
|
const AVFilterPad *input = &filter->inputs[i];
|
||||||
av_assert0( !input->filter_frame
|
av_assert0( !input->filter_frame
|
||||||
|| (!input->start_frame && !input->end_frame && !input->draw_slice));
|
|| (!input->start_frame && !input->end_frame));
|
||||||
}
|
}
|
||||||
|
|
||||||
registered_avfilters[next_registered_avfilter_idx++] = filter;
|
registered_avfilters[next_registered_avfilter_idx++] = filter;
|
||||||
|
|||||||
@@ -127,16 +127,6 @@ struct AVFilterPad {
|
|||||||
*/
|
*/
|
||||||
int (*end_frame)(AVFilterLink *link);
|
int (*end_frame)(AVFilterLink *link);
|
||||||
|
|
||||||
/**
|
|
||||||
* Slice drawing callback. This is where a filter receives video data
|
|
||||||
* and should do its processing.
|
|
||||||
*
|
|
||||||
* Input video pads only.
|
|
||||||
*
|
|
||||||
* @return >= 0 on success, a negative AVERROR on error.
|
|
||||||
*/
|
|
||||||
int (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filtering callback. This is where a filter receives a frame with
|
* Filtering callback. This is where a filter receives a frame with
|
||||||
* audio/video data and should do its processing.
|
* audio/video data and should do its processing.
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
|
|||||||
if (inlink->dst->nb_outputs)
|
if (inlink->dst->nb_outputs)
|
||||||
outlink = inlink->dst->outputs[0];
|
outlink = inlink->dst->outputs[0];
|
||||||
|
|
||||||
if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice)) {
|
if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame)) {
|
||||||
AVFilterBufferRef *buf_out;
|
AVFilterBufferRef *buf_out;
|
||||||
outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
|
outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
|
||||||
if (!outlink->out_buf)
|
if (!outlink->out_buf)
|
||||||
@@ -283,7 +283,7 @@ static int default_end_frame(AVFilterLink *inlink)
|
|||||||
int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
|
int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
|
||||||
inlink->cur_buf = NULL;
|
inlink->cur_buf = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
} else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice){
|
} else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame){
|
||||||
return ff_end_frame(outlink);
|
return ff_end_frame(outlink);
|
||||||
} else {
|
} else {
|
||||||
int ret = ff_filter_frame(outlink, inlink->cur_buf);
|
int ret = ff_filter_frame(outlink, inlink->cur_buf);
|
||||||
@@ -309,23 +309,10 @@ int ff_end_frame(AVFilterLink *link)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
|
|
||||||
{
|
|
||||||
AVFilterLink *outlink = NULL;
|
|
||||||
|
|
||||||
if (inlink->dst->nb_outputs)
|
|
||||||
outlink = inlink->dst->outputs[0];
|
|
||||||
|
|
||||||
if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice))
|
|
||||||
return ff_draw_slice(outlink, y, h, slice_dir);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
|
int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
|
||||||
{
|
{
|
||||||
uint8_t *src[4], *dst[4];
|
uint8_t *src[4], *dst[4];
|
||||||
int i, j, vsub, ret;
|
int i, j, vsub;
|
||||||
int (*draw_slice)(AVFilterLink *, int, int, int);
|
|
||||||
|
|
||||||
FF_TPRINTF_START(NULL, draw_slice); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
|
FF_TPRINTF_START(NULL, draw_slice); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
|
||||||
|
|
||||||
@@ -358,14 +345,8 @@ int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(draw_slice = link->dstpad->draw_slice))
|
|
||||||
draw_slice = default_draw_slice;
|
|
||||||
ret = draw_slice(link, y, h, slice_dir);
|
|
||||||
if (ret < 0)
|
|
||||||
clear_link(link);
|
|
||||||
else
|
|
||||||
/* incoming buffers must not be freed in start frame,
|
/* incoming buffers must not be freed in start frame,
|
||||||
because they can still be in use by the automatic copy mechanism */
|
because they can still be in use by the automatic copy mechanism */
|
||||||
av_assert1(link->cur_buf_copy->buf->refcount > 0);
|
av_assert1(link->cur_buf_copy->buf->refcount > 0);
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user