History

lavfi: remove some draw_slice related code that has become unneeded

Michael Niedermayer committed 13 years ago

Commit c0c0b191 parent 8997a0f3 files · +5 −34Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +1 −1
  2. libavfilter/internal.h +0 −10
  3. libavfilter/video.c +4 −23
libavfilter/avfilter.c+1−1
@@ -421,7 +421,7 @@ int avfilter_register(AVFilter *filter) · 420 unmodified lines
421421 for(i=0; filter->inputs && filter->inputs[i].name; i++) {
422422 const AVFilterPad *input = &filter->inputs[i];
423423 av_assert0( !input->filter_frame
424− || (!input->start_frame && !input->end_frame && !input->draw_slice));
424+ || (!input->start_frame && !input->end_frame));
425425 }
426426
427427 registered_avfilters[next_registered_avfilter_idx++] = filter;
libavfilter/internal.h+0−10
@@ -127,16 +127,6 @@ struct AVFilterPad { · 126 unmodified lines
127127 */
128128 int (*end_frame)(AVFilterLink *link);
129129
130− /**
131− * Slice drawing callback. This is where a filter receives video data
132− * and should do its processing.
133− *
134− * Input video pads only.
135− *
136− * @return >= 0 on success, a negative AVERROR on error.
137− */
138− int (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
139−
140130 /**
141131 * Filtering callback. This is where a filter receives a frame with
142132 * audio/video data and should do its processing.
libavfilter/video.c+4−23
@@ -166,7 +166,7 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 165 unmodified lines
166166 if (inlink->dst->nb_outputs)
167167 outlink = inlink->dst->outputs[0];
168168
169− if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice)) {
169+ if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame)) {
170170 AVFilterBufferRef *buf_out;
171171 outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
172172 if (!outlink->out_buf)
@@ -283,7 +283,7 @@ static int default_end_frame(AVFilterLink *inlink) · 110 unmodified lines
283283 int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf);
284284 inlink->cur_buf = NULL;
285285 return ret;
286− } else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice){
286+ } else if (inlink->dstpad->start_frame || inlink->dstpad->end_frame){
287287 return ff_end_frame(outlink);
288288 } else {
289289 int ret = ff_filter_frame(outlink, inlink->cur_buf);
@@ -309,23 +309,10 @@ int ff_end_frame(AVFilterLink *link) · 19 unmodified lines
309309 return ret;
310310 }
311311
312−static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
313−{
314− AVFilterLink *outlink = NULL;
315−
316− if (inlink->dst->nb_outputs)
317− outlink = inlink->dst->outputs[0];
318−
319− if (outlink && (inlink->dstpad->start_frame || inlink->dstpad->end_frame || inlink->dstpad->draw_slice))
320− return ff_draw_slice(outlink, y, h, slice_dir);
321− return 0;
322−}
323−
324312 int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
325313 {
326314 uint8_t *src[4], *dst[4];
327− int i, j, vsub, ret;
328− int (*draw_slice)(AVFilterLink *, int, int, int);
315+ int i, j, vsub;
329316
330317 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);
331318
@@ -358,14 +345,8 @@ int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 26 unmodified lines
358345 }
359346 }
360347
361− if (!(draw_slice = link->dstpad->draw_slice))
362− draw_slice = default_draw_slice;
363− ret = draw_slice(link, y, h, slice_dir);
364− if (ret < 0)
365− clear_link(link);
366− else
367348 /* incoming buffers must not be freed in start frame,
368349 because they can still be in use by the automatic copy mechanism */
369350 av_assert1(link->cur_buf_copy->buf->refcount > 0);
370− return ret;
351+ return 0;
371352 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t