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 */
int(* poll_frame)(AVFilterLink *link)
Frame poll callback.
Definition: internal.h:104
int(* filter_frame)(AVFilterLink *link, AVFilterBufferRef *frame)
Filtering callback.
Definition: internal.h:93
A reference-counted buffer data type used by the filter system.
Definition: avfilter.h:62
enum AVMediaType type
AVFilterPad type.
Definition: internal.h:44
const char * name
Pad name.
Definition: internal.h:39
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:426
AVFilterPad * output_pads
array of output pads
Definition: avfilter.h:432
int(* request_frame)(AVFilterLink *link)
Frame request callback.
Definition: internal.h:113
int ff_fmt_is_in(int fmt, const int *fmts)
Tell is a format is contained in the provided list terminated by -1.
Definition: formats.c:154
void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
Definition: avfilter.c:215
A filter pad used for either input or output.
Definition: internal.h:33
AVFilterPad * input_pads
array of input pads
Definition: avfilter.h:425
unsigned nb_outputs
number of output pads
Definition: avfilter.h:437
void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
Insert a new pad.
Definition: avfilter.c:52
unsigned nb_inputs
number of input pads
Definition: avfilter.h:430
static void ff_insert_outpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new output pad for the filter.
Definition: internal.h:180
A reference to an AVFilterBuffer.
Definition: avfilter.h:139
out nb_samples
int index
Definition: gxfenc.c:72
AVMediaType
Definition: avutil.h:177
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:433
int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:459
int rej_perms
Permissions which are not accepted on incoming buffers.
Definition: internal.h:64
void ff_avfilter_default_free_buffer(AVFilterBuffer *buf)
default handler for freeing audio/video buffer when there are no references left
Definition: buffer.c:27
static void ff_insert_inpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new input pad for the filter.
Definition: internal.h:169
An instance of a filter.
Definition: avfilter.h:418
int ff_poll_frame(AVFilterLink *link)
Poll a frame from the filter chain.
Definition: avfilter.c:250
int(* config_props)(AVFilterLink *link)
Link configuration callback.
Definition: internal.h:129
int needs_fifo
The filter expects a fifo to be inserted on its input link, typically because it has a delay...
Definition: internal.h:137
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:239
int min_perms
Minimum required permissions on incoming buffers.
Definition: internal.h:53