]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_vflip.c
Merge commit '4521645b1aee9e9ad8f5cea7b2392cd5f6ffcd26'
[ffmpeg] / libavfilter / vf_vflip.c
index 686cd8f35737852b598d9069c7312c0a75e31c2d..bec449f26ac9ca7b9e265277e74d442931724aad 100644 (file)
@@ -36,8 +36,9 @@ typedef struct {
 static int config_input(AVFilterLink *link)
 {
     FlipContext *flip = link->dst->priv;
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
 
-    flip->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
+    flip->vsub = desc->log2_chroma_h;
 
     return 0;
 }
@@ -96,20 +97,32 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     return ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
 }
 
+static const AVFilterPad avfilter_vf_vflip_inputs[] = {
+    {
+        .name             = "default",
+        .type             = AVMEDIA_TYPE_VIDEO,
+        .get_video_buffer = get_video_buffer,
+        .start_frame      = start_frame,
+        .draw_slice       = draw_slice,
+        .config_props     = config_input,
+    },
+    { NULL }
+};
+
+static const AVFilterPad avfilter_vf_vflip_outputs[] = {
+    {
+        .name = "default",
+        .type = AVMEDIA_TYPE_VIDEO,
+    },
+    { NULL }
+};
+
 AVFilter avfilter_vf_vflip = {
     .name      = "vflip",
     .description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
 
     .priv_size = sizeof(FlipContext),
 
-    .inputs    = (const AVFilterPad[]) {{ .name             = "default",
-                                          .type             = AVMEDIA_TYPE_VIDEO,
-                                          .get_video_buffer = get_video_buffer,
-                                          .start_frame      = start_frame,
-                                          .draw_slice       = draw_slice,
-                                          .config_props     = config_input, },
-                                        { .name = NULL}},
-    .outputs   = (const AVFilterPad[]) {{ .name             = "default",
-                                          .type             = AVMEDIA_TYPE_VIDEO, },
-                                        { .name = NULL}},
+    .inputs    = avfilter_vf_vflip_inputs,
+    .outputs   = avfilter_vf_vflip_outputs,
 };