2 * Copyright (c) 2007 Bobby Bingham
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
30 avfilter_start_frame(inlink->dst->outputs[0],
31 avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
32 avfilter_start_frame(inlink->dst->outputs[1],
33 avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
36 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
38 avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
39 avfilter_draw_slice(inlink->dst->outputs[1], y, h, slice_dir);
42 static void end_frame(AVFilterLink *inlink)
44 avfilter_end_frame(inlink->dst->outputs[0]);
45 avfilter_end_frame(inlink->dst->outputs[1]);
47 avfilter_unref_buffer(inlink->cur_buf);
50 AVFilter avfilter_vf_split = {
52 .description = NULL_IF_CONFIG_SMALL("Pass on the input to two outputs."),
54 .inputs = (AVFilterPad[]) {{ .name = "default",
55 .type = AVMEDIA_TYPE_VIDEO,
56 .get_video_buffer= avfilter_null_get_video_buffer,
57 .start_frame = start_frame,
58 .draw_slice = draw_slice,
59 .end_frame = end_frame, },
61 .outputs = (AVFilterPad[]) {{ .name = "output1",
62 .type = AVMEDIA_TYPE_VIDEO, },
64 .type = AVMEDIA_TYPE_VIDEO, },