From 596441a4e8cf03a88113646ca6da2f90e721a38b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 22 May 2013 17:36:11 +0100 Subject: Various hacks. --- src/lib/decoder.h | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'src/lib/decoder.h') diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 3876e6c1a..668e44d38 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 @@ -42,10 +42,6 @@ class FilterGraph; /** @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 { @@ -53,23 +49,38 @@ public: Decoder (boost::shared_ptr); virtual ~Decoder () {} - virtual bool pass () = 0; - virtual bool seek (Time); - virtual bool seek_back () { - return true; - } - virtual bool seek_forward () { - return true; - } + /** Perform one decode pass of the content, which may or may not + * cause the object to emit some data. + */ + virtual void pass () = 0; - boost::signals2::signal OutputChanged; + /** Seek this decoder to as close as possible to some time, + * expressed relative to our source's start. + * @param t Time. + */ + virtual void seek (Time t) {} + + /** Seek back one video frame */ + virtual void seek_back () {} + + /** Seek forward one video frame */ + virtual void seek_forward () {} + + /** @return Approximate time of the next content that we will emit, + * expressed relative to the start of our source. + */ + virtual Time next () const = 0; protected: - boost::shared_ptr _film; + + /** The Film that we are decoding in */ + boost::weak_ptr _film; private: + /** This will be called when our Film emits Changed */ virtual void film_changed (Film::Property) {} + /** Connection to our Film */ boost::signals2::scoped_connection _film_connection; }; -- cgit v1.2.3