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 "avfilter.h"
28 
29 #if !FF_API_AVFILTERPAD_PUBLIC
30 
33 struct AVFilterPad {
39  const char *name;
40 
45 
53  int min_perms;
54 
64  int rej_perms;
65 
72  AVFilterBufferRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h);
73 
80  AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,
81  int nb_samples);
82 
94 
104  int (*poll_frame)(AVFilterLink *link);
105 
114 
129  int (*config_props)(AVFilterLink *link);
130 
138 };
139 #endif
140 
143 
145 int ff_fmt_is_in(int fmt, const int *fmts);
146 
147 #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
148 
149 void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
150 
164 void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
165  AVFilterPad **pads, AVFilterLink ***links,
166  AVFilterPad *newpad);
167 
169 static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
170  AVFilterPad *p)
171 {
172  ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
173  &f->input_pads, &f->inputs, p);
174 #if FF_API_FOO_COUNT
175  f->input_count = f->nb_inputs;
176 #endif
177 }
178 
180 static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
181  AVFilterPad *p)
182 {
183  ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
184  &f->output_pads, &f->outputs, p);
185 #if FF_API_FOO_COUNT
186  f->output_count = f->nb_outputs;
187 #endif
188 }
189 
197 int ff_poll_frame(AVFilterLink *link);
198 
205 int ff_request_frame(AVFilterLink *link);
206 
219 
220 #endif /* AVFILTER_INTERNAL_H */