Merge FilmState / Film.
[dcpomatic.git] / src / lib / tiff_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/tiff_decoder.h
21  *  @brief A decoder which reads a numbered set of TIFF files, one per frame.
22  */
23
24 #ifndef DVDOMATIC_TIFF_DECODER_H
25 #define DVDOMATIC_TIFF_DECODER_H
26
27 #include <vector>
28 #include <string>
29 #include <stdint.h>
30 #include <boost/shared_ptr.hpp>
31 #include "util.h"
32 #include "decoder.h"
33
34 class Job;
35 class FilmState;
36 class Options;
37 class Image;
38
39 /** @class TIFFDecoder.
40  *  @brief A decoder which reads a numbered set of TIFF files, one per frame.
41  */
42 class TIFFDecoder : public Decoder
43 {
44 public:
45         TIFFDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool, bool);
46
47         /* Methods to query our input video */
48         float frames_per_second () const;
49         Size native_size () const;
50         int audio_channels () const;
51         int audio_sample_rate () const;
52         AVSampleFormat audio_sample_format () const;
53         int64_t audio_channel_layout () const;
54         bool has_subtitles () const {
55                 return false;
56         }
57
58 private:
59         bool do_pass ();
60         PixelFormat pixel_format () const;
61         int time_base_numerator () const;
62         int time_base_denominator () const;
63         int sample_aspect_ratio_numerator () const;
64         int sample_aspect_ratio_denominator () const;
65         
66         std::string file_path (std::string) const;
67         std::list<std::string> _files;
68         std::list<std::string>::iterator _iter;
69 };
70
71 #endif