1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi: make avfilter_insert_pad and pals private on next bump.

They are only useful inside filters and we don't allow user filters for
now.
This commit is contained in:
Anton Khirnov 2012-05-30 10:31:48 +02:00
parent b74a1da49d
commit fa417fcd27
5 changed files with 66 additions and 33 deletions

View File

@ -497,7 +497,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
pad.name = av_strdup(name); pad.name = av_strdup(name);
pad.filter_samples = filter_samples; pad.filter_samples = filter_samples;
avfilter_insert_inpad(ctx, i, &pad); ff_insert_inpad(ctx, i, &pad);
} }
return 0; return 0;

View File

@ -44,9 +44,9 @@ const char *avfilter_license(void)
return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1; return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
} }
void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
AVFilterPad **pads, AVFilterLink ***links, AVFilterPad **pads, AVFilterLink ***links,
AVFilterPad *newpad) AVFilterPad *newpad)
{ {
unsigned i; unsigned i;
@ -426,4 +426,22 @@ int avfilter_default_config_output_link(AVFilterLink *link)
{ {
return 0; return 0;
} }
void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
AVFilterPad **pads, AVFilterLink ***links,
AVFilterPad *newpad)
{
ff_insert_pad(idx, count, padidx_off, pads, links, newpad);
}
void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),
&f->input_pads, &f->inputs, p);
}
void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
&f->output_pads, &f->outputs, p);
}
#endif #endif

View File

@ -749,38 +749,19 @@ void avfilter_free(AVFilterContext *filter);
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
/** #if FF_API_FILTERS_PUBLIC
* Insert a new pad. attribute_deprecated
*
* @param idx Insertion point. Pad is inserted at the end if this point
* is beyond the end of the list of pads.
* @param count Pointer to the number of pads in the list
* @param padidx_off Offset within an AVFilterLink structure to the element
* to increment when inserting a new pad causes link
* numbering to change
* @param pads Pointer to the pointer to the beginning of the list of pads
* @param links Pointer to the pointer to the beginning of the list of links
* @param newpad The new pad to add. A copy is made when adding.
*/
void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
AVFilterPad **pads, AVFilterLink ***links, AVFilterPad **pads, AVFilterLink ***links,
AVFilterPad *newpad); AVFilterPad *newpad);
/** Insert a new input pad for the filter. */ attribute_deprecated
static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index, void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
AVFilterPad *p) AVFilterPad *p);
{ attribute_deprecated
avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
&f->input_pads, &f->inputs, p); AVFilterPad *p);
} #endif
/** Insert a new output pad for the filter. */
static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
avfilter_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
&f->output_pads, &f->outputs, p);
}
/** /**
* Copy the frame properties of src to dst, without copying the actual * Copy the frame properties of src to dst, without copying the actual

View File

@ -36,4 +36,37 @@ int ff_fmt_is_in(int fmt, const int *fmts);
void ff_dlog_link(void *ctx, AVFilterLink *link, int end); void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
/**
* Insert a new pad.
*
* @param idx Insertion point. Pad is inserted at the end if this point
* is beyond the end of the list of pads.
* @param count Pointer to the number of pads in the list
* @param padidx_off Offset within an AVFilterLink structure to the element
* to increment when inserting a new pad causes link
* numbering to change
* @param pads Pointer to the pointer to the beginning of the list of pads
* @param links Pointer to the pointer to the beginning of the list of links
* @param newpad The new pad to add. A copy is made when adding.
*/
void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
AVFilterPad **pads, AVFilterLink ***links,
AVFilterPad *newpad);
/** Insert a new input pad for the filter. */
static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),
&f->input_pads, &f->inputs, p);
}
/** Insert a new output pad for the filter. */
static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
&f->output_pads, &f->outputs, p);
}
#endif /* AVFILTER_INTERNAL_H */ #endif /* AVFILTER_INTERNAL_H */

View File

@ -25,6 +25,7 @@
#include "avfilter.h" #include "avfilter.h"
#include "audio.h" #include "audio.h"
#include "internal.h"
#include "video.h" #include "video.h"
static int split_init(AVFilterContext *ctx, const char *args, void *opaque) static int split_init(AVFilterContext *ctx, const char *args, void *opaque)
@ -48,7 +49,7 @@ static int split_init(AVFilterContext *ctx, const char *args, void *opaque)
pad.type = ctx->filter->inputs[0].type; pad.type = ctx->filter->inputs[0].type;
pad.name = av_strdup(name); pad.name = av_strdup(name);
avfilter_insert_outpad(ctx, i, &pad); ff_insert_outpad(ctx, i, &pad);
} }
return 0; return 0;