Merge branch 'master' of ssh://git.carlh.net/home/carl/git/libdcp
[libdcp.git] / src / mxf.h
index 52d335eab3277bfb954c1a27e1ed3e1198a1f4ff..aef8b12d53f00dedee93157ccc6fc7bc94adafa0 100644 (file)
--- a/src/mxf.h
+++ b/src/mxf.h
@@ -37,6 +37,7 @@
 #include "asset.h"
 #include "key.h"
 #include "metadata.h"
+#include "dcp_assert.h"
 
 #include <boost/signals2.hpp>
 
@@ -61,7 +62,7 @@ class PictureAssetWriter;
 class MXF
 {
 public:
-       MXF ();
+       MXF (Standard standard);
        virtual ~MXF () {}
 
        /** @return true if the data is encrypted */
@@ -112,16 +113,22 @@ public:
                return _metadata;
        }
 
+       Standard standard () const {
+               DCP_ASSERT (_standard);
+               return *_standard;
+       }
+
 protected:
        template <class P, class Q>
-       friend void start (PictureAssetWriter* writer, boost::shared_ptr<P> state, Standard standard, Q* mxf, uint8_t* data, int size);
+       friend void start (PictureAssetWriter* writer, boost::shared_ptr<P> state, Q* mxf, uint8_t const * data, int size);
+
+       MXF ();
 
        std::string read_writer_info (ASDCP::WriterInfo const &);
        /** Fill in a ADSCP::WriteInfo struct.
         *  @param w struct to fill in.
-        *  @param standard INTEROP or SMPTE.
         */
-       void fill_writer_info (ASDCP::WriterInfo* w, std::string id, Standard standard) const;
+       void fill_writer_info (ASDCP::WriterInfo* w, std::string id) const;
 
        /** ID of the key used for encryption/decryption, if there is one */
        boost::optional<std::string> _key_id;
@@ -129,6 +136,7 @@ protected:
        boost::optional<Key> _key;
        std::string _context_id;
        MXFMetadata _metadata;
+       boost::optional<Standard> _standard;
 };
 
 }