]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_deshake.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavfilter / vf_deshake.c
index cdece5c1bf4f0678d8e5e7a7a866aaa71eadea5a..10d789fd8d0038ab1696d1400075da2b1c221607 100644 (file)
@@ -50,6 +50,8 @@
  */
 
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 #include "libavutil/common.h"
 #include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
@@ -329,7 +331,7 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
     av_free(angles);
 }
 
-static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
+static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     DeshakeContext *deshake = ctx->priv;
     char filename[256] = {0};
@@ -390,7 +392,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
 
     return 0;
 }
@@ -418,7 +420,8 @@ static av_cold void uninit(AVFilterContext *ctx)
     avfilter_unref_buffer(deshake->ref);
     if (deshake->fp)
         fclose(deshake->fp);
-    avcodec_close(deshake->avctx);
+    if (deshake->avctx)
+        avcodec_close(deshake->avctx);
     av_freep(&deshake->avctx);
 }
 
@@ -525,8 +528,8 @@ static void end_frame(AVFilterLink *link)
     deshake->ref = in;
 
     // Draw the transformed frame information
-    avfilter_draw_slice(link->dst->outputs[0], 0, link->h, 1);
-    avfilter_end_frame(link->dst->outputs[0]);
+    ff_draw_slice(link->dst->outputs[0], 0, link->h, 1);
+    ff_end_frame(link->dst->outputs[0]);
     avfilter_unref_buffer(out);
 }