Allow progressive writes to be encrypted.
[libdcp.git] / src / asset.h
index 3bc713a38b4b29450bfae79e3111151b890cca0f..c6ff7e830f6971ab2793dd1f26dda28d04792f1b 100644 (file)
@@ -35,6 +35,10 @@ namespace ASDCP {
        class WriterInfo;
 }
 
+namespace xmlpp {
+       class Element;
+}
+
 namespace libdcp
 {
 
@@ -53,13 +57,14 @@ public:
 
        virtual ~Asset() {}
 
-       /** Write details of the asset to a CPL stream.
-        *  @param s Stream.
+       /** Write details of the asset to a CPL AssetList node.
+        *  @param p Parent element.
+        *  @param i true to use the Interop standard, false for SMPTE.
         */
-       virtual void write_to_cpl (xmlpp::Node *) const = 0;
+       virtual void write_to_cpl (xmlpp::Element* p, bool i) const = 0;
 
-       /** Write details of the asset to a PKL stream.
-        *  @param s Stream.
+       /** Write details of the asset to a PKL AssetList node.
+        *  @param p Parent node.
         */
        void write_to_pkl (xmlpp::Node *) const;
 
@@ -68,6 +73,14 @@ public:
         */
        void write_to_assetmap (xmlpp::Node *) const;
 
+       /** Compute the digest for this asset.  Calling this is optional: if
+        *  it is not called, the digest will be computed when required.  However,
+        *  calling this method allows the caller to see the progress of the
+        *  computation, which can be long for large assets.
+        *  @param Called with progress between 0 and 1.
+        */
+       void compute_digest (boost::function<void (float)> progress);
+
        std::string uuid () const {
                return _uuid;
        }