#define OFFSET(x) offsetof(AFormatContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption aformat_options[] = {
{ "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A },
{ "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A },
{ "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A },
{ NULL },
};
-static const AVClass aformat_class = {
- .class_name = "aformat",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(aformat);
#define PARSE_FORMATS(str, type, list, add_to_list, get_fmt, none, desc) \
do { \
{0}
};
-static const AVClass amerge_class = {
- .class_name = "amerge",
- .item_name = av_default_item_name,
- .option = amerge_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(amerge);
static av_cold void uninit(AVFilterContext *ctx)
{
#define OFFSET(x) offsetof(MixContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption amix_options[] = {
{ "inputs", "Number of inputs.",
OFFSET(nb_inputs), AV_OPT_TYPE_INT, { 2 }, 1, 32, A },
{ "duration", "How to determine the end-of-stream.",
{ NULL },
};
-static const AVClass amix_class = {
- .class_name = "amix",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
-
+AVFILTER_DEFINE_CLASS(amix);
/**
* Update the scaling factors to apply to each input during mixing.
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
+#include "internal.h"
#include "formats.h"
typedef struct {
#define OFFSET(x) offsetof(ASNSContext, x)
-static const AVOption asns_options[] = {
+static const AVOption asetnsamples_options[] = {
{ "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{ "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 },
{ "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.dbl=1024}, 1, INT_MAX },
{ NULL }
};
-static const AVClass asns_class = {
- .class_name = "asetnsamples",
- .item_name = av_default_item_name,
- .option = asns_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(asetnsamples);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
ASNSContext *asns = ctx->priv;
int err;
- asns->class = &asns_class;
+ asns->class = &asetnsamples_class;
av_opt_set_defaults(asns);
if ((err = av_set_options_string(asns, args, "=", ":")) < 0) {
#define OFFSET(x) offsetof(ASyncContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption asyncts_options[] = {
{ "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_INT, { 0 }, 0, 1, A },
{ "min_delta", "Minimum difference between timestamps and audio data "
"(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A },
{ NULL },
};
-static const AVClass async_class = {
- .class_name = "asyncts",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(asyncts);
static int init(AVFilterContext *ctx, const char *args, void *opaque)
{
ASyncContext *s = ctx->priv;
int ret;
- s->class = &async_class;
+ s->class = &asyncts_class;
av_opt_set_defaults(s);
if ((ret = av_set_options_string(s, args, "=", ":")) < 0) {
#define OFFSET(x) offsetof(ChannelSplitContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption options[] = {
+static const AVOption channelsplit_options[] = {
{ "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A },
{ NULL },
};
-static const AVClass channelsplit_class = {
- .class_name = "channelsplit",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(channelsplit);
static int init(AVFilterContext *ctx, const char *arg, void *opaque)
{
#include "audio.h"
#include "formats.h"
#include "avfilter.h"
+#include "internal.h"
typedef struct {
const AVClass *class;
{ NULL },
};
-static const AVClass silencedetect_class = {
- .class_name = "silencedetect",
- .item_name = av_default_item_name,
- .option = silencedetect_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(silencedetect);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#define OFFSET(x) offsetof(EvalContext, x)
-static const AVOption eval_options[]= {
+static const AVOption aevalsrc_options[]= {
{ "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX },
{ "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX },
{ "sample_rate", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, CHAR_MIN, CHAR_MAX },
{NULL},
};
-static const AVClass eval_class = {
- .class_name = "aevalsrc",
- .item_name = av_default_item_name,
- .option = eval_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(aevalsrc);
static int init(AVFilterContext *ctx, const char *args, void *opaque)
{
char *expr, *buf, *bufptr;
int ret, i;
- eval->class = &eval_class;
+ eval->class = &aevalsrc_class;
av_opt_set_defaults(eval);
/* parse expressions */
{ NULL },
};
-static const AVClass anullsrc_class = {
- .class_name = "anullsrc",
- .item_name = av_default_item_name,
- .option = anullsrc_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(anullsrc);
static int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#include "formats.h"
#include "audio.h"
#include "video.h"
+#include "internal.h"
typedef struct {
const AVClass *class;
{ NULL },
};
-static const AVClass showwaves_class = {
- .class_name = "showwaves",
- .item_name = av_default_item_name,
- .option = showwaves_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(showwaves);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#define OFFSET(x) offsetof(BufferSourceContext, x)
#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption video_options[] = {
+static const AVOption buffer_options[] = {
{ "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V },
{ "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V },
{ "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = V },
};
#undef V
-static const AVClass vbuffer_class = {
- .class_name = "vbuffer source",
- .item_name = av_default_item_name,
- .option = video_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(buffer);
static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque)
{
char pix_fmt_str[128], sws_param[256] = "", *colon, *equal;
int ret, n = 0;
- c->class = &vbuffer_class;
+ c->class = &buffer_class;
if (!args) {
av_log(ctx, AV_LOG_ERROR, "Arguments required\n");
}
#define A AV_OPT_FLAG_AUDIO_PARAM
-static const AVOption audio_options[] = {
+static const AVOption abuffer_options[] = {
{ "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, A },
{ "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, A },
{ "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = A },
{ NULL },
};
-static const AVClass abuffer_class = {
- .class_name = "abuffer source",
- .item_name = av_default_item_name,
- .option = audio_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(abuffer);
static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque)
{
*/
int ff_request_frame(AVFilterLink *link);
+#define AVFILTER_DEFINE_CLASS(fname) \
+ static const AVClass fname##_class = { \
+ .class_name = #fname, \
+ .item_name = av_default_item_name, \
+ .option = fname##_options, \
+ .version = LIBAVUTIL_VERSION_INT, \
+ .category = AV_CLASS_CATEGORY_FILTER, \
+ }
+
#endif /* AVFILTER_INTERNAL_H */
{NULL},
};
-static const AVClass movie_class = {
- .class_name = "movie",
- .item_name = av_default_item_name,
- .option = movie_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(movie);
static av_cold int movie_common_init(AVFilterContext *ctx, const char *args, void *opaque,
enum AVMediaType type)
#include "libavutil/parseutils.h"
#include "drawutils.h"
#include "avfilter.h"
+#include "internal.h"
#include "formats.h"
#include "video.h"
{NULL},
};
-static const AVClass ass_class = {
- .class_name = "ass",
- .item_name = av_default_item_name,
- .option = ass_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(ass);
/* libass supports a log level ranging from 0 to 7 */
int ass_libav_log_level_map[] = {
{ NULL },
};
-static const AVClass blackdetect_class = {
- .class_name = "blackdetect",
- .item_name = av_default_item_name,
- .option = blackdetect_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(blackdetect);
#define YUVJ_FORMATS \
PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P
{NULL},
};
-static const AVClass delogo_class = {
- .class_name = "delogo",
- .item_name = av_default_item_name,
- .option = delogo_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(delogo);
static int query_formats(AVFilterContext *ctx)
{
{NULL},
};
-static const AVClass drawtext_class = {
- .class_name = "drawtext",
- .item_name = av_default_item_name,
- .option = drawtext_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(drawtext);
#undef __FTERRORS_H__
#define FT_ERROR_START_LIST {
{NULL},
};
-static const AVClass fade_class = {
- .class_name = "fade",
- .item_name = av_default_item_name,
- .option = fade_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(fade);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#define OFFSET(x) offsetof(FPSContext, x)
#define V AV_OPT_FLAG_VIDEO_PARAM
-static const AVOption options[] = {
+static const AVOption fps_options[] = {
{ "fps", "A string describing desired output framerate", OFFSET(fps), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = V },
{ NULL },
};
-static const AVClass class = {
- .class_name = "fps",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(fps);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
FPSContext *s = ctx->priv;
int ret;
- s->class = &class;
+ s->class = &fps_class;
av_opt_set_defaults(s);
if ((ret = av_set_options_string(s, args, "=", ":")) < 0) {
{NULL},
};
-static const AVClass lut_class = {
- .class_name = "lut",
- .item_name = av_default_item_name,
- .option = lut_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(lut);
static int init(AVFilterContext *ctx, const char *args, void *opaque)
{
{NULL},
};
-static const AVClass overlay_class = {
- .class_name = "overlay",
- .item_name = av_default_item_name,
- .option = overlay_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(overlay);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
+#include "internal.h"
#include "formats.h"
#include "video.h"
{ NULL },
};
-static const AVClass cellauto_class = {
- .class_name = "cellauto",
- .item_name = av_default_item_name,
- .option = cellauto_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(cellauto);
#ifdef DEBUG
static void show_cellauto_row(AVFilterContext *ctx)
{ NULL },
};
-static const AVClass color_class = {
- .class_name = "color",
- .item_name = av_default_item_name,
- .option = color_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(color);
static av_cold int color_init(AVFilterContext *ctx, const char *args, void *opaque)
{
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
+#include "internal.h"
#include "formats.h"
#include "video.h"
{ NULL },
};
-static const AVClass life_class = {
- .class_name = "life",
- .item_name = av_default_item_name,
- .option = life_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(life);
static int parse_rule(uint16_t *born_rule, uint16_t *stay_rule,
const char *rule_str, void *log_ctx)
#include "avfilter.h"
#include "formats.h"
#include "video.h"
+#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
{NULL},
};
-static const AVClass mandelbrot_class = {
- .class_name = "mandelbrot",
- .item_name = av_default_item_name,
- .option = mandelbrot_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(mandelbrot);
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "internal.h"
#include "formats.h"
#include "video.h"
{ NULL },
};
-static const AVClass mptestsrc_class = {
- .class_name = "mptestsrc",
- .item_name = av_default_item_name,
- .option = mptestsrc_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(mptestsrc);
static double c[64];
#if CONFIG_TESTSRC_FILTER
-static const AVClass testsrc_class = {
- .class_name = "testsrc",
- .item_name = av_default_item_name,
- .option = testsrc_options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(testsrc);
/**
* Fill a rectangle with value val.