Untested merge of master.
[dcpomatic.git] / src / lib / decoder.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 /** @file  src/decoder.h
21  *  @brief Parent class for decoders of content.
22  */
23
24 #ifndef DCPOMATIC_DECODER_H
25 #define DCPOMATIC_DECODER_H
26
27 #include <vector>
28 #include <string>
29 #include <stdint.h>
30 #include <boost/shared_ptr.hpp>
31 #include <boost/signals2.hpp>
32 #include "util.h"
33 #include "video_source.h"
34 #include "audio_source.h"
35 #include "film.h"
36
37 class Image;
38 class Log;
39 class DelayLine;
40 class TimedSubtitle;
41 class Subtitle;
42 class FilterGraph;
43
44 /** @class Decoder.
45  *  @brief Parent class for decoders of content.
46  *
47  *  These classes can be instructed run through their content (by
48  *  calling ::go), and they emit signals when video or audio data is
49  *  ready for something else to process.
50  */
51 class Decoder
52 {
53 public:
54         Decoder (boost::shared_ptr<const Film>);
55         virtual ~Decoder () {}
56
57         virtual bool pass () = 0;
58         virtual bool seek (double);
59         virtual void seek_back () {}
60         virtual void seek_forward () {}
61
62         boost::signals2::signal<void()> OutputChanged;
63
64 protected:
65         boost::shared_ptr<const Film> _film;
66
67 private:
68         virtual void film_changed (Film::Property) {}
69
70         boost::signals2::scoped_connection _film_connection;
71 };
72
73 #endif