X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdecoder.cc;h=18c5acd3551b3442eea6e8882d16f08f658f48b2;hb=9c399a21b37d83ceb2c81706975e2c46d1a3f673;hp=93ce2cdbb2c816d0b388fba69e556c70a27dffed;hpb=c726a221e619d22ad5253eaa6c3429bce557e111;p=dcpomatic.git diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 93ce2cdbb..18c5acd35 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -21,44 +21,47 @@ * @brief Parent class for decoders of content. */ -#include -#include -#include #include "film.h" -#include "format.h" -#include "job.h" -#include "options.h" -#include "exceptions.h" -#include "image.h" -#include "util.h" -#include "log.h" #include "decoder.h" -#include "delay_line.h" -#include "subtitle.h" -#include "filter_graph.h" - -using std::string; -using std::stringstream; -using std::min; -using std::pair; -using std::list; + +#include "i18n.h" + using boost::shared_ptr; -using boost::optional; /** @param f Film. - * @param o Options. - * @param j Job that we are running within, or 0 + * @param o Decode options. */ -Decoder::Decoder (boost::shared_ptr f, boost::shared_ptr o, Job* j) +Decoder::Decoder (shared_ptr f) : _film (f) - , _opt (o) - , _job (j) { - + +} + +shared_ptr +Decoder::peek () +{ + while (_pending.empty () && !pass ()) {} + + if (_pending.empty ()) { + return shared_ptr (); + } + + return _pending.front (); +} + +shared_ptr +Decoder::get () +{ + shared_ptr d = peek (); + if (d) { + _pending.pop_front (); + } + + return d; } -bool -Decoder::seek (SourceFrame f) +void +Decoder::seek (ContentTime, bool) { - throw DecodeError ("decoder does not support seek"); + _pending.clear (); }