X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_decoder.h;h=640229f23f74a757e39df7368bcec0ccec9ac0a8;hb=HEAD;hp=9de44333ca9267da4b1ef7ffd341b621a0bba37d;hpb=94eff17bdb94c170d456c7dab5ad3d4c00af4b14;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; };