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
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;
libavfilter/avfilter.c+21−3
@@ -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
47void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,47void 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}
429void 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}
435void 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}
441void 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#endif447#endif
libavfilter/avfilter.h+9−28
@@ -749,38 +749,19 @@ void avfilter_free(AVFilterContext *filter); · 748 unmodified lines
749int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,749int 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.753attribute_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 */
765void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,754void 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. */758attribute_deprecated
770static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index,759void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
771 AVFilterPad *p)760 AVFilterPad *p);
772{761attribute_deprecated
773 avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),762void 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. */
778static 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 actual767 * 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
36 36
37void ff_dlog_link(void *ctx, AVFilterLink *link, int end);37void 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 */
52void 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. */
57static 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. */
65static 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 */
libavfilter/split.c+2−1
@@ -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
30static int split_init(AVFilterContext *ctx, const char *args, void *opaque)31static 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;

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