History

avfilter: add ff_filter_get_nb_threads()

Paul B Mahol committed 10 years ago

Commit 5b190711 parent 44933902 files · +13 −0Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.c +7 −0
  2. libavfilter/internal.h +6 −0
libavfilter/avfilter.c+7−0
@@ -783,6 +783,13 @@ void avfilter_free(AVFilterContext *filter) · 782 unmodified lines
783783 av_free(filter);
784784 }
785785
786+int ff_filter_get_nb_threads(AVFilterContext *ctx)
787+{
788+ if (ctx->nb_threads > 0)
789+ return FFMIN(ctx->nb_threads, ctx->graph->nb_threads);
790+ return ctx->graph->nb_threads;
791+}
792+
786793 static int process_options(AVFilterContext *ctx, AVDictionary **options,
787794 const char *args)
788795 {
libavfilter/internal.h+6−0
@@ -402,4 +402,10 @@ static inline int ff_norm_qscale(int qscale, int type) · 401 unmodified lines
402402 return qscale;
403403 }
404404
405+/**
406+ * Get number of threads for current filter instance.
407+ * This number is always same or less than graph->nb_threads.
408+ */
409+int ff_filter_get_nb_threads(AVFilterContext *ctx);
410+
405411 #endif /* AVFILTER_INTERNAL_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