They are only useful inside filters and we don't allow user filters for now.
Showing the changes to libavfilter (5 of 5 files). Show all
Unified · Split
| @@ -497,7 +497,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque) · 496 unmodified lines | |||
| 497 | pad.name = av_strdup(name); | 497 | pad.name = av_strdup(name); |
| 498 | pad.filter_samples = filter_samples; | 498 | pad.filter_samples = filter_samples; |
| 499 | 499 | ||
| 500 | avfilter_insert_inpad(ctx, i, &pad); | 500 | ff_insert_inpad(ctx, i, &pad); |
| 501 | } | 501 | } |
| 502 | 502 | ||
| 503 | return 0; | 503 | return 0; |
| @@ -44,9 +44,9 @@ const char *avfilter_license(void) · 43 unmodified lines | |||
| 44 | return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1; | 44 | return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | 47 | void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, |
| 48 | AVFilterPad **pads, AVFilterLink ***links, | 48 | AVFilterPad **pads, AVFilterLink ***links, |
| 49 | AVFilterPad *newpad) | 49 | AVFilterPad *newpad) |
| 50 | { | 50 | { |
| 51 | unsigned i; | 51 | unsigned i; |
| 52 | 52 | ||
| @@ -426,4 +426,22 @@ int avfilter_default_config_output_link(AVFilterLink *link) · 373 unmodified lines | |||
| 426 | { | 426 | { |
| 427 | return 0; | 427 | return 0; |
| 428 | } | 428 | } |
| 429 | void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | ||
| 430 | AVFilterPad **pads, AVFilterLink ***links, | ||
| 431 | AVFilterPad *newpad) | ||
| 432 | { | ||
| 433 | ff_insert_pad(idx, count, padidx_off, pads, links, newpad); | ||
| 434 | } | ||
| 435 | void avfilter_insert_inpad(AVFilterContext *f, unsigned index, | ||
| 436 | AVFilterPad *p) | ||
| 437 | { | ||
| 438 | ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), | ||
| 439 | &f->input_pads, &f->inputs, p); | ||
| 440 | } | ||
| 441 | void avfilter_insert_outpad(AVFilterContext *f, unsigned index, | ||
| 442 | AVFilterPad *p) | ||
| 443 | { | ||
| 444 | ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), | ||
| 445 | &f->output_pads, &f->outputs, p); | ||
| 446 | } | ||
| 429 | #endif | 447 | #endif |
| @@ -749,38 +749,19 @@ void avfilter_free(AVFilterContext *filter); · 748 unmodified lines | |||
| 749 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, | 749 | int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, |
| 750 | unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); | 750 | unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); |
| 751 | 751 | ||
| 752 | /** | 752 | #if FF_API_FILTERS_PUBLIC |
| 753 | * Insert a new pad. | 753 | attribute_deprecated |
| 754 | * | ||
| 755 | * @param idx Insertion point. Pad is inserted at the end if this point | ||
| 756 | * is beyond the end of the list of pads. | ||
| 757 | * @param count Pointer to the number of pads in the list | ||
| 758 | * @param padidx_off Offset within an AVFilterLink structure to the element | ||
| 759 | * to increment when inserting a new pad causes link | ||
| 760 | * numbering to change | ||
| 761 | * @param pads Pointer to the pointer to the beginning of the list of pads | ||
| 762 | * @param links Pointer to the pointer to the beginning of the list of links | ||
| 763 | * @param newpad The new pad to add. A copy is made when adding. | ||
| 764 | */ | ||
| 765 | void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | 754 | void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, |
| 766 | AVFilterPad **pads, AVFilterLink ***links, | 755 | AVFilterPad **pads, AVFilterLink ***links, |
| 767 | AVFilterPad *newpad); | 756 | AVFilterPad *newpad); |
| 768 | 757 | ||
| 769 | /** Insert a new input pad for the filter. */ | 758 | attribute_deprecated |
| 770 | static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index, | 759 | void avfilter_insert_inpad(AVFilterContext *f, unsigned index, |
| 771 | AVFilterPad *p) | 760 | AVFilterPad *p); |
| 772 | { | 761 | attribute_deprecated |
| 773 | avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), | 762 | void avfilter_insert_outpad(AVFilterContext *f, unsigned index, |
| 774 | &f->input_pads, &f->inputs, p); | 763 | AVFilterPad *p); |
| 775 | } | 764 | #endif |
| 776 | |||
| 777 | /** Insert a new output pad for the filter. */ | ||
| 778 | static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index, | ||
| 779 | AVFilterPad *p) | ||
| 780 | { | ||
| 781 | avfilter_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), | ||
| 782 | &f->output_pads, &f->outputs, p); | ||
| 783 | } | ||
| 784 | 765 | ||
| 785 | /** | 766 | /** |
| 786 | * Copy the frame properties of src to dst, without copying the actual | 767 | * Copy the frame properties of src to dst, without copying the actual |
| @@ -36,4 +36,37 @@ int ff_fmt_is_in(int fmt, const int *fmts); · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | void ff_dlog_link(void *ctx, AVFilterLink *link, int end); | 37 | void ff_dlog_link(void *ctx, AVFilterLink *link, int end); |
| 38 | 38 | ||
| 39 | /** | ||
| 40 | * Insert a new pad. | ||
| 41 | * | ||
| 42 | * @param idx Insertion point. Pad is inserted at the end if this point | ||
| 43 | * is beyond the end of the list of pads. | ||
| 44 | * @param count Pointer to the number of pads in the list | ||
| 45 | * @param padidx_off Offset within an AVFilterLink structure to the element | ||
| 46 | * to increment when inserting a new pad causes link | ||
| 47 | * numbering to change | ||
| 48 | * @param pads Pointer to the pointer to the beginning of the list of pads | ||
| 49 | * @param links Pointer to the pointer to the beginning of the list of links | ||
| 50 | * @param newpad The new pad to add. A copy is made when adding. | ||
| 51 | */ | ||
| 52 | void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, | ||
| 53 | AVFilterPad **pads, AVFilterLink ***links, | ||
| 54 | AVFilterPad *newpad); | ||
| 55 | |||
| 56 | /** Insert a new input pad for the filter. */ | ||
| 57 | static inline void ff_insert_inpad(AVFilterContext *f, unsigned index, | ||
| 58 | AVFilterPad *p) | ||
| 59 | { | ||
| 60 | ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), | ||
| 61 | &f->input_pads, &f->inputs, p); | ||
| 62 | } | ||
| 63 | |||
| 64 | /** Insert a new output pad for the filter. */ | ||
| 65 | static inline void ff_insert_outpad(AVFilterContext *f, unsigned index, | ||
| 66 | AVFilterPad *p) | ||
| 67 | { | ||
| 68 | ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), | ||
| 69 | &f->output_pads, &f->outputs, p); | ||
| 70 | } | ||
| 71 | |||
| 39 | #endif /* AVFILTER_INTERNAL_H */ | 72 | #endif /* AVFILTER_INTERNAL_H */ |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 27 | #include "audio.h" | 27 | #include "audio.h" |
| 28 | #include "internal.h" | ||
| 28 | #include "video.h" | 29 | #include "video.h" |
| 29 | 30 | ||
| 30 | static int split_init(AVFilterContext *ctx, const char *args, void *opaque) | 31 | 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) · 17 unmodified lines | |||
| 48 | pad.type = ctx->filter->inputs[0].type; | 49 | pad.type = ctx->filter->inputs[0].type; |
| 49 | pad.name = av_strdup(name); | 50 | pad.name = av_strdup(name); |
| 50 | 51 | ||
| 51 | avfilter_insert_outpad(ctx, i, &pad); | 52 | ff_insert_outpad(ctx, i, &pad); |
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | return 0; | 55 | return 0; |