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

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

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
16471647 FilterLinkInternal * const li = ff_link_internal(link);
16481648 return li->frame_wanted_out;
16491649 }
1650+
1651+int 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
9292 return (FilterLinkInternal*)link;
9393 }
9494
95+typedef 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+
108+static inline FFFilterContext *fffilterctx(AVFilterContext *ctx)
109+{
110+ return (FFFilterContext*)ctx;
111+}
112+
95113 typedef struct AVFilterCommand {
96114 double time; ///< time expressed in seconds
97115 char *command; ///< command
libavfilter/filters.h+2−23
@@ -199,24 +199,6 @@ static inline FilterLink* ff_filter_link(AVFilterLink *link) · 198 unmodified lines
199199 return (FilterLink*)link;
200200 }
201201
202−typedef 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−
215−static inline FFFilterContext *fffilterctx(AVFilterContext *ctx)
216−{
217− return (FFFilterContext*)ctx;
218−}
219−
220202 /**
221203 * The filter is aware of hardware frames, and any hardware frame context
222204 * should not be automatically propagated through it.
@@ -614,10 +596,7 @@ int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p); · 391 unmodified lines
614596 */
615597 int ff_fmt_is_in(int fmt, const int *fmts);
616598
617−static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,
618− void *arg, int *ret, int nb_jobs)
619−{
620− return fffilterctx(ctx)->execute(ctx, func, arg, ret, nb_jobs);
621−}
599+int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func,
600+ void *arg, int *ret, int nb_jobs);
622601
623602 #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