/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
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
*/
/** @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 <vector>
-#include <string>
-#include <stdint.h>
#include <boost/shared_ptr.hpp>
-#include <boost/signals2.hpp>
-#include "util.h"
-#include "stream.h"
-#include "video_source.h"
-#include "audio_source.h"
-#include "film.h"
-#include "options.h"
+#include <boost/weak_ptr.hpp>
+#include <boost/utility.hpp>
+#include "types.h"
+#include "dcpomatic_time.h"
-class Image;
-class Log;
-class DelayLine;
-class TimedSubtitle;
-class Subtitle;
-class FilterGraph;
+class Decoded;
+class Film;
/** @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<Film>, DecodeOptions);
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 get close to
+ * the request. Note that seeking to time t may mean that
+ * the next pass() yields, for example, audio at time t and then
+ * video before it.
+ */
+ virtual void seek (ContentTime time, bool accurate) = 0;
virtual bool pass () = 0;
- virtual bool seek (double);
- virtual bool seek_to_last ();
- virtual void seek_back () {}
- virtual void seek_forward () {}
-
- boost::signals2::signal<void()> OutputChanged;
-
-protected:
- /** our Film */
- boost::shared_ptr<Film> _film;
- /** our decode options */
- DecodeOptions _opt;
-
-private:
- virtual void film_changed (Film::Property) {}
-
- boost::signals2::scoped_connection _film_connection;
};
#endif