]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_hysteresis.c
avdevice/decklink_dec: autodetect the video input format
[ffmpeg] / libavfilter / vf_hysteresis.c
index a788e1b9ee64b75f6175e4eac4fcff318d2781ff..551b33f33258b6d2840813126412823b7e40c814 100644 (file)
@@ -33,6 +33,7 @@
 
 typedef struct HysteresisContext {
     const AVClass *class;
+    FFFrameSync fs;
 
     int planes;
     int threshold;
@@ -40,7 +41,6 @@ typedef struct HysteresisContext {
     int width[4], height[4];
     int nb_planes;
     int depth;
-    FFFrameSync fs;
 
     uint8_t *map;
     uint32_t *xy;
@@ -58,8 +58,6 @@ static const AVOption hysteresis_options[] = {
     { NULL }
 };
 
-AVFILTER_DEFINE_CLASS(hysteresis);
-
 static int query_formats(AVFilterContext *ctx)
 {
     static const enum AVPixelFormat pix_fmts[] = {
@@ -301,20 +299,13 @@ static int config_output(AVFilterLink *outlink)
         av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");
         return AVERROR(EINVAL);
     }
-    if (base->w                       != alt->w ||
-        base->h                       != alt->h ||
-        base->sample_aspect_ratio.num != alt->sample_aspect_ratio.num ||
-        base->sample_aspect_ratio.den != alt->sample_aspect_ratio.den) {
+    if (base->w != alt->w || base->h != alt->h) {
         av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
-               "(size %dx%d, SAR %d:%d) do not match the corresponding "
-               "second input link %s parameters (%dx%d, SAR %d:%d)\n",
+               "(size %dx%d) do not match the corresponding "
+               "second input link %s parameters (size %dx%d)\n",
                ctx->input_pads[0].name, base->w, base->h,
-               base->sample_aspect_ratio.num,
-               base->sample_aspect_ratio.den,
                ctx->input_pads[1].name,
-               alt->w, alt->h,
-               alt->sample_aspect_ratio.num,
-               alt->sample_aspect_ratio.den);
+               alt->w, alt->h);
         return AVERROR(EINVAL);
     }
 
@@ -357,6 +348,8 @@ static av_cold void uninit(AVFilterContext *ctx)
     av_freep(&s->xy);
 }
 
+FRAMESYNC_DEFINE_CLASS(hysteresis, HysteresisContext, fs);
+
 static const AVFilterPad hysteresis_inputs[] = {
     {
         .name         = "base",
@@ -382,6 +375,7 @@ static const AVFilterPad hysteresis_outputs[] = {
 AVFilter ff_vf_hysteresis = {
     .name          = "hysteresis",
     .description   = NULL_IF_CONFIG_SMALL("Grow first stream into second stream by connecting components."),
+    .preinit       = hysteresis_framesync_preinit,
     .priv_size     = sizeof(HysteresisContext),
     .uninit        = uninit,
     .query_formats = query_formats,