ppc: reduce overreads when loading 8 pixels in altivec dsp functions
[libav.git] / libavfilter / buffersink.h
CommitLineData
ac712309
AK
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 * memory buffer sink API
25 */
26
27#include "avfilter.h"
28
7e350379 29#if FF_API_AVFILTERBUFFER
ac712309
AK
30/**
31 * Get a buffer with filtered data from sink and put it in buf.
32 *
804d7a1a 33 * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
ac712309
AK
34 * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
35 * must be freed by the caller using avfilter_unref_buffer().
36 * Buf may also be NULL to query whether a buffer is ready to be
37 * output.
38 *
39 * @return >= 0 in case of success, a negative AVERROR code in case of
40 * failure.
41 */
7e350379 42attribute_deprecated
804d7a1a 43int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf);
ac712309 44
a2cd9be2
AK
45/**
46 * Same as av_buffersink_read, but with the ability to specify the number of
47 * samples read. This function is less efficient than av_buffersink_read(),
48 * because it copies the data around.
49 *
804d7a1a 50 * @param ctx pointer to a context of the abuffersink AVFilter.
a2cd9be2
AK
51 * @param buf pointer to the buffer will be written here if buf is non-NULL. buf
52 * must be freed by the caller using avfilter_unref_buffer(). buf
53 * will contain exactly nb_samples audio samples, except at the end
54 * of stream, when it can contain less than nb_samples.
55 * Buf may also be NULL to query whether a buffer is ready to be
56 * output.
57 *
58 * @warning do not mix this function with av_buffersink_read(). Use only one or
59 * the other with a single sink, not both.
60 */
7e350379 61attribute_deprecated
a2cd9be2
AK
62int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
63 int nb_samples);
7e350379
AK
64#endif
65
66/**
67 * Get a frame with filtered data from sink and put it in frame.
68 *
69 * @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
70 * @param frame pointer to an allocated frame that will be filled with data.
71 * The data must be freed using av_frame_unref() / av_frame_free()
72 *
73 * @return >= 0 in case of success, a negative AVERROR code in case of
74 * failure.
75 */
76int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
77
78/**
79 * Same as av_buffersink_get_frame(), but with the ability to specify the number
80 * of samples read. This function is less efficient than
81 * av_buffersink_get_frame(), because it copies the data around.
82 *
83 * @param ctx pointer to a context of the abuffersink AVFilter.
84 * @param frame pointer to an allocated frame that will be filled with data.
85 * The data must be freed using av_frame_unref() / av_frame_free()
86 * frame will contain exactly nb_samples audio samples, except at
87 * the end of stream, when it can contain less than nb_samples.
88 *
89 * @warning do not mix this function with av_buffersink_get_frame(). Use only one or
90 * the other with a single sink, not both.
91 */
92int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
a2cd9be2 93
ac712309 94#endif /* AVFILTER_BUFFERSINK_H */