diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-30 16:09:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-30 16:09:32 +0100 |
| commit | a38a20cb7ada1a17231c7bdedab79618d5390736 (patch) | |
| tree | c69f6efdbfb9a4edcfefc4023329fbff4c35ace1 /src | |
| parent | 29b507d5ed965367c2daa8c68316a1b336edd614 (diff) | |
Remove fps/length from CPL.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 23 | ||||
| -rw-r--r-- | src/cpl.h | 25 |
2 files changed, 11 insertions, 37 deletions
@@ -44,12 +44,10 @@ using boost::lexical_cast; using boost::optional; using namespace libdcp; -CPL::CPL (string directory, string name, ContentKind content_kind, int length, int frames_per_second) +CPL::CPL (string directory, string name, ContentKind content_kind) : _directory (directory) , _name (name) , _content_kind (content_kind) - , _length (length) - , _fps (frames_per_second) { _id = make_uuid (); } @@ -63,8 +61,6 @@ CPL::CPL (string directory, string name, ContentKind content_kind, int length, i CPL::CPL (string directory, string file, list<PathAssetMap> asset_maps, bool require_mxfs) : _directory (directory) , _content_kind (FEATURE) - , _length (0) - , _fps (0) { /* Read the XML */ shared_ptr<parse::CPL> cpl; @@ -91,9 +87,6 @@ CPL::CPL (string directory, string file, list<PathAssetMap> asset_maps, bool req } else { p = (*i)->asset_list->main_stereoscopic_picture; } - - _fps = p->edit_rate.numerator; - _length += p->duration; shared_ptr<PictureAsset> picture; shared_ptr<SoundAsset> sound; @@ -135,7 +128,7 @@ CPL::CPL (string directory, string file, list<PathAssetMap> asset_maps, bool req picture.reset (new StereoPictureAsset ( asset.first, asset.second->chunks.front()->path, - _fps, + p->edit_rate.numerator, p->duration ) ); @@ -253,7 +246,7 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<Encryptio doc.write_to_file_formatted (p.string (), "UTF-8"); _digest = make_digest (p.string (), 0); - _length = boost::filesystem::file_size (p.string ()); + _length = boost::filesystem::file_size (p); } void @@ -315,16 +308,6 @@ CPL::equals (CPL const & other, EqualityOptions opt, boost::function<void (NoteT return false; } - if (_fps != other._fps) { - note (ERROR, String::compose ("frames per second differ (%1 vs %2)", _fps, other._fps)); - return false; - } - - if (_length != other._length) { - stringstream s; - note (ERROR, String::compose ("lengths differ (%1 vs %2)", _length, other._length)); - } - if (_reels.size() != other._reels.size()) { note (ERROR, String::compose ("reel counts differ (%1 vs %2)", _reels.size(), other._reels.size())); return false; @@ -43,20 +43,15 @@ class MXFMetadata; class Encryption; class KDM; -/** @brief A CPL within a DCP */ +/** @brief A composition playlist (CPL) */ class CPL { public: - CPL (std::string directory, std::string name, ContentKind content_kind, int length, int frames_per_second); + CPL (std::string directory, std::string name, ContentKind content_kind); CPL (std::string directory, std::string file, std::list<PathAssetMap> asset_maps, bool require_mxfs = true); void add_reel (boost::shared_ptr<Reel> reel); - /** @return the length in frames */ - int length () const { - return _length; - } - /** @return the type of the content, used by media servers * to categorise things (e.g. feature, trailer, etc.) */ @@ -75,11 +70,6 @@ public: return _name; } - /** @return the number of frames per second */ - int frames_per_second () const { - return _fps; - } - std::list<boost::shared_ptr<const Asset> > assets () const; bool encrypted () const; @@ -115,17 +105,18 @@ private: std::string _name; /** the content kind of the CPL */ ContentKind _content_kind; - /** length in frames */ - mutable int _length; - /** frames per second */ - int _fps; /** reels */ std::list<boost::shared_ptr<Reel> > _reels; /** our UUID */ std::string _id; - /** a SHA1 digest of our XML */ + + + /* XXX: nasty */ + /** the SHA1 digest of our XML the last time it was written to disk */ mutable std::string _digest; + /** file size of our XML the last time it was written to disk */ + mutable int _length; }; } |
