History

Merge commit '129bb238430ec45a3b5f8f1d384df590ddf7b62f'

* commit '129bb238430ec45a3b5f8f1d384df590ddf7b62f': lavfi: add a slice threading infrastructure Conflicts: Changelog cmdutils.c doc/APIchanges libavfilter/Makefile libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/avfiltergraph.c libavfilter/internal.h libavfilter/version.h

Michael Niedermayer committed 13 years ago

Commit 8d4e9692 parents fe40a9f 129bb2311 files · +447 −14Browse files

Showing the changes to libavfilter/avfilter.h (1 of 11 files). Show all

Unified · Split

libavfilter/avfilter.h+64−0
@@ -428,6 +428,11 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); · 427 unmodified lines
428428 * the options supplied to it.
429429 */
430430 #define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1)
431+/**
432+ * The filter supports multithreading by splitting frames into multiple parts
433+ * and processing them concurrently.
434+ */
435+#define AVFILTER_FLAG_SLICE_THREADS (1 << 2)
431436 /**
432437 * Some filters support a generic "enable" expression option that can be used
433438 * to enable or disable a filter in the timeline. Filters supporting this
@@ -542,6 +547,13 @@ typedef struct AVFilter { · 108 unmodified lines
542547 int (*init_opaque)(AVFilterContext *ctx, void *opaque);
543548 } AVFilter;
544549
550+/**
551+ * Process multiple parts of the frame concurrently.
552+ */
553+#define AVFILTER_THREAD_SLICE (1 << 0)
554+
555+typedef struct AVFilterInternal AVFilterInternal;
556+
545557 /** An instance of a filter */
546558 struct AVFilterContext {
547559 const AVClass *av_class; ///< needed for av_log() and filters common options
@@ -568,6 +580,29 @@ struct AVFilterContext { · 20 unmodified lines
568580
569581 struct AVFilterGraph *graph; ///< filtergraph this filter belongs to
570582
583+ /**
584+ * Type of multithreading being allowed/used. A combination of
585+ * AVFILTER_THREAD_* flags.
586+ *
587+ * May be set by the caller before initializing the filter to forbid some
588+ * or all kinds of multithreading for this filter. The default is allowing
589+ * everything.
590+ *
591+ * When the filter is initialized, this field is combined using bit AND with
592+ * AVFilterGraph.thread_type to get the final mask used for determining
593+ * allowed threading types. I.e. a threading type needs to be set in both
594+ * to be allowed.
595+ *
596+ * After the filter is initialzed, libavfilter sets this field to the
597+ * threading type that is actually used (0 for no multithreading).
598+ */
599+ int thread_type;
600+
601+ /**
602+ * An opaque struct for libavfilter internal use.
603+ */
604+ AVFilterInternal *internal;
605+
571606 struct AVFilterCommand *command_queue;
572607
573608 char *enable_str; ///< enable expression string
@@ -1020,6 +1055,8 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src); · 446 unmodified lines
10201055 */
10211056 const AVClass *avfilter_get_class(void);
10221057
1058+typedef struct AVFilterGraphInternal AVFilterGraphInternal;
1059+
10231060 typedef struct AVFilterGraph {
10241061 const AVClass *av_class;
10251062 #if FF_API_FOO_COUNT
@@ -1036,6 +1073,33 @@ typedef struct AVFilterGraph { · 10 unmodified lines
10361073 #if FF_API_FOO_COUNT
10371074 unsigned nb_filters;
10381075 #endif
1076+
1077+ /**
1078+ * Type of multithreading allowed for filters in this graph. A combination
1079+ * of AVFILTER_THREAD_* flags.
1080+ *
1081+ * May be set by the caller at any point, the setting will apply to all
1082+ * filters initialized after that. The default is allowing everything.
1083+ *
1084+ * When a filter in this graph is initialized, this field is combined using
1085+ * bit AND with AVFilterContext.thread_type to get the final mask used for
1086+ * determining allowed threading types. I.e. a threading type needs to be
1087+ * set in both to be allowed.
1088+ */
1089+ int thread_type;
1090+
1091+ /**
1092+ * Maximum number of threads used by filters in this graph. May be set by
1093+ * the caller before adding any filters to the filtergraph. Zero (the
1094+ * default) means that the number of threads is determined automatically.
1095+ */
1096+ int nb_threads;
1097+
1098+ /**
1099+ * Opaque object for libavfilter internal use.
1100+ */
1101+ AVFilterGraphInternal *internal;
1102+
10391103 char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
10401104
10411105 /**

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