diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-17 17:51:54 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-17 17:51:54 +0000 |
| commit | bfc511b3e2fae3540db2679bfb4532cf4d1e6d05 (patch) | |
| tree | 5aaedb7ebee65a5251ef5cd7380e0892d821490f /src | |
| parent | 44791cafb91bfe1ee5c0a530c83d9f44b4d2f88f (diff) | |
New Asset and Object classes; make CPL use them.
Diffstat (limited to 'src')
| -rw-r--r-- | src/asset.cc | 34 | ||||
| -rw-r--r-- | src/asset.h | 36 | ||||
| -rw-r--r-- | src/cpl.cc | 2 | ||||
| -rw-r--r-- | src/cpl.h | 13 | ||||
| -rw-r--r-- | src/object.cc | 36 | ||||
| -rw-r--r-- | src/object.h | 39 | ||||
| -rw-r--r-- | src/wscript | 3 |
7 files changed, 154 insertions, 9 deletions
diff --git a/src/asset.cc b/src/asset.cc new file mode 100644 index 00000000..0147eba2 --- /dev/null +++ b/src/asset.cc @@ -0,0 +1,34 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "asset.h" + +using std::string; +using namespace dcp; + +Asset::Asset () +{ + +} + +Asset::Asset (string id) + : Object (id) +{ + +} diff --git a/src/asset.h b/src/asset.h new file mode 100644 index 00000000..86d4734e --- /dev/null +++ b/src/asset.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "object.h" + +namespace dcp { + +/** @class Asset + * @brief Parent class for DCP assets, i.e. picture/sound/subtitles, CPLs and PKLs. + */ + +class Asset : public Object +{ +public: + Asset (); + Asset (std::string id); + +}; + +} @@ -50,7 +50,7 @@ CPL::CPL (boost::filesystem::path directory, string name, ContentKind content_ki , _length (length) , _fps (frames_per_second) { - _id = make_uuid (); + } /** Construct a CPL object from a XML file. @@ -30,6 +30,7 @@ #include "types.h" #include "certificates.h" #include "key.h" +#include "asset.h" namespace dcp { @@ -45,8 +46,10 @@ class MXFMetadata; class Signer; class KDM; -/** @brief A CPL within a DCP */ -class CPL +/** @class CPL + * @brief A Composition Playlist. + */ +class CPL : public Asset { public: CPL (boost::filesystem::path directory, std::string name, ContentKind content_kind, int length, int frames_per_second); @@ -88,10 +91,6 @@ public: void set_mxf_keys (Key); - std::string id () const { - return _id; - } - bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const; void write_xml (bool, XMLMetadata const &, boost::shared_ptr<const Signer>) const; @@ -115,8 +114,6 @@ private: /** reels */ std::list<boost::shared_ptr<Reel> > _reels; - /** our UUID */ - std::string _id; /** a SHA1 digest of our XML */ mutable std::string _digest; }; diff --git a/src/object.cc b/src/object.cc new file mode 100644 index 00000000..e9a4f62b --- /dev/null +++ b/src/object.cc @@ -0,0 +1,36 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "object.h" +#include "util.h" + +using std::string; +using namespace dcp; + +Object::Object () + : _id (make_uuid ()) +{ + +} + +Object::Object (string id) + : _id (id) +{ + +} diff --git a/src/object.h b/src/object.h new file mode 100644 index 00000000..f2ef4c13 --- /dev/null +++ b/src/object.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <string> + +namespace dcp { + +/** Some part of a DCP that has a UUID */ +class Object +{ +public: + Object (); + Object (std::string id); + + std::string id () const { + return _id; + } + +protected: + std::string _id; +}; + +} diff --git a/src/wscript b/src/wscript index 7cc5e5ea..db0cc628 100644 --- a/src/wscript +++ b/src/wscript @@ -13,6 +13,7 @@ def build(bld): obj.use = 'libkumu-libdcp libasdcp-libdcp' obj.source = """ argb_frame.cc + asset.cc certificates.cc colour_matrix.cc content_asset.cc @@ -29,6 +30,7 @@ def build(bld): mono_picture_asset_writer.cc mono_picture_frame.cc mxf_asset.cc + object.cc picture_asset.cc picture_asset_writer.cc rec709_linearised_gamma_lut.cc @@ -71,6 +73,7 @@ def build(bld): mono_picture_asset.h mono_picture_frame.h mxf_asset.h + object.h picture_asset.h picture_asset_writer.h rgb_xyz.h |
