Commit 5b190714 authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add ff_filter_get_nb_threads()

parent 44933908
......@@ -783,6 +783,13 @@ void avfilter_free(AVFilterContext *filter)
av_free(filter);
}
int ff_filter_get_nb_threads(AVFilterContext *ctx)
{
if (ctx->nb_threads > 0)
return FFMIN(ctx->nb_threads, ctx->graph->nb_threads);
return ctx->graph->nb_threads;
}
static int process_options(AVFilterContext *ctx, AVDictionary **options,
const char *args)
{
......
......@@ -402,4 +402,10 @@ static inline int ff_norm_qscale(int qscale, int type)
return qscale;
}
/**
* Get number of threads for current filter instance.
* This number is always same or less than graph->nb_threads.
*/
int ff_filter_get_nb_threads(AVFilterContext *ctx);
#endif /* AVFILTER_INTERNAL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment