#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
if (filter->filter->uninit)
filter->filter->uninit(filter);
+ if (filter->filter->shorthand)
+ av_opt_free(filter->priv);
for (i = 0; i < filter->nb_inputs; i++) {
if ((link = filter->inputs[i])) {
{
int ret=0;
+ if (filter->filter->shorthand) {
+ av_assert0(filter->priv);
+ av_assert0(filter->filter->priv_class);
+ *(const AVClass **)filter->priv = filter->filter->priv_class;
+ av_opt_set_defaults(filter->priv);
+ ret = av_opt_set_from_string(filter->priv, args,
+ filter->filter->shorthand, "=", ":");
+ if (ret < 0)
+ return ret;
+ args = NULL;
+ }
if (filter->filter->init_opaque)
ret = filter->filter->init_opaque(filter, args, opaque);
else if (filter->filter->init)
int (*init_opaque)(AVFilterContext *ctx, const char *args, void *opaque);
const AVClass *priv_class; ///< private class, containing filter specific options
+
+ /**
+ * Shorthand syntax for init arguments.
+ * If this field is set (even to an empty list), just before init the
+ * private class will be set and the arguments string will be parsed
+ * using av_opt_set_from_string() with "=" and ":" delimiters, and
+ * av_opt_free() will be called just after uninit.
+ */
+ const char *const *shorthand;
} AVFilter;
/** An instance of a filter */