X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fffmpeg_decoder.h;h=bd4b74f88395ddfbb9461ffbcfbd515632fac017;hb=54ca161fd074a7ba17d9aed8479da189374eb64e;hp=9de44333ca9267da4b1ef7ffd341b621a0bba37d;hpb=bdbec5b501af2c020dd783eb8b0b8c18c34b6552;p=dcpomatic.git diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 9de44333c..bd4b74f88 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -28,7 +28,6 @@ #include "decoder.h" #include "ffmpeg.h" #include "video_filter_graph_set.h" -#include "util.h" extern "C" { #include } @@ -58,7 +57,12 @@ public: private: friend struct ::ffmpeg_pts_offset_test; - bool flush (); + enum class FlushResult { + DONE, + AGAIN + }; + + FlushResult flush(); AVSampleFormat audio_sample_format (std::shared_ptr stream) const; int bytes_per_audio_sample (std::shared_ptr stream) const; @@ -77,6 +81,9 @@ private: void maybe_add_subtitle (); + FlushResult flush_codecs(); + FlushResult flush_fill(); + VideoFilterGraphSet _filter_graphs; dcpomatic::ContentTime _pts_offset; @@ -87,4 +94,12 @@ private: std::shared_ptr _black_image; std::map, boost::optional> _next_time; + + enum class FlushState { + CODECS, + AUDIO_DECODER, + FILL, + }; + + FlushState _flush_state = FlushState::CODECS; };