Use an enum class for Marker.
[libdcp.git] / src / asset_reader.h
index eaf2721a31dd355861d74d5d88960b52b5ec9e2b..d1e0f10e8faacf9e35ed2952a7d9e08c6b2d5c05 100644 (file)
 
 #include "dcp_assert.h"
 #include "asset.h"
-#include "decryption_context.h"
+#include "crypto_context.h"
 #include <asdcp/AS_DCP.h>
 #include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
 
 namespace dcp {
 
-class DecryptionContext;
-
 template <class R, class F>
 class AssetReader : public boost::noncopyable
 {
 public:
-       explicit AssetReader (Asset const * asset, boost::optional<Key> key)
-               : _decryption_context (new DecryptionContext (key))
+       explicit AssetReader (Asset const * asset, boost::optional<Key> key, Standard standard)
+               : _crypto_context (new DecryptionContext (key, standard))
        {
                _reader = new R ();
                DCP_ASSERT (asset->file ());
@@ -66,14 +64,18 @@ public:
                delete _reader;
        }
 
-       boost::shared_ptr<const F> get_frame (int n) const
+       std::shared_ptr<const F> get_frame (int n) const
        {
-               return boost::shared_ptr<const F> (new F (_reader, n, _decryption_context));
+               return std::shared_ptr<const F> (new F (_reader, n, _crypto_context));
+       }
+
+       R* reader () const {
+               return _reader;
        }
 
 protected:
        R* _reader;
-       boost::shared_ptr<DecryptionContext> _decryption_context;
+       std::shared_ptr<DecryptionContext> _crypto_context;
 };
 
 }