2 Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
4 This file is part of libdcp.
6 libdcp is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 libdcp is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with libdcp. If not, see <http://www.gnu.org/licenses/>.
20 #include "stereo_picture_asset_reader.h"
21 #include "stereo_picture_asset.h"
22 #include "stereo_picture_frame.h"
23 #include "exceptions.h"
27 using boost::shared_ptr;
29 StereoPictureAssetReader::StereoPictureAssetReader (StereoPictureAsset const * asset)
32 _reader = new ASDCP::JP2K::MXFSReader ();
33 Kumu::Result_t const r = _reader->OpenRead (asset->file().string().c_str());
34 if (ASDCP_FAILURE (r)) {
36 boost::throw_exception (FileError ("could not open MXF file for reading", asset->file(), r));
40 StereoPictureAssetReader::~StereoPictureAssetReader ()
45 shared_ptr<const StereoPictureFrame>
46 StereoPictureAssetReader::get_frame (int n) const
48 return shared_ptr<const StereoPictureFrame> (new StereoPictureFrame (_reader, n, _decryption_context));