Browse code

lavfi/concat: switch to filter_frame.

Clément Bœsch authored on 2012/11/29 20:23:26
Showing 1 changed files
... ...
@@ -178,16 +178,7 @@ static void push_frame(AVFilterContext *ctx, unsigned in_no,
178 178
         in->pts = av_rescale(in->pts, in->nb_frames, in->nb_frames - 1);
179 179
 
180 180
     buf->pts += cat->delta_ts;
181
-    switch (buf->type) {
182
-    case AVMEDIA_TYPE_VIDEO:
183
-        ff_start_frame(outlink, buf);
184
-        ff_draw_slice(outlink, 0, outlink->h, 1);
185
-        ff_end_frame(outlink);
186
-        break;
187
-    case AVMEDIA_TYPE_AUDIO:
188
-        ff_filter_frame(outlink, buf);
189
-        break;
190
-    }
181
+    ff_filter_frame(outlink, buf);
191 182
 }
192 183
 
193 184
 static void process_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
... ...
@@ -227,23 +218,6 @@ static AVFilterBufferRef *get_audio_buffer(AVFilterLink *inlink, int perms,
227 227
     return ff_get_audio_buffer(outlink, perms, nb_samples);
228 228
 }
229 229
 
230
-static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
231
-{
232
-    return 0;
233
-}
234
-
235
-static int draw_slice(AVFilterLink *inlink, int y, int h, int dir)
236
-{
237
-    return 0;
238
-}
239
-
240
-static int end_frame(AVFilterLink *inlink)
241
-{
242
-    process_frame(inlink, inlink->cur_buf);
243
-    inlink->cur_buf = NULL;
244
-    return 0;
245
-}
246
-
247 230
 static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
248 231
 {
249 232
     process_frame(inlink, buf);
... ...
@@ -389,16 +363,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
389 389
                     .min_perms        = AV_PERM_READ | AV_PERM_PRESERVE,
390 390
                     .get_video_buffer = get_video_buffer,
391 391
                     .get_audio_buffer = get_audio_buffer,
392
+                    .filter_frame     = filter_frame,
392 393
                 };
393 394
                 snprintf(name, sizeof(name), "in%d:%c%d", seg, "va"[type], str);
394 395
                 pad.name = av_strdup(name);
395
-                if (type == AVMEDIA_TYPE_VIDEO) {
396
-                    pad.start_frame = start_frame;
397
-                    pad.draw_slice  = draw_slice;
398
-                    pad.end_frame   = end_frame;
399
-                } else {
400
-                    pad.filter_frame   = filter_frame;
401
-                }
402 396
                 ff_insert_inpad(ctx, ctx->nb_inputs, &pad);
403 397
             }
404 398
         }