#include "bitmap_text.h"
#include "decoder.h"
#include "ffmpeg.h"
-#include "util.h"
+#include "video_filter_graph_set.h"
extern "C" {
#include <libavcodec/avcodec.h>
}
private:
friend struct ::ffmpeg_pts_offset_test;
- bool flush ();
+ enum class FlushResult {
+ DONE,
+ AGAIN
+ };
- static std::shared_ptr<AudioBuffers> deinterleave_audio (AVFrame* frame);
+ FlushResult flush();
AVSampleFormat audio_sample_format (std::shared_ptr<FFmpegAudioStream> stream) const;
int bytes_per_audio_sample (std::shared_ptr<FFmpegAudioStream> stream) const;
void maybe_add_subtitle ();
- std::list<std::shared_ptr<VideoFilterGraph>> _filter_graphs;
- boost::mutex _filter_graphs_mutex;
+ FlushResult flush_codecs();
+ FlushResult flush_fill();
+
+ VideoFilterGraphSet _filter_graphs;
dcpomatic::ContentTime _pts_offset;
boost::optional<dcpomatic::ContentTime> _current_subtitle_to;
std::shared_ptr<Image> _black_image;
std::map<std::shared_ptr<FFmpegAudioStream>, boost::optional<dcpomatic::ContentTime>> _next_time;
+
+ enum class FlushState {
+ CODECS,
+ AUDIO_DECODER,
+ FILL,
+ };
+
+ FlushState _flush_state = FlushState::CODECS;
};