X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fvideo_filter_graph.cc;h=1cc1425202d190f6c5937a16fb4fd29d209bd7a1;hb=1a721b82d4094c00ee89574e17c58c23c0de8cdd;hp=c24d9673d592b24b86679b8743e3634bf59b4f3b;hpb=81646d1dd5b28fa05d8f134142dcbaed6314ebab;p=dcpomatic.git diff --git a/src/lib/video_filter_graph.cc b/src/lib/video_filter_graph.cc index c24d9673d..1cc142520 100644 --- a/src/lib/video_filter_graph.cc +++ b/src/lib/video_filter_graph.cc @@ -22,10 +22,10 @@ #include "compose.hpp" #include "image.h" #include "video_filter_graph.h" -#include "warnings.h" extern "C" { #include #include +#include } #include "i18n.h" @@ -37,7 +37,6 @@ using std::make_shared; using std::pair; using std::shared_ptr; using std::string; -using std::vector; VideoFilterGraph::VideoFilterGraph (dcp::Size s, AVPixelFormat p, dcp::Fraction r) @@ -58,7 +57,7 @@ VideoFilterGraph::process (AVFrame* frame) list, int64_t>> images; if (_copy) { - images.push_back (make_pair(make_shared(frame), frame->best_effort_timestamp)); + images.push_back (make_pair(make_shared(frame, Image::Alignment::PADDED), frame->best_effort_timestamp)); } else { int r = av_buffersrc_write_frame (_buffer_src_context, frame); if (r < 0) { @@ -70,7 +69,7 @@ VideoFilterGraph::process (AVFrame* frame) break; } - images.push_back (make_pair(make_shared(_frame), _frame->best_effort_timestamp)); + images.push_back (make_pair(make_shared(_frame, Image::Alignment::PADDED), frame->best_effort_timestamp)); av_frame_unref (_frame); } } @@ -105,15 +104,12 @@ VideoFilterGraph::src_parameters () const } -void * -VideoFilterGraph::sink_parameters () const +void +VideoFilterGraph::set_parameters (AVFilterContext* context) const { - auto sink_params = av_buffersink_params_alloc (); - auto pixel_fmts = new AVPixelFormat[2]; - pixel_fmts[0] = _pixel_format; - pixel_fmts[1] = AV_PIX_FMT_NONE; - sink_params->pixel_fmts = pixel_fmts; - return sink_params; + AVPixelFormat pix_fmts[] = { _pixel_format, AV_PIX_FMT_NONE }; + int r = av_opt_set_int_list (context, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN); + DCPOMATIC_ASSERT (r >= 0); }