diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-24 13:47:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-24 14:07:00 +0200 |
commit | 8d4e969afe6bd15143a8a511587640417b0fb6dd (patch) | |
tree | 1608095a543b1c3549f20f9ab2d9e326e6e8169e /libavfilter/avfilter.h | |
parent | fe40a9f98f599699b0989d8c8cb35cb24eb2e52f (diff) | |
parent | 129bb238430ec45a3b5f8f1d384df590ddf7b62f (diff) | |
download | ffmpeg-8d4e969afe6bd15143a8a511587640417b0fb6dd.tar.gz |
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
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avfilter.h')
-rw-r--r-- | libavfilter/avfilter.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 741ec350b8..54a28f0b04 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -429,6 +429,11 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); */ #define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1) /** + * The filter supports multithreading by splitting frames into multiple parts + * and processing them concurrently. + */ +#define AVFILTER_FLAG_SLICE_THREADS (1 << 2) +/** * Some filters support a generic "enable" expression option that can be used * to enable or disable a filter in the timeline. Filters supporting this * option have this flag set. When the enable expression is false, the default @@ -542,6 +547,13 @@ typedef struct AVFilter { int (*init_opaque)(AVFilterContext *ctx, void *opaque); } AVFilter; +/** + * Process multiple parts of the frame concurrently. + */ +#define AVFILTER_THREAD_SLICE (1 << 0) + +typedef struct AVFilterInternal AVFilterInternal; + /** An instance of a filter */ struct AVFilterContext { const AVClass *av_class; ///< needed for av_log() and filters common options @@ -568,6 +580,29 @@ struct AVFilterContext { struct AVFilterGraph *graph; ///< filtergraph this filter belongs to + /** + * Type of multithreading being allowed/used. A combination of + * AVFILTER_THREAD_* flags. + * + * May be set by the caller before initializing the filter to forbid some + * or all kinds of multithreading for this filter. The default is allowing + * everything. + * + * When the filter is initialized, this field is combined using bit AND with + * AVFilterGraph.thread_type to get the final mask used for determining + * allowed threading types. I.e. a threading type needs to be set in both + * to be allowed. + * + * After the filter is initialzed, libavfilter sets this field to the + * threading type that is actually used (0 for no multithreading). + */ + int thread_type; + + /** + * An opaque struct for libavfilter internal use. + */ + AVFilterInternal *internal; + struct AVFilterCommand *command_queue; char *enable_str; ///< enable expression string @@ -1020,6 +1055,8 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src); */ const AVClass *avfilter_get_class(void); +typedef struct AVFilterGraphInternal AVFilterGraphInternal; + typedef struct AVFilterGraph { const AVClass *av_class; #if FF_API_FOO_COUNT @@ -1036,6 +1073,33 @@ typedef struct AVFilterGraph { #if FF_API_FOO_COUNT unsigned nb_filters; #endif + + /** + * Type of multithreading allowed for filters in this graph. A combination + * of AVFILTER_THREAD_* flags. + * + * May be set by the caller at any point, the setting will apply to all + * filters initialized after that. The default is allowing everything. + * + * When a filter in this graph is initialized, this field is combined using + * bit AND with AVFilterContext.thread_type to get the final mask used for + * determining allowed threading types. I.e. a threading type needs to be + * set in both to be allowed. + */ + int thread_type; + + /** + * Maximum number of threads used by filters in this graph. May be set by + * the caller before adding any filters to the filtergraph. Zero (the + * default) means that the number of threads is determined automatically. + */ + int nb_threads; + + /** + * Opaque object for libavfilter internal use. + */ + AVFilterGraphInternal *internal; + char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions /** |