History

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.

Anton Khirnov committed 14 years ago

Commit fa417fc1 parent b74a1da5 files · +66 −33Browse files

Showing the changes to libavfilter (5 of 5 files). Show all

Unified · Split

5 files
  1. libavfilter/af_amix.c +1 −1
  2. libavfilter/avfilter.c +21 −3
  3. libavfilter/avfilter.h +9 −28
  4. libavfilter/internal.h +33 −0
  5. libavfilter/split.c +2 −1
libavfilter/af_amix.c+1−1
@@ -497,7 +497,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque) · 496 unmodified lines
497497 pad.name = av_strdup(name);
498498 pad.filter_samples = filter_samples;
499499
500− avfilter_insert_inpad(ctx, i, &pad);
500+ ff_insert_inpad(ctx, i, &pad);
501501 }
502502
503503 return 0;
libavfilter/avfilter.c+21−3
@@ -44,9 +44,9 @@ const char *avfilter_license(void) · 43 unmodified lines
4444 return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
4545 }
4646
47−void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
48− AVFilterPad **pads, AVFilterLink ***links,
49− AVFilterPad *newpad)
47+void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
48+ AVFilterPad **pads, AVFilterLink ***links,
49+ AVFilterPad *newpad)
5050 {
5151 unsigned i;
5252
@@ -426,4 +426,22 @@ int avfilter_default_config_output_link(AVFilterLink *link) · 373 unmodified lines
426426 {
427427 return 0;
428428 }
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+}
429447 #endif
libavfilter/avfilter.h+9−28
@@ -749,38 +749,19 @@ void avfilter_free(AVFilterContext *filter); · 748 unmodified lines
749749 int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
750750 unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
751751
752−/**
753− * Insert a new pad.
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− */
752+#if FF_API_FILTERS_PUBLIC
753+attribute_deprecated
765754 void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
766755 AVFilterPad **pads, AVFilterLink ***links,
767756 AVFilterPad *newpad);
768757
769−/** Insert a new input pad for the filter. */
770−static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
771− AVFilterPad *p)
772−{
773− avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),
774− &f->input_pads, &f->inputs, p);
775−}
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−}
758+attribute_deprecated
759+void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
760+ AVFilterPad *p);
761+attribute_deprecated
762+void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
763+ AVFilterPad *p);
764+#endif
784765
785766 /**
786767 * Copy the frame properties of src to dst, without copying the actual
libavfilter/internal.h+33−0
@@ -36,4 +36,37 @@ int ff_fmt_is_in(int fmt, const int *fmts); · 35 unmodified lines
3636
3737 void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
3838
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+
3972 #endif /* AVFILTER_INTERNAL_H */
libavfilter/split.c+2−1
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include "avfilter.h"
2727 #include "audio.h"
28+#include "internal.h"
2829 #include "video.h"
2930
3031 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
4849 pad.type = ctx->filter->inputs[0].type;
4950 pad.name = av_strdup(name);
5051
51− avfilter_insert_outpad(ctx, i, &pad);
52+ ff_insert_outpad(ctx, i, &pad);
5253 }
5354
5455 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t