avfilter/avfiltergraph: Avoid allocation for AVFilterGraphInternal

To do this, allocate AVFilterGraphInternal jointly with AVFilterGraph
and rename it to FFFilterGraph in the process (similarly to
AVStream/FFStream).
The AVFilterGraphInternal* will be removed on the next major version
bump.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2024-02-10 18:26:54 +01:00
parent a1aec776f1
commit 03567ed80c
4 changed files with 44 additions and 36 deletions

View File

@@ -78,11 +78,20 @@ typedef struct AVFilterCommand {
struct AVFilterCommand *next;
} AVFilterCommand;
struct AVFilterGraphInternal {
typedef struct FFFilterGraph {
/**
* The public AVFilterGraph. See avfilter.h for it.
*/
AVFilterGraph p;
void *thread;
avfilter_execute_func *thread_execute;
FFFrameQueueGlobal frame_queues;
};
} FFFilterGraph;
static inline FFFilterGraph *fffiltergraph(AVFilterGraph *graph)
{
return (FFFilterGraph*)graph;
}
/**
* Update the position of a link in the age heap.
@@ -119,8 +128,8 @@ int ff_filter_activate(AVFilterContext *filter);
int ff_filter_opt_parse(void *logctx, const AVClass *priv_class,
AVDictionary **options, const char *args);
int ff_graph_thread_init(AVFilterGraph *graph);
int ff_graph_thread_init(FFFilterGraph *graph);
void ff_graph_thread_free(AVFilterGraph *graph);
void ff_graph_thread_free(FFFilterGraph *graph);
#endif /* AVFILTER_AVFILTER_INTERNAL_H */