X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffplay.c;h=8123f4375f6ad6361fa5b6e4e82e3a3e17f835a2;hb=0c9cba24b7c1ef80078c500b44a6bc4788e8fd5b;hp=02d3988d282ca4bf6d92600c1072a4e073babddd;hpb=d2084402e6034e8d49ea50ebe212c4e8783d028a;p=ffmpeg diff --git a/ffplay.c b/ffplay.c index 02d3988d282..8123f4375f6 100644 --- a/ffplay.c +++ b/ffplay.c @@ -43,7 +43,7 @@ # include "libavfilter/avcodec.h" # include "libavfilter/avfilter.h" # include "libavfilter/avfiltergraph.h" -# include "libavfilter/vsink_buffer.h" +# include "libavfilter/buffersink.h" #endif #include @@ -1685,6 +1685,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c char sws_flags_str[128]; int ret; enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; + AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc(); AVFilterContext *filt_src = NULL, *filt_out = NULL; snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%d", sws_flags); graph->scale_sws_opts = av_strdup(sws_flags_str); @@ -1692,8 +1693,16 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c if ((ret = avfilter_graph_create_filter(&filt_src, &input_filter, "src", NULL, is, graph)) < 0) return ret; - if ((ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "out", - NULL, pix_fmts, graph)) < 0) +#if FF_API_OLD_VSINK_API + ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "out", + NULL, pix_fmts, graph); +#else + buffersink_params->pixel_fmts = pix_fmts; + ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "out", + NULL, buffersink_params, graph); +#endif + av_freep(&buffersink_params); + if (ret < 0) return ret; if(vfilters) { @@ -1768,7 +1777,7 @@ static int video_thread(void *arg) last_w = is->video_st->codec->width; last_h = is->video_st->codec->height; } - ret = av_vsink_buffer_get_video_buffer_ref(filt_out, &picref, 0); + ret = av_buffersink_get_buffer_ref(filt_out, &picref, 0); if (picref) { avfilter_fill_frame_from_video_buffer_ref(frame, picref); pts_int = picref->pts;