[FFmpeg-cvslog] lavfi/frei0r: make use of AVFILTER_DEFINE_CLASS

Paul B Mahol git at videolan.org
Mon May 27 14:44:38 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May 27 11:19:49 2013 +0000| [229d5bfdc8056099cde07d2c0e4cecbcf06604bd] | committer: Paul B Mahol

lavfi/frei0r: make use of AVFILTER_DEFINE_CLASS

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=229d5bfdc8056099cde07d2c0e4cecbcf06604bd
---

 libavfilter/vf_frei0r.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index 5ace481..9a0ddd2 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -410,18 +410,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 #define OFFSET(x) offsetof(Frei0rContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
-static const AVOption filter_options[] = {
+static const AVOption frei0r_options[] = {
     { "filter_name",   NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
     { "filter_params", NULL, OFFSET(params),  AV_OPT_TYPE_STRING, .flags = FLAGS },
     { NULL },
 };
 
-static const AVClass filter_class = {
-    .class_name = "frei0r",
-    .item_name  = av_default_item_name,
-    .option     = filter_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(frei0r);
 
 static const AVFilterPad avfilter_vf_frei0r_inputs[] = {
     {
@@ -450,7 +445,7 @@ AVFilter avfilter_vf_frei0r = {
     .uninit = uninit,
 
     .priv_size = sizeof(Frei0rContext),
-    .priv_class = &filter_class,
+    .priv_class = &frei0r_class,
 
     .inputs    = avfilter_vf_frei0r_inputs,
 
@@ -516,7 +511,7 @@ static int source_request_frame(AVFilterLink *outlink)
     return ff_filter_frame(outlink, frame);
 }
 
-static const AVOption src_options[] = {
+static const AVOption frei0r_src_options[] = {
     { "size",          "Dimensions of the generated video.", OFFSET(size),      AV_OPT_TYPE_STRING, { .str = "" },   .flags = FLAGS },
     { "framerate",     NULL,                                 OFFSET(framerate), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = FLAGS },
     { "filter_name",   NULL,                                 OFFSET(dl_name),   AV_OPT_TYPE_STRING,                  .flags = FLAGS },
@@ -524,12 +519,7 @@ static const AVOption src_options[] = {
     { NULL },
 };
 
-static const AVClass src_class = {
-    .class_name = "frei0r_src",
-    .item_name  = av_default_item_name,
-    .option     = src_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
+AVFILTER_DEFINE_CLASS(frei0r_src);
 
 static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[] = {
     {
@@ -546,7 +536,7 @@ AVFilter avfilter_vsrc_frei0r_src = {
     .description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."),
 
     .priv_size = sizeof(Frei0rContext),
-    .priv_class = &src_class,
+    .priv_class = &frei0r_src_class,
     .init      = source_init,
     .uninit    = uninit,
 



More information about the ffmpeg-cvslog mailing list