ReelEncryptableAsset -> ReelMXF.
authorCarl Hetherington <cth@carlh.net>
Fri, 5 Jun 2015 17:49:22 +0000 (18:49 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 Jun 2015 17:49:22 +0000 (18:49 +0100)
src/decrypted_kdm.cc
src/reel_encryptable_asset.cc [deleted file]
src/reel_encryptable_asset.h [deleted file]
src/reel_mxf.cc [new file with mode: 0644]
src/reel_mxf.h [new file with mode: 0644]
src/reel_picture_asset.cc
src/reel_picture_asset.h
src/reel_sound_asset.cc
src/reel_sound_asset.h
src/wscript

index c72afc6d5fab44e3f959c32fe7758a2f83198968..9661281d3aeb882a4f98e2f4680580e820f1b412 100644 (file)
@@ -20,7 +20,7 @@
 #include "decrypted_kdm.h"
 #include "decrypted_kdm_key.h"
 #include "encrypted_kdm.h"
-#include "reel_encryptable_asset.h"
+#include "reel_mxf.h"
 #include "reel_asset.h"
 #include "util.h"
 #include "exceptions.h"
@@ -200,7 +200,7 @@ DecryptedKDM::DecryptedKDM (
 {
        /* Create DecryptedKDMKey objects for each encryptable asset */
        BOOST_FOREACH(shared_ptr<const ReelAsset> i, cpl->reel_assets ()) {
-               shared_ptr<const ReelEncryptableAsset> mxf = boost::dynamic_pointer_cast<const ReelEncryptableAsset> (i);
+               shared_ptr<const ReelMXF> mxf = boost::dynamic_pointer_cast<const ReelMXF> (i);
                shared_ptr<const ReelAsset> asset = boost::dynamic_pointer_cast<const ReelAsset> (i);
                if (asset && mxf) {
                        if (!mxf->key_id ()) {
diff --git a/src/reel_encryptable_asset.cc b/src/reel_encryptable_asset.cc
deleted file mode 100644 (file)
index 373dd85..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-    Copyright (C) 2012-2015 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 "reel_encryptable_asset.h"
-#include "mxf.h"
-#include "dcp_assert.h"
-#include <libcxml/cxml.h>
-#include <libxml++/libxml++.h>
-
-using std::string;
-using boost::shared_ptr;
-using boost::optional;
-using namespace dcp;
-
-ReelEncryptableAsset::ReelEncryptableAsset (optional<string> key_id)
-       : _key_id (key_id)
-{
-
-}
-
-ReelEncryptableAsset::ReelEncryptableAsset (shared_ptr<const cxml::Node> node)
-       : _key_id (node->optional_string_child ("KeyId"))
-{
-       if (_key_id && _key_id.get().length() > 9) {
-               _key_id = _key_id.get().substr (9);
-       }
-}
diff --git a/src/reel_encryptable_asset.h b/src/reel_encryptable_asset.h
deleted file mode 100644 (file)
index 60c8ecf..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-    Copyright (C) 2012-2015 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.
-
-*/
-
-/** @file  src/reel_encryptable_asset.h
- *  @brief ReelEncryptableAsset
- */
-
-#ifndef LIBDCP_REEL_ENCRYPTABLE_ASSET_H
-#define LIBDCP_REEL_ENCRYPTABLE_ASSET_H
-
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <string>
-
-namespace cxml {
-       class Node;
-}
-
-namespace dcp {
-
-/** @class ReelEncryptableAsset
- *  @brief Part of a Reel's description which refers to an asset which can be encrypted.
- */
-class ReelEncryptableAsset
-{
-public:
-       ReelEncryptableAsset () {}
-       ReelEncryptableAsset (boost::optional<std::string> key_id);
-       ReelEncryptableAsset (boost::shared_ptr<const cxml::Node>);
-
-       /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */
-       virtual std::string key_type () const = 0;
-       
-       /** @return true if a KeyId is specified for this asset, implying
-        *  that its content is encrypted.
-        */
-       bool encrypted () const {
-               return _key_id;
-       }
-
-       /** @return Key ID to describe the key that encrypts this asset's
-        *  content, if there is one.
-        */
-       boost::optional<std::string> key_id () const {
-               return _key_id;
-       }
-
-private:
-       boost::optional<std::string> _key_id; ///< The &lt;KeyId&gt; from the reel's entry for this asset, if there is one
-};
-
-}
-
-#endif
diff --git a/src/reel_mxf.cc b/src/reel_mxf.cc
new file mode 100644 (file)
index 0000000..f9e8890
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+    Copyright (C) 2012-2015 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 "reel_mxf.h"
+#include "mxf.h"
+#include "dcp_assert.h"
+#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
+
+using std::string;
+using boost::shared_ptr;
+using boost::optional;
+using namespace dcp;
+
+ReelMXF::ReelMXF (optional<string> key_id)
+       : _key_id (key_id)
+{
+
+}
+
+ReelMXF::ReelMXF (shared_ptr<const cxml::Node> node)
+       : _key_id (node->optional_string_child ("KeyId"))
+{
+       if (_key_id && _key_id.get().length() > 9) {
+               _key_id = _key_id.get().substr (9);
+       }
+}
diff --git a/src/reel_mxf.h b/src/reel_mxf.h
new file mode 100644 (file)
index 0000000..5e8aa84
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+    Copyright (C) 2012-2015 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.
+
+*/
+
+/** @file  src/reel_mxf.h
+ *  @brief ReelMXF
+ */
+
+#ifndef LIBDCP_REEL_ENCRYPTABLE_ASSET_H
+#define LIBDCP_REEL_ENCRYPTABLE_ASSET_H
+
+#include <boost/optional.hpp>
+#include <boost/shared_ptr.hpp>
+#include <string>
+
+namespace cxml {
+       class Node;
+}
+
+namespace dcp {
+
+/** @class ReelMXF
+ *  @brief Part of a Reel's description which refers to an asset which can be encrypted.
+ */
+class ReelMXF
+{
+public:
+       ReelMXF () {}
+       ReelMXF (boost::optional<std::string> key_id);
+       ReelMXF (boost::shared_ptr<const cxml::Node>);
+
+       /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */
+       virtual std::string key_type () const = 0;
+       
+       /** @return true if a KeyId is specified for this asset, implying
+        *  that its content is encrypted.
+        */
+       bool encrypted () const {
+               return _key_id;
+       }
+
+       /** @return Key ID to describe the key that encrypts this asset's
+        *  content, if there is one.
+        */
+       boost::optional<std::string> key_id () const {
+               return _key_id;
+       }
+
+private:
+       boost::optional<std::string> _key_id; ///< The &lt;KeyId&gt; from the reel's entry for this asset, if there is one
+};
+
+}
+
+#endif
index 86630e137fec8c62f2f66ac2f22362128f941256..7099d7d2f7dfa4be7c4f26c873a52d09ff56687d 100644 (file)
@@ -45,7 +45,7 @@ ReelPictureAsset::ReelPictureAsset ()
 
 ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureAsset> asset, int64_t entry_point)
        : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
-       , ReelEncryptableAsset (asset->key_id())
+       , ReelMXF (asset->key_id())
        , _frame_rate (asset->frame_rate ())
        , _screen_aspect_ratio (asset->screen_aspect_ratio ())
 {
@@ -54,7 +54,7 @@ ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureAsset> asset, int64_t entr
 
 ReelPictureAsset::ReelPictureAsset (shared_ptr<const cxml::Node> node)
        : ReelAsset (node)
-       , ReelEncryptableAsset (node)
+       , ReelMXF (node)
 {
        _frame_rate = Fraction (node->string_child ("FrameRate"));
        try {
index 2acbc282fc0fc59324ec48107ebaaa8974b63a3d..4feafeb07251f150dd69232ac3c78b9135e47a2b 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef LIBDCP_REEL_PICTURE_ASSET_H
 #define LIBDCP_REEL_PICTURE_ASSET_H
 
-#include "reel_encryptable_asset.h"
+#include "reel_mxf.h"
 #include "reel_asset.h"
 #include "picture_asset.h"
 
@@ -33,7 +33,7 @@ namespace dcp {
 /** @class ReelPictureAsset
  *  @brief Part of a Reel's description which refers to a picture asset.
  */
-class ReelPictureAsset : public ReelAsset, public ReelEncryptableAsset
+class ReelPictureAsset : public ReelAsset, public ReelMXF
 {
 public:
        ReelPictureAsset ();
index ce26a5029bf10d6dd27f15b8c28075ac8b8d2062..165453ced012a15a95bb5dcfaa20e0f61c19a00d 100644 (file)
@@ -32,14 +32,14 @@ using namespace dcp;
 
 ReelSoundAsset::ReelSoundAsset (shared_ptr<SoundAsset> asset, int64_t entry_point)
        : ReelAsset (asset, asset->edit_rate(), asset->intrinsic_duration(), entry_point)
-       , ReelEncryptableAsset (asset->key_id())
+       , ReelMXF (asset->key_id())
 {
 
 }
 
 ReelSoundAsset::ReelSoundAsset (shared_ptr<const cxml::Node> node)
        : ReelAsset (node)
-       , ReelEncryptableAsset (node)
+       , ReelMXF (node)
 {
        node->ignore_child ("Language");
        node->done ();
index 5cea32083b216c304f64a6fbb8e59da175a6e8f9..e7358bd0fbc583d05f3adea7f3f14f0a5fc81355 100644 (file)
@@ -21,7 +21,7 @@
  *  @brief ReelSoundAsset class.
  */
 
-#include "reel_encryptable_asset.h"
+#include "reel_mxf.h"
 #include "reel_asset.h"
 #include "sound_asset.h"
 #include <boost/shared_ptr.hpp>
@@ -32,7 +32,7 @@ namespace dcp {
 /** @class ReelSoundAsset
  *  @brief Part of a Reel's description which refers to a sound MXF.
  */
-class ReelSoundAsset : public ReelAsset, public ReelEncryptableAsset
+class ReelSoundAsset : public ReelAsset, public ReelMXF
 {
 public:
        ReelSoundAsset (boost::shared_ptr<dcp::SoundAsset> content, int64_t entry_point);
index 371f11c4119a20b94d7790f169112532d30ca303..f54aaa8f66ddb673479ed595127bfae776720ed4 100644 (file)
@@ -34,8 +34,8 @@ def build(bld):
              picture_asset_writer.cc
              reel.cc
              reel_asset.cc
-             reel_encryptable_asset.cc
              reel_mono_picture_asset.cc
+             reel_mxf.cc
              reel_picture_asset.cc
              reel_sound_asset.cc
              reel_stereo_picture_asset.cc
@@ -95,8 +95,8 @@ def build(bld):
               rgb_xyz.h
               reel.h
               reel_asset.h
-              reel_encryptable_asset.h
               reel_mono_picture_asset.h
+              reel_mxf.h
               reel_picture_asset.h
               reel_sound_asset.h
               reel_stereo_picture_asset.h