Supporters update.
[dcpomatic.git] / src / lib / video_examiner.h
1 /*
2     Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 /** @file  src/lib/video_examiner.h
23  *  @brief VideoExaminer class.
24  */
25
26
27 #include "pixel_quanta.h"
28 #include "video_content.h"
29 #include <dcp/types.h>
30
31
32 /** @class VideoExaminer
33  *  @brief Parent for classes which examine video sources and obtain information about them.
34  */
35 class VideoExaminer
36 {
37 public:
38         virtual ~VideoExaminer () {}
39
40         virtual bool has_video () const = 0;
41
42         /** @return video frame rate (if known); must not be called if has_video() == false */
43         virtual boost::optional<double> video_frame_rate () const = 0;
44         /** @return video size (if known) */
45         virtual boost::optional<dcp::Size> video_size() const = 0;
46         /** @return video length in frames; must not be called if has_video() == false */
47         virtual Frame video_length () const = 0;
48         /** @return video sample aspect ratio (if known); must not be called if has_video() == false */
49         virtual boost::optional<double> sample_aspect_ratio () const {
50                 return {};
51         }
52         /** @return true if this video is in YUV; must not be called if has_video() == false */
53         virtual bool yuv () const = 0;
54         virtual VideoRange range () const = 0;
55         virtual PixelQuanta pixel_quanta () const = 0;
56 };