]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_frei0r.c
nut: add 12/14 bit yuv to nut/raw
[ffmpeg] / libavfilter / vf_frei0r.c
index e3dbf06e45b00f4d222da25532cd69f3ce27afcd..99594551f87d9b51240574ed703be0e274046ed3 100644 (file)
@@ -32,6 +32,7 @@
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "internal.h"
 #include "video.h"
 
 typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height);
@@ -145,7 +146,7 @@ static int set_params(AVFilterContext *ctx, const char *params)
                 return ret;
         }
 
-        av_log(ctx, AV_LOG_INFO,
+        av_log(ctx, AV_LOG_VERBOSE,
                "idx:%d name:'%s' type:%s explanation:'%s' ",
                i, info.name,
                info.type == F0R_PARAM_BOOL     ? "bool"     :
@@ -156,7 +157,7 @@ static int set_params(AVFilterContext *ctx, const char *params)
                info.explanation);
 
 #ifdef DEBUG
-        av_log(ctx, AV_LOG_INFO, "value:");
+        av_log(ctx, AV_LOG_DEBUG, "value:");
         switch (info.type) {
             void *v;
             double d;
@@ -167,31 +168,31 @@ static int set_params(AVFilterContext *ctx, const char *params)
         case F0R_PARAM_BOOL:
             v = &d;
             frei0r->get_param_value(frei0r->instance, v, i);
-            av_log(ctx, AV_LOG_INFO, "%s", d >= 0.5 && d <= 1.0 ? "y" : "n");
+            av_log(ctx, AV_LOG_DEBUG, "%s", d >= 0.5 && d <= 1.0 ? "y" : "n");
             break;
         case F0R_PARAM_DOUBLE:
             v = &d;
             frei0r->get_param_value(frei0r->instance, v, i);
-            av_log(ctx, AV_LOG_INFO, "%f", d);
+            av_log(ctx, AV_LOG_DEBUG, "%f", d);
             break;
         case F0R_PARAM_COLOR:
             v = &col;
             frei0r->get_param_value(frei0r->instance, v, i);
-            av_log(ctx, AV_LOG_INFO, "%f/%f/%f", col.r, col.g, col.b);
+            av_log(ctx, AV_LOG_DEBUG, "%f/%f/%f", col.r, col.g, col.b);
             break;
         case F0R_PARAM_POSITION:
             v = &pos;
             frei0r->get_param_value(frei0r->instance, v, i);
-            av_log(ctx, AV_LOG_INFO, "%lf/%lf", pos.x, pos.y);
+            av_log(ctx, AV_LOG_DEBUG, "%lf/%lf", pos.x, pos.y);
             break;
         default: /* F0R_PARAM_STRING */
             v = s;
             frei0r->get_param_value(frei0r->instance, v, i);
-            av_log(ctx, AV_LOG_INFO, "'%s'\n", s);
+            av_log(ctx, AV_LOG_DEBUG, "'%s'\n", s);
             break;
         }
 #endif
-        av_log(ctx, AV_LOG_INFO, "\n");
+        av_log(ctx, AV_LOG_VERBOSE, "\n");
     }
 
     return 0;
@@ -265,7 +266,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
         return AVERROR(EINVAL);
     }
 
-    av_log(ctx, AV_LOG_INFO,
+    av_log(ctx, AV_LOG_VERBOSE,
            "name:%s author:'%s' explanation:'%s' color_model:%s "
            "frei0r_version:%d version:%d.%d num_params:%d\n",
            pi->name, pi->author, pi->explanation,
@@ -277,7 +278,7 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
     return 0;
 }
 
-static av_cold int filter_init(AVFilterContext *ctx, const char *args, void *opaque)
+static av_cold int filter_init(AVFilterContext *ctx, const char *args)
 {
     Frei0rContext *frei0r = ctx->priv;
     char dl_name[1024], c;
@@ -380,7 +381,7 @@ AVFilter avfilter_vf_frei0r = {
                                   { .name = NULL}},
 };
 
-static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opaque)
+static av_cold int source_init(AVFilterContext *ctx, const char *args)
 {
     Frei0rContext *frei0r = ctx->priv;
     char dl_name[1024], c;
@@ -399,8 +400,7 @@ static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opa
         return AVERROR(EINVAL);
     }
 
-    if (av_parse_video_rate(&frame_rate_q, frame_rate) < 0 ||
-        frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
+    if (av_parse_video_rate(&frame_rate_q, frame_rate) < 0) {
         av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", frame_rate);
         return AVERROR(EINVAL);
     }
@@ -433,7 +433,7 @@ static int source_config_props(AVFilterLink *outlink)
 static int source_request_frame(AVFilterLink *outlink)
 {
     Frei0rContext *frei0r = outlink->src->priv;
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+    AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
     picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     picref->pts = frei0r->pts++;
     picref->pos = -1;