History

lavfi: make FFFilterContext private to generic code

Nothing in it needs to be visible to filters.

Anton Khirnov committed 2 years ago

Commit 52471b51 parent f19c9883 files · +26 −23Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +6 −0
  2. libavfilter/avfilter_internal.h +18 −0
  3. libavfilter/filters.h +2 −23
libavfilter/avfilter.c+6−0
@@ -1647,3 +1647,9 @@ int ff_outlink_frame_wanted(AVFilterLink *link) · 1646 unmodified lines
1647 FilterLinkInternal * const li = ff_link_internal(link);1647 FilterLinkInternal * const li = ff_link_internal(link);
1648 return li->frame_wanted_out;1648 return li->frame_wanted_out;
1649}1649}
1650
1651int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,
1652 void *arg, int *ret, int nb_jobs)
1653{
1654 return fffilterctx(ctx)->execute(ctx, func, arg, ret, nb_jobs);
1655}
libavfilter/avfilter_internal.h+18−0
@@ -92,6 +92,24 @@ static inline FilterLinkInternal *ff_link_internal(AVFilterLink *link) · 91 unmodified lines
92 return (FilterLinkInternal*)link;92 return (FilterLinkInternal*)link;
93}93}
94 94
95typedef struct FFFilterContext {
96 /**
97 * The public AVFilterContext. See avfilter.h for it.
98 */
99 AVFilterContext p;
100
101 avfilter_execute_func *execute;
102
103 // 1 when avfilter_init_*() was successfully called on this filter
104 // 0 otherwise
105 int initialized;
106} FFFilterContext;
107
108static inline FFFilterContext *fffilterctx(AVFilterContext *ctx)
109{
110 return (FFFilterContext*)ctx;
111}
112
95typedef struct AVFilterCommand {113typedef struct AVFilterCommand {
96 double time; ///< time expressed in seconds114 double time; ///< time expressed in seconds
97 char *command; ///< command115 char *command; ///< command
libavfilter/filters.h+2−23
@@ -199,24 +199,6 @@ static inline FilterLink* ff_filter_link(AVFilterLink *link) · 198 unmodified lines
199 return (FilterLink*)link;199 return (FilterLink*)link;
200}200}
201 201
202typedef struct FFFilterContext {
203 /**
204 * The public AVFilterContext. See avfilter.h for it.
205 */
206 AVFilterContext p;
207
208 avfilter_execute_func *execute;
209
210 // 1 when avfilter_init_*() was successfully called on this filter
211 // 0 otherwise
212 int initialized;
213} FFFilterContext;
214
215static inline FFFilterContext *fffilterctx(AVFilterContext *ctx)
216{
217 return (FFFilterContext*)ctx;
218}
219
220/**202/**
221 * The filter is aware of hardware frames, and any hardware frame context203 * The filter is aware of hardware frames, and any hardware frame context
222 * should not be automatically propagated through it.204 * should not be automatically propagated through it.
@@ -614,10 +596,7 @@ int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p); · 391 unmodified lines
614 */596 */
615int ff_fmt_is_in(int fmt, const int *fmts);597int ff_fmt_is_in(int fmt, const int *fmts);
616 598
617static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,599int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,
618 void *arg, int *ret, int nb_jobs)600 void *arg, int *ret, int nb_jobs);
619{
620 return fffilterctx(ctx)->execute(ctx, func, arg, ret, nb_jobs);
621}
622 601
623#endif /* AVFILTER_FILTERS_H */602#endif /* AVFILTER_FILTERS_H */

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