]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_hflip.c
avfilter/firequalizer: use zero phase kernel
[ffmpeg] / libavfilter / vf_hflip.c
index 6f922847e7cf54784a4b576568c0f3481873cf1f..cf20c193f7c10262cd863734c021c75060dc4484 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <string.h>
 
+#include "libavutil/opt.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "libavutil/imgutils.h"
 
 typedef struct FlipContext {
+    const AVClass *class;
     int max_step[4];    ///< max pixel step for each plane, expressed as a number of bytes
     int planewidth[4];  ///< width of each plane
     int planeheight[4]; ///< height of each plane
 } FlipContext;
 
+static const AVOption hflip_options[] = {
+    { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(hflip);
+
 static int query_formats(AVFilterContext *ctx)
 {
     AVFilterFormats *pix_fmts = NULL;
@@ -166,7 +174,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         memcpy(out->data[1], in->data[1], AVPALETTE_SIZE);
 
     td.in = in, td.out = out;
-    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
+    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 
     av_frame_free(&in);
     return ff_filter_frame(outlink, out);
@@ -194,8 +202,9 @@ AVFilter ff_vf_hflip = {
     .name          = "hflip",
     .description   = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."),
     .priv_size     = sizeof(FlipContext),
+    .priv_class    = &hflip_class,
     .query_formats = query_formats,
     .inputs        = avfilter_vf_hflip_inputs,
     .outputs       = avfilter_vf_hflip_outputs,
-    .flags         = AVFILTER_FLAG_SLICE_THREADS,
+    .flags         = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
 };