2 Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
21 /** @file src/lib/dcp_examiner.h
22 * @brief DCPExaminer class.
25 #include "video_examiner.h"
26 #include "audio_examiner.h"
31 class DCPExaminer : public DCP, public VideoExaminer, public AudioExaminer
34 explicit DCPExaminer (boost::shared_ptr<const DCPContent>);
36 bool has_video () const {
40 boost::optional<double> video_frame_rate () const {
41 return _video_frame_rate;
44 dcp::Size video_size () const {
45 DCPOMATIC_ASSERT (_has_video);
46 DCPOMATIC_ASSERT (_video_size);
50 Frame video_length () const {
58 std::string name () const {
62 bool encrypted () const {
66 bool needs_assets () const {
70 bool has_audio () const {
74 int audio_channels () const {
75 return _audio_channels.get_value_or (0);
78 Frame audio_length () const {
82 int audio_frame_rate () const {
83 return _audio_frame_rate.get_value_or (48000);
86 /** @param type TEXT_OPEN_SUBTITLE or TEXT_CLOSED_CAPTION.
87 * @return Number of assets of this type in this DCP.
89 int text_count (TextType type) const {
90 return _text_count[type];
93 bool kdm_valid () const {
97 boost::optional<dcp::Standard> standard () const {
101 bool three_d () const {
105 dcp::ContentKind content_kind () const {
106 return _content_kind;
109 std::string cpl () const {
113 std::list<int64_t> reel_lengths () const {
114 return _reel_lengths;
118 boost::optional<double> _video_frame_rate;
119 boost::optional<dcp::Size> _video_size;
121 boost::optional<int> _audio_channels;
122 boost::optional<int> _audio_frame_rate;
125 /** true if this DCP has video content (but false if it has unresolved references to video content) */
127 /** true if this DCP has audio content (but false if it has unresolved references to audio content) */
129 /** number of different assets of each type (OCAP/CCAP) */
130 int _text_count[TEXT_COUNT];
134 boost::optional<dcp::Standard> _standard;
136 dcp::ContentKind _content_kind;
138 std::list<int64_t> _reel_lengths;