Revision f7ead94c ffplay.c

View differences:

ffplay.c
1779 1779
                                  { .name = NULL }},
1780 1780
};
1781 1781

  
1782
static void output_end_frame(AVFilterLink *link)
1783
{
1784
}
1785

  
1786
static int output_query_formats(AVFilterContext *ctx)
1787
{
1788
    enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
1789

  
1790
    avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
1791
    return 0;
1792
}
1793

  
1794 1782
static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
1795 1783
                                    int64_t *pts, AVRational *tb, int64_t *pos)
1796 1784
{
......
1812 1800

  
1813 1801
    return 1;
1814 1802
}
1815

  
1816
static AVFilter output_filter =
1817
{
1818
    .name      = "ffplay_output",
1819

  
1820
    .query_formats = output_query_formats,
1821

  
1822
    .inputs    = (AVFilterPad[]) {{ .name          = "default",
1823
                                    .type          = AVMEDIA_TYPE_VIDEO,
1824
                                    .end_frame     = output_end_frame,
1825
                                    .min_perms     = AV_PERM_READ, },
1826
                                  { .name = NULL }},
1827
    .outputs   = (AVFilterPad[]) {{ .name = NULL }},
1828
};
1829 1803
#endif  /* CONFIG_AVFILTER */
1830 1804

  
1831 1805
static int video_thread(void *arg)
......
1839 1813
#if CONFIG_AVFILTER
1840 1814
    int64_t pos;
1841 1815
    char sws_flags_str[128];
1816
    FFSinkContext ffsink_ctx = { .pix_fmt = PIX_FMT_YUV420P };
1842 1817
    AVFilterContext *filt_src = NULL, *filt_out = NULL;
1843 1818
    AVFilterGraph *graph = av_mallocz(sizeof(AVFilterGraph));
1844 1819
    snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%d", sws_flags);
1845 1820
    graph->scale_sws_opts = av_strdup(sws_flags_str);
1846 1821

  
1847 1822
    if (avfilter_open(&filt_src, &input_filter,  "src") < 0) goto the_end;
1848
    if (avfilter_open(&filt_out, &output_filter, "out") < 0) goto the_end;
1823
    if (avfilter_open(&filt_out, &ffsink      ,  "out") < 0) goto the_end;
1849 1824

  
1850 1825
    if(avfilter_init_filter(filt_src, NULL, is))             goto the_end;
1851
    if(avfilter_init_filter(filt_out, NULL, NULL))           goto the_end;
1826
    if(avfilter_init_filter(filt_out, NULL, &ffsink_ctx))    goto the_end;
1852 1827

  
1853 1828

  
1854 1829
    if(vfilters) {

Also available in: Unified diff