Move things round a bit.
[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 class Log;
39
40 /** @class TIFFDecoder.
41  *  @brief A decoder which reads a numbered set of TIFF files, one per frame.
42  */
43 class TIFFDecoder : public Decoder
44 {
45 public:
46         TIFFDecoder (boost::shared_ptr<const FilmState>, boost::shared_ptr<const Options>, Job *, Log *, bool, bool);
47
48         /* Methods to query our input video */
49         int length_in_frames () const;
50         float frames_per_second () const;
51         Size native_size () const;
52         int audio_channels () const;
53         int audio_sample_rate () const;
54         AVSampleFormat audio_sample_format () const;
55
56 private:
57         bool do_pass ();
58         PixelFormat pixel_format () const;
59         int time_base_numerator () const;
60         int time_base_denominator () const;
61         int sample_aspect_ratio_numerator () const;
62         int sample_aspect_ratio_denominator () const;
63         
64         std::string file_path (std::string) const;
65         std::list<std::string> _files;
66         std::list<std::string>::iterator _iter;
67 };
68
69 #endif