s/DCPReadError/ReadError/g
authorCarl Hetherington <cth@carlh.net>
Tue, 14 Apr 2020 18:16:44 +0000 (20:16 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 14 Apr 2020 18:16:44 +0000 (20:16 +0200)
25 files changed:
src/asset_factory.cc
src/atmos_asset.cc
src/dcp.cc
src/dcp.h
src/dcp_time.cc
src/exceptions.cc
src/exceptions.h
src/frame.h
src/j2k.cc
src/mono_picture_asset.cc
src/mono_picture_frame.cc
src/mxf.cc
src/smpte_subtitle_asset.cc
src/sound_asset.cc
src/stereo_picture_asset.cc
src/stereo_picture_frame.cc
src/types.cc
src/verify.cc
test/dcp_time_test.cc
test/effect_test.cc
test/rewrite_subs.cc
test/sound_frame_test.cc
tools/dcpdecryptmxf.cc
tools/dcpinfo.cc
tools/dcprecover.cc

index 22c2518e06716e4b1b9eada68e75896edc14b78d..09c315d5f66a6076c7ed69d60ee91b1b3f7b3b3e 100644 (file)
@@ -53,12 +53,12 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_
 
        ASDCP::EssenceType_t type;
        if (ASDCP::EssenceType (path.string().c_str(), type) != ASDCP::RESULT_OK) {
-               throw DCPReadError ("Could not find essence type");
+               throw ReadError ("Could not find essence type");
        }
        switch (type) {
        case ASDCP::ESS_UNKNOWN:
        case ASDCP::ESS_MPEG2_VES:
-               throw DCPReadError ("MPEG2 video essences are not supported");
+               throw ReadError ("MPEG2 video essences are not supported");
        case ASDCP::ESS_JPEG_2000:
                try {
                        return shared_ptr<MonoPictureAsset> (new MonoPictureAsset (path));
@@ -80,7 +80,7 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_
        case ASDCP::ESS_DCDATA_DOLBY_ATMOS:
                return shared_ptr<AtmosAsset> (new AtmosAsset (path));
        default:
-               throw DCPReadError (String::compose ("Unknown MXF essence type %1 in %2", int(type), path.string()));
+               throw ReadError (String::compose ("Unknown MXF essence type %1 in %2", int(type), path.string()));
        }
 
        return shared_ptr<Asset>();
index 171c8e8bcd701de9df7f21700c76d0619006106b..3924e43a2e83822528c0288f4a53a97395f8377d 100644 (file)
@@ -66,7 +66,7 @@ AtmosAsset::AtmosAsset (boost::filesystem::path file)
 
        ASDCP::ATMOS::AtmosDescriptor desc;
        if (ASDCP_FAILURE (reader.FillAtmosDescriptor (desc))) {
-               boost::throw_exception (DCPReadError ("could not read Atmos MXF information"));
+               boost::throw_exception (ReadError ("could not read Atmos MXF information"));
        }
 
        _edit_rate = Fraction (desc.EditRate.Numerator, desc.EditRate.Denominator);
index da12e4d9742f55b65f40ef50dd8b1ba9d94f8281..2fcdd193c13bb6dc5ee90e5f99bf64a38e4ff683 100644 (file)
@@ -117,7 +117,7 @@ DCP::read (list<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf
        } else if (boost::filesystem::exists (_directory / "ASSETMAP.xml")) {
                _asset_map = _directory / "ASSETMAP.xml";
        } else {
-               boost::throw_exception (DCPReadError (String::compose ("could not find ASSETMAP nor ASSETMAP.xml in `%1'", _directory.string())));
+               boost::throw_exception (ReadError (String::compose ("could not find ASSETMAP nor ASSETMAP.xml in `%1'", _directory.string())));
        }
 
        cxml::Document asset_map ("AssetMap");
@@ -221,7 +221,7 @@ DCP::read (list<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf
                                p->parse_file (path.string());
                        } catch (std::exception& e) {
                                delete p;
-                               throw DCPReadError(String::compose("XML error in %1", path.string()), e.what());
+                               throw ReadError(String::compose("XML error in %1", path.string()), e.what());
                        }
 
                        string const root = p->get_document()->get_root_node()->get_name ();
@@ -252,7 +252,7 @@ DCP::read (list<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf
                } else if (*pkl_type == "image/png") {
                        /* It's an Interop PNG subtitle; let it go */
                } else {
-                       throw DCPReadError (String::compose("Unknown asset type %1 in PKL", *pkl_type));
+                       throw ReadError (String::compose("Unknown asset type %1 in PKL", *pkl_type));
                }
        }
 
index 0ac93f49e627f0ce5bcc281793b494b25305c087..d6648783e89a9172a675c2458f0aa392c1ce0f18 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -66,7 +66,7 @@ class XMLMetadata;
 class CertificateChain;
 class DecryptedKDM;
 class Asset;
-class DCPReadError;
+class ReadError;
 
 /** @class DCP
  *  @brief A class to create or read a DCP.
index acc9723f99045a242822e1d94cde67c2c6d36334..025a48590ed51aafcc4ff02c8670e0997a3e4724 100644 (file)
@@ -108,7 +108,7 @@ Time::Time (string time, optional<int> tcr_)
        split (b, time, is_any_of (":"));
 
        if (b.size() < 3 || b[0].empty() || b[1].empty() || b[0].length() > 2 || b[1].length() > 2) {
-               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1", time)));
+               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
        }
 
        if (!tcr_) {
@@ -118,17 +118,17 @@ Time::Time (string time, optional<int> tcr_)
                        vector<string> bs;
                        split (bs, b[2], is_any_of ("."));
                        if (bs.size() != 2) {
-                               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1", time)));
+                               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
                        }
 
                        h = raw_convert<int> (b[0]);
                        m = raw_convert<int> (b[1]);
                        if (bs[0].empty() || bs[0].length() > 2) {
-                               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[0])));
+                               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[0])));
                        }
                        s = raw_convert<int> (bs[0]);
                        if (bs[1].empty() || bs[1].length() > 3) {
-                               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[1])));
+                               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[1])));
                        }
                        e = raw_convert<int> (bs[1]);
                        tcr = 1000;
@@ -137,33 +137,33 @@ Time::Time (string time, optional<int> tcr_)
                        h = raw_convert<int> (b[0]);
                        m = raw_convert<int> (b[1]);
                        if (b[2].empty() || b[2].length() > 2) {
-                               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
+                               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
                        }
                        s = raw_convert<int> (b[2]);
                        if (b[3].empty() || b[3].length() > 3) {
-                               boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
+                               boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
                        }
                        e = raw_convert<int> (b[3]);
                        tcr = 250;
                } else {
-                       boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1", time)));
+                       boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
                }
 
        } else {
                /* SMPTE: HH:MM:SS:EE */
                split (b, time, is_any_of (":"));
                if (b.size() != 4) {
-                       boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; does not have 4 parts", time)));
+                       boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; does not have 4 parts", time)));
                }
 
                h = raw_convert<int> (b[0]);
                m = raw_convert<int> (b[1]);
                if (b[2].empty() || b[2].length() > 2) {
-                       boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
+                       boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
                }
                s = raw_convert<int> (b[2]);
                if (b[3].empty() || b[3].length() > 2) {
-                       boost::throw_exception (DCPReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
+                       boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
                }
                e = raw_convert<int> (b[3]);
                tcr = tcr_.get();
index 7f389f312ee4d5e93420e94d5532498d63271a08..3357ebe96258f6bc05ca6c0f36cd35f5bcbf94c2 100644 (file)
@@ -64,7 +64,7 @@ TimeFormatError::TimeFormatError (string bad_time)
 }
 
 BadContentKindError::BadContentKindError (string content_kind)
-       : DCPReadError (String::compose("Bad content kind '%1'", content_kind))
+       : ReadError (String::compose("Bad content kind '%1'", content_kind))
 {
 
 }
@@ -100,7 +100,7 @@ CertificateChainError::CertificateChainError (string message)
 
 }
 
-DCPReadError::DCPReadError (string message, string detail)
+ReadError::ReadError (string message, string detail)
        : runtime_error(String::compose("%1 (%2)", message, detail))
        , _message(message)
        , _detail(detail)
index 770bd916105998e3cf708ec34350ce59edf41da7..cd4f5fbbd504a128b837b35868fe1e1881478ea8 100644 (file)
@@ -91,20 +91,21 @@ public:
        {}
 };
 
-/** @class DCPReadError
- *  @brief A DCP read exception
+
+/** @class ReadError
+ *  @brief Any error that occurs when reading data from a DCP.
  */
-class DCPReadError : public std::runtime_error
+class ReadError : public std::runtime_error
 {
 public:
-       explicit DCPReadError (std::string message)
+       explicit ReadError (std::string message)
                : std::runtime_error(message)
                , _message(message)
        {}
 
-       DCPReadError (std::string message, std::string detail);
+       ReadError (std::string message, std::string detail);
 
-       ~DCPReadError() throw () {}
+       ~ReadError() throw () {}
 
        std::string message () const {
                return _message;
@@ -119,7 +120,8 @@ private:
        boost::optional<std::string> _detail;
 };
 
-class BadContentKindError : public DCPReadError
+
+class BadContentKindError : public ReadError
 {
 public:
        BadContentKindError (std::string content_kind);
index 7b5e63662d26c666c0f5230aa22775e4c521deff..6bd321044c9ae08844597589b76f7a13b8a6f8b3 100644 (file)
@@ -52,7 +52,7 @@ public:
                _buffer = new B (Kumu::Megabyte);
 
                if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), c->hmac()))) {
-                       boost::throw_exception (DCPReadError ("could not read frame"));
+                       boost::throw_exception (ReadError ("could not read frame"));
                }
        }
 
index a81da68c7609f7adff4453277be7af88b7d9dc7d..4aca621eee51c442f9491f538a9a11e556c1e8cc 100644 (file)
@@ -128,7 +128,7 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
 
        opj_codec_t* decoder = opj_create_decompress (format);
        if (!decoder) {
-               boost::throw_exception (DCPReadError ("could not create JPEG2000 decompresser"));
+               boost::throw_exception (ReadError ("could not create JPEG2000 decompresser"));
        }
        opj_dparameters_t parameters;
        opj_set_default_decoder_parameters (&parameters);
@@ -153,9 +153,9 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
                opj_destroy_codec (decoder);
                opj_stream_destroy (stream);
                if (format == OPJ_CODEC_J2K) {
-                       boost::throw_exception (DCPReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
+                       boost::throw_exception (ReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
                } else {
-                       boost::throw_exception (DCPReadError (String::compose ("could not decode JP2 file of %1 bytes.", size)));
+                       boost::throw_exception (ReadError (String::compose ("could not decode JP2 file of %1 bytes.", size)));
                }
        }
 
@@ -191,7 +191,7 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
        if (!image) {
                opj_destroy_decompress (decoder);
                opj_cio_close (cio);
-               boost::throw_exception (DCPReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
+               boost::throw_exception (ReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
        }
 
        opj_destroy_decompress (decoder);
index de49b1b9c6a69ea890e2026108026b0faee557c4..47fc8f5588d72e26b2b191c0963191f8d34d7dbb 100644 (file)
@@ -60,14 +60,14 @@ MonoPictureAsset::MonoPictureAsset (boost::filesystem::path file)
 
        ASDCP::JP2K::PictureDescriptor desc;
        if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        read_picture_descriptor (desc);
 
        ASDCP::WriterInfo info;
        if (ASDCP_FAILURE (reader.FillWriterInfo (info))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        _id = read_writer_info (info);
@@ -108,11 +108,11 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
 
        ASDCP::JP2K::PictureDescriptor desc_A;
        if (ASDCP_FAILURE (reader_A.FillPictureDescriptor (desc_A))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
        ASDCP::JP2K::PictureDescriptor desc_B;
        if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        if (!descriptor_equals (desc_A, desc_B, note)) {
index 9af34c486fda5ffe0d41dd0adef825ebde2c68a6..d9a89fe12ddad8c77d9f2b6c5901999cf98c11d2 100644 (file)
@@ -86,7 +86,7 @@ MonoPictureFrame::MonoPictureFrame (ASDCP::JP2K::MXFReader* reader, int n, share
        ASDCP::Result_t const r = reader->ReadFrame (n, *_buffer, c->context(), c->hmac());
 
        if (ASDCP_FAILURE (r)) {
-               boost::throw_exception (DCPReadError (String::compose ("could not read video frame %1 (%2)", n, static_cast<int>(r))));
+               boost::throw_exception (ReadError (String::compose ("could not read video frame %1 (%2)", n, static_cast<int>(r))));
        }
 }
 
index 6c0b3edb82fc552efe365db1e43b652e562c8519..1b4668a8965f0930df543397af3ef61c3427b244 100644 (file)
@@ -135,7 +135,7 @@ MXF::read_writer_info (ASDCP::WriterInfo const & info)
                _standard = SMPTE;
                break;
        default:
-               throw DCPReadError ("Unrecognised label set type in MXF");
+               throw ReadError ("Unrecognised label set type in MXF");
        }
 
        _metadata.read (info);
index 7e71575582e97aec18ab8a237e160d73506da588..33a0c943536d5d79b7928bdeeb3033a15579984e 100644 (file)
@@ -109,7 +109,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
                        _id = _xml_id = remove_urn_uuid (xml->string_child ("Id"));
                } catch (cxml::Error& e) {
                        boost::throw_exception (
-                               DCPReadError (
+                               ReadError (
                                        String::compose (
                                                "Failed to read subtitle file %1; MXF failed with %2, XML failed with %3",
                                                file, static_cast<int> (r), e.what ()
@@ -272,7 +272,7 @@ SMPTESubtitleAsset::set_key (Key key)
        Kumu::Result_t r = reader->OpenRead (_file->string().c_str ());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (
-                       DCPReadError (
+                       ReadError (
                                String::compose ("Could not read encrypted subtitle MXF (%1)", static_cast<int> (r))
                                )
                        );
index 1f1c2f4314b7589fdd551c812805dfb4961ddaec..c28a33feb07d2a58d5ce12a3e4203b27ee7e5e01 100644 (file)
@@ -67,7 +67,7 @@ SoundAsset::SoundAsset (boost::filesystem::path file)
 
        ASDCP::PCM::AudioDescriptor desc;
        if (ASDCP_FAILURE (reader.FillAudioDescriptor (desc))) {
-               boost::throw_exception (DCPReadError ("could not read audio MXF information"));
+               boost::throw_exception (ReadError ("could not read audio MXF information"));
        }
 
        _sampling_rate = desc.AudioSamplingRate.Numerator / desc.AudioSamplingRate.Denominator;
@@ -78,7 +78,7 @@ SoundAsset::SoundAsset (boost::filesystem::path file)
 
        ASDCP::WriterInfo info;
        if (ASDCP_FAILURE (reader.FillWriterInfo (info))) {
-               boost::throw_exception (DCPReadError ("could not read audio MXF information"));
+               boost::throw_exception (ReadError ("could not read audio MXF information"));
        }
 
        _id = read_writer_info (info);
@@ -112,11 +112,11 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
 
        ASDCP::PCM::AudioDescriptor desc_A;
        if (ASDCP_FAILURE (reader_A.FillAudioDescriptor (desc_A))) {
-               boost::throw_exception (DCPReadError ("could not read audio MXF information"));
+               boost::throw_exception (ReadError ("could not read audio MXF information"));
        }
        ASDCP::PCM::AudioDescriptor desc_B;
        if (ASDCP_FAILURE (reader_B.FillAudioDescriptor (desc_B))) {
-               boost::throw_exception (DCPReadError ("could not read audio MXF information"));
+               boost::throw_exception (ReadError ("could not read audio MXF information"));
        }
 
        if (desc_A.EditRate != desc_B.EditRate) {
index d78b4c2c881b5498dd76e1824e44e5d514e0c7ed..32fdc65fdf07ca7c62d9b0f9395367ee7c252588 100644 (file)
@@ -57,14 +57,14 @@ StereoPictureAsset::StereoPictureAsset (boost::filesystem::path file)
 
        ASDCP::JP2K::PictureDescriptor desc;
        if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        read_picture_descriptor (desc);
 
        ASDCP::WriterInfo info;
        if (ASDCP_FAILURE (reader.FillWriterInfo (info))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        _id = read_writer_info (info);
@@ -107,11 +107,11 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
 
        ASDCP::JP2K::PictureDescriptor desc_A;
        if (ASDCP_FAILURE (reader_A.FillPictureDescriptor (desc_A))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
        ASDCP::JP2K::PictureDescriptor desc_B;
        if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
-               boost::throw_exception (DCPReadError ("could not read video MXF information"));
+               boost::throw_exception (ReadError ("could not read video MXF information"));
        }
 
        if (!descriptor_equals (desc_A, desc_B, note)) {
@@ -132,7 +132,7 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
                try {
                        frame_A = reader->get_frame (i);
                        frame_B = other_reader->get_frame (i);
-               } catch (DCPReadError& e) {
+               } catch (ReadError& e) {
                        /* If there was a problem reading the frame data we'll just assume
                           the two frames are not equal.
                        */
index 72f59b36bbce6dd116ed3d783b9794c2875cd8da..80165430ee30a1a84c09c90ae72a541834091822 100644 (file)
@@ -56,7 +56,7 @@ StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n,
        _buffer = new ASDCP::JP2K::SFrameBuffer (4 * Kumu::Megabyte);
 
        if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), c->hmac()))) {
-               boost::throw_exception (DCPReadError (String::compose ("could not read video frame %1 of %2", n)));
+               boost::throw_exception (ReadError (String::compose ("could not read video frame %1 of %2", n)));
        }
 }
 
index 29e2c387ff05d028c02bce6724b87ff49d85bee7..b329396d92b84aa1b7f5ee903c5f9469fd5546d2 100644 (file)
@@ -208,7 +208,7 @@ dcp::string_to_effect (string s)
                return SHADOW;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle effect type"));
+       boost::throw_exception (ReadError ("unknown subtitle effect type"));
 }
 
 string
@@ -237,7 +237,7 @@ dcp::string_to_halign (string s)
                return HALIGN_RIGHT;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle halign type"));
+       boost::throw_exception (ReadError ("unknown subtitle halign type"));
 }
 
 string
@@ -266,7 +266,7 @@ dcp::string_to_valign (string s)
                return VALIGN_BOTTOM;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle valign type"));
+       boost::throw_exception (ReadError ("unknown subtitle valign type"));
 }
 
 string
@@ -299,7 +299,7 @@ dcp::string_to_direction (string s)
                return DIRECTION_BTT;
        }
 
-       boost::throw_exception (DCPReadError ("unknown subtitle direction type"));
+       boost::throw_exception (ReadError ("unknown subtitle direction type"));
 }
 
 /** Convert a content kind to a string which can be used in a
index 66cd25e4e4f05605b71a4400f918a1c3f2653c14..79663450d99a3d05a99ef20d4cf468b7d439fd36 100644 (file)
@@ -351,7 +351,7 @@ dcp::verify (
                stage ("Checking DCP", dcp->directory());
                try {
                        dcp->read (&notes);
-               } catch (DCPReadError& e) {
+               } catch (ReadError& e) {
                        notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::GENERAL_READ, string(e.what())));
                } catch (XMLError& e) {
                        notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::GENERAL_READ, string(e.what())));
index 7263d924cb6d9931270829ec0bee43af57d56b0a..504e9fd1b1689557bfbcb50095f4a0952112217a 100644 (file)
@@ -133,24 +133,24 @@ BOOST_AUTO_TEST_CASE (dcp_time)
        BOOST_CHECK_EQUAL (a, dcp::Time (1, 23, 45, 12, 250));
 
        /* Check some disallowed constructions from string */
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:1234", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:1234:66", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23::123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01::45:123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time (":23:45:123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45.1234", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45.1234.66", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45.", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:.123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01::45.123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time (":23:45.123", optional<int>()), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:123", 250), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:123:66", 250), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23:45:", 250), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01:23::123", 250), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time ("01::45:123", 250), dcp::DCPReadError);
-       BOOST_CHECK_THROW (dcp::Time (":23:45:123", 250), dcp::DCPReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:1234", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:1234:66", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23::123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01::45:123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time (":23:45:123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45.1234", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45.1234.66", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45.", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:.123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01::45.123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time (":23:45.123", optional<int>()), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:123", 250), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:123:66", 250), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23:45:", 250), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01:23::123", 250), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time ("01::45:123", 250), dcp::ReadError);
+       BOOST_CHECK_THROW (dcp::Time (":23:45:123", 250), dcp::ReadError);
 
        /* Check operator< and operator> */
        BOOST_CHECK (dcp::Time (3, 2, 3, 4, 24) < dcp::Time (3, 2, 3, 5, 24));
index ac0d6b44ac1de83f16fedd6c9763343c8cd5626d..bcc0321126579004e60ef9b309c96d7713d164b0 100644 (file)
@@ -47,5 +47,5 @@ BOOST_AUTO_TEST_CASE (effect_test)
        BOOST_CHECK_EQUAL (dcp::string_to_effect ("none"), dcp::NONE);
        BOOST_CHECK_EQUAL (dcp::string_to_effect ("border"), dcp::BORDER);
        BOOST_CHECK_EQUAL (dcp::string_to_effect ("shadow"), dcp::SHADOW);
-       BOOST_CHECK_THROW (dcp::string_to_effect ("fish"), dcp::DCPReadError);
+       BOOST_CHECK_THROW (dcp::string_to_effect ("fish"), dcp::ReadError);
 }
index d8ec4eea9f9939e3be28b33b3ccd2b4adf4bcef7..90718fae3168ca7e777d1574907d4d64ca52a852 100644 (file)
@@ -77,7 +77,7 @@ main (int argc, char* argv[])
                cerr << e.what() << " (" << e.filename() << ") when reading " << argv[1] << "\n";
                exit (EXIT_FAILURE);
        }
-       catch (DCPReadError& e)
+       catch (ReadError& e)
        {
                cerr << e.what() << " when reading " << argv[1] << "\n";
                exit (EXIT_FAILURE);
index 587d740030b4d3e143c8a16ff16091fbf6838d22..d0840d8c2a7b9911bfe9f9621170ce78fe06336e 100644 (file)
@@ -85,5 +85,5 @@ BOOST_AUTO_TEST_CASE (sound_frame_test2)
                "TONEPLATES-SMPTE-PLAINTEXT_TST_F_XX-XX_ITL-TD_51-XX_2K_WOE_20111001_WOE_OV/pcm_95734608-5d47-4d3f-bf5f-9e9186b66afa_.mxf"
                );
 
-       BOOST_CHECK_THROW (asset.start_read()->get_frame (99999999), dcp::DCPReadError);
+       BOOST_CHECK_THROW (asset.start_read()->get_frame (99999999), dcp::ReadError);
 }
index b5cf6b9be43659983a0c2eafc97276b93aaeeac3..5d04d0fcb9e706644be6f6976bc23d21430d2752 100644 (file)
@@ -149,7 +149,7 @@ main (int argc, char* argv[])
                        shared_ptr<const dcp::AtmosFrame> f = reader->get_frame (i);
                        writer->write (f->data(), f->size());
                }
-       } catch (dcp::DCPReadError& e) {
+       } catch (dcp::ReadError& e) {
                cerr << "Unknown MXF format.\n";
                return EXIT_FAILURE;
        }
index 8773781eb25d1169d7c24fa4bae2f14383a37761..3d5c2109066566d755a7221977808c1fcd6b9ed3 100644 (file)
@@ -371,7 +371,7 @@ main (int argc, char* argv[])
                } catch (FileError& e) {
                        cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << "\n";
                        exit (EXIT_FAILURE);
-               } catch (DCPReadError& e) {
+               } catch (ReadError& e) {
                        cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << "\n";
                        exit (EXIT_FAILURE);
                } catch (KDMDecryptionError& e) {
index eb3b0d827c8e44a7abb0d06b28e904da84aeeb01..caf0e0fe753fca1e49067a1236c44bd2efac7cb0 100644 (file)
@@ -103,7 +103,7 @@ main (int argc, char* argv[])
        list<dcp::VerificationNote> notes;
        try {
                dcp.read (&notes, true);
-       } catch (dcp::DCPReadError& e) {
+       } catch (dcp::ReadError& e) {
                cout << "Error:" <<  e.what() << "\n";
        }
 
@@ -118,7 +118,7 @@ main (int argc, char* argv[])
                if (i->path().extension() == ".xml") {
                        try {
                                cpl.reset(new dcp::CPL(i->path()));
-                       } catch (dcp::DCPReadError& e) {
+                       } catch (dcp::ReadError& e) {
                                cout << "Error: " << e.what() << "\n";
                        } catch (xmlpp::parse_error& e) {
                                cout << "Error: " << e.what() << "\n";
@@ -145,7 +145,7 @@ main (int argc, char* argv[])
                                        asset->hash (&progress);
                                        cout << "100%                     \n";
                                        assets.push_back (asset);
-                               } catch (dcp::DCPReadError& e) {
+                               } catch (dcp::ReadError& e) {
                                        cout << "Error: " << e.what() << "\n";
                                }
                        }