2 * This file is part of Libav.
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.
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.
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
19 #ifndef AVFILTER_BUFFERSINK_H
20 #define AVFILTER_BUFFERSINK_H
24 * @ingroup lavfi_buffersink
25 * memory buffer sink API
31 * @defgroup lavfi_buffersink Buffer sink API
37 * Get a frame with filtered data from sink and put it in frame.
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()
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.
50 int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
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.
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.
63 * @return The return codes have the same meaning as for
64 * av_buffersink_get_samples().
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.
69 int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
75 #endif /* AVFILTER_BUFFERSINK_H */