00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 #include "avfilter.h"
00027
00028 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
00029 {
00030 avfilter_start_frame(inlink->dst->outputs[0],
00031 avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
00032 avfilter_start_frame(inlink->dst->outputs[1],
00033 avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
00034 }
00035
00036 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
00037 {
00038 avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
00039 avfilter_draw_slice(inlink->dst->outputs[1], y, h, slice_dir);
00040 }
00041
00042 static void end_frame(AVFilterLink *inlink)
00043 {
00044 avfilter_end_frame(inlink->dst->outputs[0]);
00045 avfilter_end_frame(inlink->dst->outputs[1]);
00046
00047 avfilter_unref_buffer(inlink->cur_buf);
00048 }
00049
00050 AVFilter avfilter_vf_split = {
00051 .name = "split",
00052 .description = NULL_IF_CONFIG_SMALL("Pass on the input to two outputs."),
00053
00054 .inputs = (const AVFilterPad[]) {{ .name = "default",
00055 .type = AVMEDIA_TYPE_VIDEO,
00056 .get_video_buffer= avfilter_null_get_video_buffer,
00057 .start_frame = start_frame,
00058 .draw_slice = draw_slice,
00059 .end_frame = end_frame, },
00060 { .name = NULL}},
00061 .outputs = (const AVFilterPad[]) {{ .name = "output1",
00062 .type = AVMEDIA_TYPE_VIDEO, },
00063 { .name = "output2",
00064 .type = AVMEDIA_TYPE_VIDEO, },
00065 { .name = NULL}},
00066 };