Revision f7ead94c cmdutils.c

View differences:

cmdutils.c
747 747

  
748 748
    return pts;
749 749
}
750

  
751
#if CONFIG_AVFILTER
752

  
753
static int ffsink_init(AVFilterContext *ctx, const char *args, void *opaque)
754
{
755
    FFSinkContext *priv = ctx->priv;
756

  
757
    if (!opaque)
758
        return AVERROR(EINVAL);
759
    *priv = *(FFSinkContext *)opaque;
760

  
761
    return 0;
762
}
763

  
764
static void null_end_frame(AVFilterLink *inlink) { }
765

  
766
static int ffsink_query_formats(AVFilterContext *ctx)
767
{
768
    FFSinkContext *priv = ctx->priv;
769
    enum PixelFormat pix_fmts[] = { priv->pix_fmt, PIX_FMT_NONE };
770

  
771
    avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
772
    return 0;
773
}
774

  
775
AVFilter ffsink = {
776
    .name      = "ffsink",
777
    .priv_size = sizeof(FFSinkContext),
778
    .init      = ffsink_init,
779

  
780
    .query_formats = ffsink_query_formats,
781

  
782
    .inputs    = (AVFilterPad[]) {{ .name          = "default",
783
                                    .type          = AVMEDIA_TYPE_VIDEO,
784
                                    .end_frame     = null_end_frame,
785
                                    .min_perms     = AV_PERM_READ, },
786
                                  { .name = NULL }},
787
    .outputs   = (AVFilterPad[]) {{ .name = NULL }},
788
};
789

  
790
#endif /* CONFIG_AVFILTER */

Also available in: Unified diff