Libav
internal.h
Go to the documentation of this file.
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_INTERNAL_H
20 #define AVFILTER_INTERNAL_H
21 
27 #include "libavutil/internal.h"
28 #include "avfilter.h"
29 #include "thread.h"
30 #include "version.h"
31 
32 #if !FF_API_AVFILTERPAD_PUBLIC
33 
36 struct AVFilterPad {
42  const char *name;
43 
48 
55  AVFrame *(*get_video_buffer)(AVFilterLink *link, int w, int h);
56 
63  AVFrame *(*get_audio_buffer)(AVFilterLink *link, int nb_samples);
64 
75  int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
76 
86  int (*poll_frame)(AVFilterLink *link);
87 
95  int (*request_frame)(AVFilterLink *link);
96 
111  int (*config_props)(AVFilterLink *link);
112 
120 
128 };
129 #endif
130 
132  void *thread;
134 };
135 
138 };
139 
140 #if FF_API_AVFILTERBUFFER
141 
142 void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
143 #endif
144 
146 int ff_fmt_is_in(int fmt, const int *fmts);
147 
148 #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
149 
150 void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
151 
165 void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
166  AVFilterPad **pads, AVFilterLink ***links,
167  AVFilterPad *newpad);
168 
170 static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
171  AVFilterPad *p)
172 {
173  ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
174  &f->input_pads, &f->inputs, p);
175 #if FF_API_FOO_COUNT
177  f->input_count = f->nb_inputs;
179 #endif
180 }
181 
183 static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
184  AVFilterPad *p)
185 {
186  ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
187  &f->output_pads, &f->outputs, p);
188 #if FF_API_FOO_COUNT
190  f->output_count = f->nb_outputs;
192 #endif
193 }
194 
202 int ff_poll_frame(AVFilterLink *link);
203 
210 int ff_request_frame(AVFilterLink *link);
211 
223 int ff_filter_frame(AVFilterLink *link, AVFrame *frame);
224 
233 AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name);
234 
239 
240 #endif /* AVFILTER_INTERNAL_H */