X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fmono_picture_frame.cc;h=6cdcf935fea7837a7d8c88151703a041e818185c;hb=db536bd9f9f16b79286c5f0bb54d0f283050f7dd;hp=a422e7c4053043482c76aa5634dfdcd31c086d82;hpb=f9cba324c8160a70b108d9e5b60a4ccad6ee9be2;p=libdcp.git diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc index a422e7c4..6cdcf935 100644 --- a/src/mono_picture_frame.cc +++ b/src/mono_picture_frame.cc @@ -16,6 +16,19 @@ You should have received a copy of the GNU General Public License along with libdcp. If not, see . + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. */ /** @file src/mono_picture_frame.cc @@ -56,23 +69,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))); } }