X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Ffilter_graph.h;h=8a8dd9a30e4da857fc46ccff6f649ad53aa8669f;hb=aeb835a18c8df347e0ed68fb24631b320abeb611;hp=2138943e42b6e3e6ef11ba4967f0c85f0755d618;hpb=3fc3aad8735903ced3dae65f764eb33e3f5b3f11;p=dcpomatic.git diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h index 2138943e4..8a8dd9a30 100644 --- a/src/lib/filter_graph.h +++ b/src/lib/filter_graph.h @@ -21,52 +21,36 @@ * @brief A graph of FFmpeg filters. */ -#ifndef DVDOMATIC_FILTER_GRAPH_H -#define DVDOMATIC_FILTER_GRAPH_H +#ifndef DCPOMATIC_FILTER_GRAPH_H +#define DCPOMATIC_FILTER_GRAPH_H #include "util.h" +struct AVFilterContext; +struct AVFrame; class Image; -class VideoFilter; -class FFmpegDecoder; +class FFmpegContent; -class FilterGraph -{ -public: - virtual bool can_process (libdcp::Size, AVPixelFormat) const = 0; - virtual std::list > process (AVFrame *) = 0; -}; - -class EmptyFilterGraph : public FilterGraph -{ -public: - bool can_process (libdcp::Size, AVPixelFormat) const { - return true; - } - - std::list > process (AVFrame *); -}; - -/** @class FFmpegFilterGraph +/** @class FilterGraph * @brief A graph of FFmpeg filters. */ -class FFmpegFilterGraph : public FilterGraph +class FilterGraph : public boost::noncopyable { public: - FFmpegFilterGraph (boost::shared_ptr film, FFmpegDecoder* decoder, libdcp::Size s, AVPixelFormat p); - ~FFmpegFilterGraph (); + FilterGraph (boost::shared_ptr content, dcp::Size s, AVPixelFormat p); + ~FilterGraph (); - bool can_process (libdcp::Size s, AVPixelFormat p) const; - std::list > process (AVFrame * frame); + bool can_process (dcp::Size s, AVPixelFormat p) const; + std::list, int64_t> > process (AVFrame * frame); private: + /** true if this graph has no filters in, so it just copies stuff straight through */ + bool _copy; AVFilterContext* _buffer_src_context; AVFilterContext* _buffer_sink_context; - libdcp::Size _size; ///< size of the images that this chain can process + dcp::Size _size; ///< size of the images that this chain can process AVPixelFormat _pixel_format; ///< pixel format of the images that this chain can process AVFrame* _frame; }; -boost::shared_ptr filter_graph_factory (boost::shared_ptr, FFmpegDecoder *, libdcp::Size, AVPixelFormat); - #endif