+ explicit AssetReader (Asset const * asset, boost::optional<Key> key)
+ : _decryption_context (new DecryptionContext (key))
+ {
+ _reader = new R ();
+ DCP_ASSERT (asset->file ());
+ Kumu::Result_t const r = _reader->OpenRead (asset->file()->string().c_str());
+ if (ASDCP_FAILURE (r)) {
+ delete _reader;
+ boost::throw_exception (FileError ("could not open MXF file for reading", asset->file().get(), r));
+ }
+ }
+
+ ~AssetReader ()
+ {
+ delete _reader;
+ }
+
+ boost::shared_ptr<const F> get_frame (int n) const
+ {
+ return boost::shared_ptr<const F> (new F (_reader, n, _decryption_context));
+ }