X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdecoder.h;h=583a92636443ba7cd1bd650eb3cf61144017394c;hb=edbb857ebfc7fa0f423ab6f402736f46a4fa058b;hp=cd033b5f9ccb9fe39f02ee80b16bac53cbb6eb57;hpb=4fbd1901fdabc829cfa7e7d4d0c1272bba87033c;p=dcpomatic.git diff --git a/src/lib/decoder.h b/src/lib/decoder.h index cd033b5f9..583a92636 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2013 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,56 +18,39 @@ */ /** @file src/decoder.h - * @brief Parent class for decoders of content. + * @brief Decoder class. */ -#ifndef DVDOMATIC_DECODER_H -#define DVDOMATIC_DECODER_H +#ifndef DCPOMATIC_DECODER_H +#define DCPOMATIC_DECODER_H -#include -#include -#include #include -#include -#include "util.h" -#include "stream.h" -#include "video_source.h" -#include "audio_source.h" +#include +#include +#include "types.h" +#include "dcpomatic_time.h" -class Job; -class Options; -class Image; -class Log; -class DelayLine; -class TimedSubtitle; -class Subtitle; -class Film; -class FilterGraph; +class Decoded; /** @class Decoder. * @brief Parent class for decoders of content. - * - * These classes can be instructed run through their content (by - * calling ::go), and they emit signals when video or audio data is - * ready for something else to process. */ -class Decoder +class Decoder : public boost::noncopyable { public: - Decoder (boost::shared_ptr, boost::shared_ptr, Job *); virtual ~Decoder () {} +protected: + /** Seek so that the next pass() will yield the next thing + * (video/sound frame, subtitle etc.) at or after the requested + * time. Pass accurate = true to try harder to ensure that, at worst, + * the next thing we yield comes before `time'. This may entail + * seeking some way before `time' to be on the safe side. + * Alternatively, if seeking is 100% accurate for this decoder, + * it may seek to just the right spot. + */ + virtual void seek (ContentTime time, bool accurate) = 0; virtual bool pass () = 0; - -protected: - virtual void set_progress () const {} - - /** our Film */ - boost::shared_ptr _film; - /** our options */ - boost::shared_ptr _opt; - /** associated Job, or 0 */ - Job* _job; }; #endif