h264_metadata: Add option to delete filler data
[libav.git] / libavfilter / buffersink.h
1 /*
2 * This file is part of Libav.
3 *
4 * Libav is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * Libav is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Libav; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #ifndef AVFILTER_BUFFERSINK_H
20 #define AVFILTER_BUFFERSINK_H
21
22 /**
23 * @file
24 * @ingroup lavfi_buffersink
25 * memory buffer sink API
26 */
27
28 #include "avfilter.h"
29
30 /**
31 * @defgroup lavfi_buffersink Buffer sink API
32 * @ingroup lavfi
33 * @{
34 */
35
36 /**
37 * Get a frame with filtered data from sink and put it in frame.
38 *
39 * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
40 * @param frame pointer to an allocated frame that will be filled with data.
41 * The data must be freed using av_frame_unref() / av_frame_free()
42 *
43 * @return
44 * - >= 0 if a frame was successfully returned.
45 * - AVERROR(EAGAIN) if no frames are available at this point; more
46 * input frames must be added to the filtergraph to get more output.
47 * - AVERROR_EOF if there will be no more output frames on this sink.
48 * - A different negative AVERROR code in other failure cases.
49 */
50 int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
51
52 /**
53 * Same as av_buffersink_get_frame(), but with the ability to specify the number
54 * of samples read. This function is less efficient than
55 * av_buffersink_get_frame(), because it copies the data around.
56 *
57 * @param ctx pointer to a context of the abuffersink AVFilter.
58 * @param frame pointer to an allocated frame that will be filled with data.
59 * The data must be freed using av_frame_unref() / av_frame_free()
60 * frame will contain exactly nb_samples audio samples, except at
61 * the end of stream, when it can contain less than nb_samples.
62 *
63 * @return The return codes have the same meaning as for
64 * av_buffersink_get_samples().
65 *
66 * @warning do not mix this function with av_buffersink_get_frame(). Use only one or
67 * the other with a single sink, not both.
68 */
69 int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
70
71 /**
72 * @}
73 */
74
75 #endif /* AVFILTER_BUFFERSINK_H */