summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-17 17:42:51 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-17 17:42:51 +0000
commit44791cafb91bfe1ee5c0a530c83d9f44b4d2f88f (patch)
treecd52e56f325b204035cd53639581228a6be38399 /src
parent77726c718ccce4af4bc82c3695a13cea859df874 (diff)
Asset -> ContentAsset.
Diffstat (limited to 'src')
-rw-r--r--src/content_asset.cc (renamed from src/asset.cc)20
-rw-r--r--src/content_asset.h (renamed from src/asset.h)19
-rw-r--r--src/cpl.cc4
-rw-r--r--src/cpl.h4
-rw-r--r--src/dcp.cc17
-rw-r--r--src/dcp.h4
-rw-r--r--src/kdm.cc6
-rw-r--r--src/mono_picture_asset.cc2
-rw-r--r--src/mono_picture_asset.h2
-rw-r--r--src/mxf_asset.cc6
-rw-r--r--src/mxf_asset.h6
-rw-r--r--src/sound_asset.cc2
-rw-r--r--src/sound_asset.h2
-rw-r--r--src/stereo_picture_asset.cc2
-rw-r--r--src/stereo_picture_asset.h2
-rw-r--r--src/subtitle_asset.cc4
-rw-r--r--src/subtitle_asset.h6
-rw-r--r--src/wscript2
18 files changed, 49 insertions, 61 deletions
diff --git a/src/asset.cc b/src/content_asset.cc
index 192daf43..56891007 100644
--- a/src/asset.cc
+++ b/src/content_asset.cc
@@ -17,10 +17,6 @@
*/
-/** @file src/asset.cc
- * @brief Parent class for assets of DCPs.
- */
-
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
@@ -28,7 +24,7 @@
#include <libxml++/nodes/element.h>
#include "AS_DCP.h"
#include "KM_util.h"
-#include "asset.h"
+#include "content_asset.h"
#include "util.h"
#include "metadata.h"
@@ -36,7 +32,7 @@ using namespace std;
using namespace boost;
using namespace dcp;
-Asset::Asset (boost::filesystem::path directory, boost::filesystem::path file_name)
+ContentAsset::ContentAsset (boost::filesystem::path directory, boost::filesystem::path file_name)
: _directory (directory)
, _file_name (file_name)
, _uuid (make_uuid ())
@@ -51,7 +47,7 @@ Asset::Asset (boost::filesystem::path directory, boost::filesystem::path file_na
}
void
-Asset::write_to_pkl (xmlpp::Node* node) const
+ContentAsset::write_to_pkl (xmlpp::Node* node) const
{
xmlpp::Node* asset = node->add_child ("Asset");
asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid);
@@ -62,7 +58,7 @@ Asset::write_to_pkl (xmlpp::Node* node) const
}
void
-Asset::write_to_assetmap (xmlpp::Node* node) const
+ContentAsset::write_to_assetmap (xmlpp::Node* node) const
{
xmlpp::Node* asset = node->add_child ("Asset");
asset->add_child("Id")->add_child_text ("urn:uuid:" + _uuid);
@@ -75,7 +71,7 @@ Asset::write_to_assetmap (xmlpp::Node* node) const
}
filesystem::path
-Asset::path () const
+ContentAsset::path () const
{
filesystem::path p;
p /= _directory;
@@ -84,7 +80,7 @@ Asset::path () const
}
string
-Asset::digest () const
+ContentAsset::digest () const
{
if (_digest.empty ()) {
_digest = make_digest (path().string(), 0);
@@ -94,7 +90,7 @@ Asset::digest () const
}
void
-Asset::compute_digest (boost::function<void (float)> progress)
+ContentAsset::compute_digest (boost::function<void (float)> progress)
{
if (!_digest.empty ()) {
return;
@@ -104,7 +100,7 @@ Asset::compute_digest (boost::function<void (float)> progress)
}
bool
-Asset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::function<void (NoteType, string)> note) const
+ContentAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions, boost::function<void (NoteType, string)> note) const
{
if (_edit_rate != other->_edit_rate) {
note (ERROR, "asset edit rates differ");
diff --git a/src/asset.h b/src/content_asset.h
index d1819ba6..4e7ed031 100644
--- a/src/asset.h
+++ b/src/content_asset.h
@@ -17,10 +17,6 @@
*/
-/** @file src/asset.h
- * @brief Parent class for assets of DCPs.
- */
-
#ifndef LIBDCP_ASSET_H
#define LIBDCP_ASSET_H
@@ -42,20 +38,17 @@ namespace xmlpp {
namespace dcp
{
-/** @brief Parent class for assets of DCPs
- *
- * These are collections of pictures or sound.
- */
-class Asset
+/** XXX */
+class ContentAsset
{
public:
- /** Construct an Asset.
+ /** Construct a ContentAsset.
* @param directory Directory where our XML or MXF file is.
* @param file_name Name of our file within directory, or empty to make one up based on UUID.
*/
- Asset (boost::filesystem::path directory, boost::filesystem::path file_name = "");
+ ContentAsset (boost::filesystem::path directory, boost::filesystem::path file_name = "");
- virtual ~Asset() {}
+ virtual ~ContentAsset() {}
/** Write details of the asset to a CPL AssetList node.
* @param p Parent element.
@@ -126,7 +119,7 @@ public:
_edit_rate = r;
}
- virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)>) const;
+ virtual bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)>) const;
protected:
diff --git a/src/cpl.cc b/src/cpl.cc
index 2058223c..ec5534e0 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -252,10 +252,10 @@ CPL::write_to_pkl (xmlpp::Node* node) const
asset->add_child("Type")->add_child_text ("text/xml");
}
-list<shared_ptr<const Asset> >
+list<shared_ptr<const ContentAsset> >
CPL::assets () const
{
- list<shared_ptr<const Asset> > a;
+ list<shared_ptr<const ContentAsset> > a;
for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
if ((*i)->main_picture ()) {
a.push_back ((*i)->main_picture ());
diff --git a/src/cpl.h b/src/cpl.h
index 45480ec7..ead09f24 100644
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -38,7 +38,7 @@ namespace parse {
class AssetMapAsset;
}
-class Asset;
+class ContentAsset;
class Reel;
class XMLMetadata;
class MXFMetadata;
@@ -82,7 +82,7 @@ public:
return _fps;
}
- std::list<boost::shared_ptr<const Asset> > assets () const;
+ std::list<boost::shared_ptr<const ContentAsset> > assets () const;
bool encrypted () const;
diff --git a/src/dcp.cc b/src/dcp.cc
index 653dc87a..e0730020 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -33,7 +33,6 @@
#include <xmlsec/xmldsig.h>
#include <xmlsec/app.h>
#include "dcp.h"
-#include "asset.h"
#include "sound_asset.h"
#include "picture_asset.h"
#include "subtitle_asset.h"
@@ -109,8 +108,8 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
pkl->add_child("Creator")->add_child_text (metadata.creator);
xmlpp::Element* asset_list = pkl->add_child("AssetList");
- list<shared_ptr<const Asset> > a = assets ();
- for (list<shared_ptr<const Asset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
+ list<shared_ptr<const ContentAsset> > a = assets ();
+ for (list<shared_ptr<const ContentAsset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
(*i)->write_to_pkl (asset_list);
}
@@ -192,8 +191,8 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata
(*i)->write_to_assetmap (asset_list);
}
- list<shared_ptr<const Asset> > a = assets ();
- for (list<shared_ptr<const Asset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
+ list<shared_ptr<const ContentAsset> > a = assets ();
+ for (list<shared_ptr<const ContentAsset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
(*i)->write_to_assetmap (asset_list);
}
@@ -322,17 +321,17 @@ DCP::add_cpl (shared_ptr<CPL> cpl)
class AssetComparator
{
public:
- bool operator() (shared_ptr<const Asset> a, shared_ptr<const Asset> b) {
+ bool operator() (shared_ptr<const ContentAsset> a, shared_ptr<const ContentAsset> b) {
return a->uuid() < b->uuid();
}
};
-list<shared_ptr<const Asset> >
+list<shared_ptr<const ContentAsset> >
DCP::assets () const
{
- list<shared_ptr<const Asset> > a;
+ list<shared_ptr<const ContentAsset> > a;
for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
- list<shared_ptr<const Asset> > t = (*i)->assets ();
+ list<shared_ptr<const ContentAsset> > t = (*i)->assets ();
a.merge (t);
}
diff --git a/src/dcp.h b/src/dcp.h
index 9b72ae74..d6edafa0 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -40,7 +40,7 @@ namespace xmlpp {
namespace dcp
{
-class Asset;
+class ContentAsset;
class PictureAsset;
class SoundAsset;
class SubtitleAsset;
@@ -138,7 +138,7 @@ private:
void write_assetmap (std::string pkl_uuid, int pkl_length, bool, XMLMetadata const &) const;
/** @return Assets in all the CPLs in this DCP */
- std::list<boost::shared_ptr<const Asset> > assets () const;
+ std::list<boost::shared_ptr<const ContentAsset> > assets () const;
struct Files {
std::list<std::string> cpls;
diff --git a/src/kdm.cc b/src/kdm.cc
index 02e6ce7f..25e87ca1 100644
--- a/src/kdm.cc
+++ b/src/kdm.cc
@@ -124,8 +124,8 @@ KDM::KDM (
*/
apu.authorized_device_info.device_list.push_back ("2jmj7l5rSw0yVb/vlWAYkK/YBwk=");
- list<shared_ptr<const Asset> > assets = cpl->assets ();
- for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+ list<shared_ptr<const ContentAsset> > assets = cpl->assets ();
+ for (list<shared_ptr<const ContentAsset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
/* XXX: non-MXF assets? */
shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
if (mxf) {
@@ -138,7 +138,7 @@ KDM::KDM (
/* AuthenticatedPrivate */
- for (list<shared_ptr<const Asset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
+ for (list<shared_ptr<const ContentAsset> >::iterator i = assets.begin(); i != assets.end(); ++i) {
/* XXX: non-MXF assets? */
shared_ptr<const MXFAsset> mxf = boost::dynamic_pointer_cast<const MXFAsset> (*i);
if (mxf) {
diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc
index 3163e89a..766b72ca 100644
--- a/src/mono_picture_asset.cc
+++ b/src/mono_picture_asset.cc
@@ -125,7 +125,7 @@ MonoPictureAsset::get_frame (int n) const
}
bool
-MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MonoPictureAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
if (!MXFAsset::equals (other, opt, note)) {
return false;
diff --git a/src/mono_picture_asset.h b/src/mono_picture_asset.h
index 19308aaf..00017354 100644
--- a/src/mono_picture_asset.h
+++ b/src/mono_picture_asset.h
@@ -50,7 +50,7 @@ public:
boost::shared_ptr<PictureAssetWriter> start_write (bool);
boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
- bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+ bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
private:
boost::filesystem::path path_from_list (int f, std::vector<boost::filesystem::path> const & files) const;
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc
index 1b15f7a9..c2d19a39 100644
--- a/src/mxf_asset.cc
+++ b/src/mxf_asset.cc
@@ -43,7 +43,7 @@ using boost::dynamic_pointer_cast;
using namespace dcp;
MXFAsset::MXFAsset (boost::filesystem::path directory, boost::filesystem::path file_name)
- : Asset (directory, file_name)
+ : ContentAsset (directory, file_name)
, _progress (0)
, _encryption_context (0)
, _decryption_context (0)
@@ -85,9 +85,9 @@ MXFAsset::fill_writer_info (ASDCP::WriterInfo* writer_info)
}
bool
-MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MXFAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
- if (!Asset::equals (other, opt, note)) {
+ if (!ContentAsset::equals (other, opt, note)) {
return false;
}
diff --git a/src/mxf_asset.h b/src/mxf_asset.h
index 5ba70324..4af7a38d 100644
--- a/src/mxf_asset.h
+++ b/src/mxf_asset.h
@@ -21,7 +21,7 @@
#define LIBDCP_MXF_ASSET_H
#include <boost/signals2.hpp>
-#include "asset.h"
+#include "content_asset.h"
#include "key.h"
#include "metadata.h"
@@ -36,7 +36,7 @@ namespace dcp
class MXFMetadata;
/** @brief Parent class for assets which have MXF files */
-class MXFAsset : public Asset
+class MXFAsset : public ContentAsset
{
public:
/** Construct an MXFAsset.
@@ -49,7 +49,7 @@ public:
~MXFAsset ();
- virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+ virtual bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
virtual void write_to_cpl (xmlpp::Element *) const;
virtual std::string key_type () const = 0;
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index cc537d56..602f036c 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -210,7 +210,7 @@ SoundAsset::cpl_node_name () const
}
bool
-SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+SoundAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
if (!MXFAsset::equals (other, opt, note)) {
return false;
diff --git a/src/sound_asset.h b/src/sound_asset.h
index f33e5aec..d2aa1213 100644
--- a/src/sound_asset.h
+++ b/src/sound_asset.h
@@ -92,7 +92,7 @@ public:
boost::shared_ptr<SoundAssetWriter> start_write ();
- bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+ bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
boost::shared_ptr<const SoundFrame> get_frame (int n) const;
diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc
index bad80832..711a8090 100644
--- a/src/stereo_picture_asset.cc
+++ b/src/stereo_picture_asset.cc
@@ -31,7 +31,7 @@ using boost::dynamic_pointer_cast;
using namespace dcp;
bool
-StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+StereoPictureAsset::equals (shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
if (!MXFAsset::equals (other, opt, note)) {
return false;
diff --git a/src/stereo_picture_asset.h b/src/stereo_picture_asset.h
index 6ebc7239..a6620dcf 100644
--- a/src/stereo_picture_asset.h
+++ b/src/stereo_picture_asset.h
@@ -36,7 +36,7 @@ public:
boost::shared_ptr<PictureAssetWriter> start_write (bool);
boost::shared_ptr<const StereoPictureFrame> get_frame (int n) const;
- bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+ bool equals (boost::shared_ptr<const ContentAsset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
private:
std::string cpl_node_name () const;
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index d67e3625..fcc8bac0 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -37,14 +37,14 @@ using boost::optional;
using namespace dcp;
SubtitleAsset::SubtitleAsset (string directory, string xml_file)
- : Asset (directory, xml_file)
+ : ContentAsset (directory, xml_file)
, _need_sort (false)
{
read_xml (path().string());
}
SubtitleAsset::SubtitleAsset (string directory, string movie_title, string language)
- : Asset (directory)
+ : ContentAsset (directory)
, _movie_title (movie_title)
, _reel_number ("1")
, _language (language)
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index e5e2e853..cff65b2b 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -21,7 +21,7 @@
#define LIBDCP_SUBTITLE_ASSET_H
#include <libcxml/cxml.h>
-#include "asset.h"
+#include "content_asset.h"
#include "dcp_time.h"
namespace dcp
@@ -133,14 +133,14 @@ private:
bool operator== (Subtitle const & a, Subtitle const & b);
std::ostream& operator<< (std::ostream& s, Subtitle const & sub);
-class SubtitleAsset : public Asset
+class SubtitleAsset : public ContentAsset
{
public:
SubtitleAsset (std::string directory, std::string xml_file);
SubtitleAsset (std::string directory, std::string movie_title, std::string language);
void write_to_cpl (xmlpp::Element *) const;
- virtual bool equals (boost::shared_ptr<const Asset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
+ virtual bool equals (boost::shared_ptr<const ContentAsset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
/* XXX */
note (ERROR, "subtitle assets not compared yet");
return true;
diff --git a/src/wscript b/src/wscript
index cdf3c062..7cc5e5ea 100644
--- a/src/wscript
+++ b/src/wscript
@@ -13,9 +13,9 @@ def build(bld):
obj.use = 'libkumu-libdcp libasdcp-libdcp'
obj.source = """
argb_frame.cc
- asset.cc
certificates.cc
colour_matrix.cc
+ content_asset.cc
cpl.cc
dcp.cc
dcp_time.cc