summaryrefslogtreecommitdiff
path: root/src/mono_picture_frame.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-01 23:53:06 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-01 23:53:06 +0100
commita68b877d96a9e9f366f27752e071bc0e895e9dc7 (patch)
tree11a32d1efd6abf182b03ce22f1f1fe84258bb7de /src/mono_picture_frame.cc
parentf9cba324c8160a70b108d9e5b60a4ccad6ee9be2 (diff)
Add Reader classes to permit much more efficient DCP reading.
Diffstat (limited to 'src/mono_picture_frame.cc')
-rw-r--r--src/mono_picture_frame.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc
index a422e7c4..e870ff0f 100644
--- a/src/mono_picture_frame.cc
+++ b/src/mono_picture_frame.cc
@@ -56,23 +56,17 @@ MonoPictureFrame::MonoPictureFrame (boost::filesystem::path path)
}
/** Make a picture frame from a 2D (monoscopic) asset.
- * @param path Path to the asset's MXF file.
+ * @param reader Reader for the asset's MXF file.
* @param n Frame within the asset, not taking EntryPoint into account.
* @param c Context for decryption, or 0.
*/
-MonoPictureFrame::MonoPictureFrame (boost::filesystem::path path, int n, ASDCP::AESDecContext* c)
+MonoPictureFrame::MonoPictureFrame (ASDCP::JP2K::MXFReader* reader, int n, ASDCP::AESDecContext* c)
{
- ASDCP::JP2K::MXFReader reader;
- Kumu::Result_t r = reader.OpenRead (path.string().c_str());
- if (ASDCP_FAILURE (r)) {
- boost::throw_exception (FileError ("could not open MXF file for reading", path, r));
- }
-
/* XXX: unfortunate guesswork on this buffer size */
_buffer = new ASDCP::JP2K::FrameBuffer (4 * Kumu::Megabyte);
- if (ASDCP_FAILURE (reader.ReadFrame (n, *_buffer, c))) {
- boost::throw_exception (DCPReadError (String::compose ("could not read video frame %1 of %2", n, path.string())));
+ if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c))) {
+ boost::throw_exception (DCPReadError (String::compose ("could not read video frame %1", n)));
}
}