No-op: whitespace.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Jun 2015 15:22:08 +0000 (16:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Jun 2015 15:22:08 +0000 (16:22 +0100)
65 files changed:
src/asset.cc
src/asset.h
src/certificates.cc
src/certificates.h
src/colour_matrix.h
src/cpl.cc
src/cpl.h
src/dcp.cc
src/dcp.h
src/dcp_time.cc
src/dcp_time.h
src/exceptions.h
src/image.h
src/kdm.cc
src/kdm.h
src/key.cc
src/lut.h
src/metadata.h
src/mono_picture_asset.cc
src/mono_picture_asset.h
src/mono_picture_asset_writer.cc
src/mono_picture_asset_writer.h
src/mono_picture_frame.h
src/mxf_asset.cc
src/mxf_asset.h
src/picture_asset.cc
src/picture_asset.h
src/picture_asset_writer.h
src/picture_asset_writer_common.cc
src/reel.cc
src/reel.h
src/rgb_xyz.cc
src/rgb_xyz.h
src/signer.cc
src/signer.h
src/signer_chain.cc
src/sound_asset.cc
src/sound_asset.h
src/stereo_picture_asset.cc
src/stereo_picture_asset.h
src/stereo_picture_asset_writer.cc
src/stereo_picture_asset_writer.h
src/stereo_picture_frame.cc
src/stereo_picture_frame.h
src/subtitle_asset.cc
src/subtitle_asset.h
src/types.cc
src/types.h
src/util.cc
src/util.h
src/version.h
src/xml.h
src/xyz_frame.cc
test/certificates_test.cc
test/cpl_sar.cc
test/dcp_test.cc
test/encryption_test.cc
test/error_test.cc
test/kdm_test.cc
test/recovery_test.cc
test/rewrite_subs.cc
test/round_trip_test.cc
test/subs_in_out.cc
test/subtitle_tests.cc
test/util_test.cc

index 00ad67bc5a17dfc46e8a8bc495552eb78a40a4c7..be0792c1417073a3636bf5bc0a7d6cf51171257e 100644 (file)
@@ -115,7 +115,7 @@ Asset::equals (shared_ptr<const Asset> other, EqualityOptions, boost::function<v
                note (ERROR, "asset edit rates differ");
                return false;
        }
-       
+
        if (_intrinsic_duration != other->_intrinsic_duration) {
                note (ERROR, "asset intrinsic durations differ");
        }
index 6db8e5c271761670e0ce20d7187ed34460466650..64c46c4f2e2adcd8a437714ee9d63c9e40fd2bd4 100644 (file)
@@ -101,11 +101,11 @@ public:
        int duration () const {
                return _duration;
        }
-       
+
        int intrinsic_duration () const {
                return _intrinsic_duration;
        }
-       
+
        int edit_rate () const {
                return _edit_rate;
        }
@@ -113,7 +113,7 @@ public:
        void set_entry_point (int e) {
                _entry_point = e;
        }
-       
+
        void set_duration (int d) {
                _duration = d;
        }
@@ -132,7 +132,7 @@ protected:
 
        /** @return Interop PKL asdcpKind for the &lt;Type&gt; tag e.g. Picture, Sound etc. */
        virtual std::string asdcp_kind () const = 0;
-       
+
        std::string digest () const;
 
        /** Directory that our MXF or XML file is in */
@@ -150,7 +150,7 @@ protected:
        /** Length to present in frames */
        int _duration;
 
-private:       
+private:
        /** Digest of our MXF or XML file */
        mutable std::string _digest;
 };
index 8682b831e119ca7954573ac465c5a0dee2b43ea8..1a30fd7fe375f91d2d995a6018d93cb07d50e44b 100644 (file)
@@ -44,7 +44,7 @@ Certificate::Certificate (X509* c)
        : _certificate (c)
        , _public_key (0)
 {
-       
+
 }
 
 Certificate::Certificate (boost::filesystem::path filename)
@@ -55,7 +55,7 @@ Certificate::Certificate (boost::filesystem::path filename)
        if (!f) {
                throw FileError ("could not open file", filename, errno);
        }
-       
+
        if (!PEM_read_X509 (f, &_certificate, 0, 0)) {
                throw MiscError ("could not read X509 certificate");
        }
@@ -108,7 +108,7 @@ Certificate::operator= (Certificate const & other)
        _certificate = 0;
        RSA_free (_public_key);
        _public_key = 0;
-       
+
        read_string (other.certificate ());
 
        return *this;
@@ -118,12 +118,12 @@ string
 Certificate::certificate (bool with_begin_end) const
 {
        assert (_certificate);
-       
+
        BIO* bio = BIO_new (BIO_s_mem ());
        if (!bio) {
                throw MiscError ("could not create memory BIO");
        }
-       
+
        PEM_write_bio_X509 (bio, _certificate);
 
        string s;
@@ -139,7 +139,7 @@ Certificate::certificate (bool with_begin_end) const
                boost::replace_all (s, "-----BEGIN CERTIFICATE-----\n", "");
                boost::replace_all (s, "\n-----END CERTIFICATE-----\n", "");
        }
-       
+
        return s;
 }
 
@@ -216,11 +216,11 @@ Certificate::serial () const
 
        ASN1_INTEGER* s = X509_get_serialNumber (_certificate);
        assert (s);
-       
+
        BIGNUM* b = ASN1_INTEGER_to_BN (s, 0);
        char* c = BN_bn2dec (b);
        BN_free (b);
-       
+
        string st (c);
        OPENSSL_free (c);
 
@@ -231,7 +231,7 @@ string
 Certificate::thumbprint () const
 {
        assert (_certificate);
-       
+
        uint8_t buffer[8192];
        uint8_t* p = buffer;
        i2d_X509_CINF (_certificate->cert_info, &p);
index 2bf8d0db2ff4f5eb0233caeeb79b0a22a3ddebdf..7a90a867b70facdb58d253f89e5574004073274b 100644 (file)
@@ -67,7 +67,7 @@ public:
 
 private:
        void read_string (std::string);
-       
+
        static std::string name_for_xml (X509_NAME *);
        static std::string asn_to_utf8 (ASN1_STRING *);
        static std::string get_name_part (X509_NAME *, int);
index a42c8dfffd698337e3633ff8b217b7a1403ca97d..532ce7c91dd0b60479e82539b5e9bba585a2f67b 100644 (file)
@@ -26,6 +26,6 @@ extern double const srgb_to_xyz[3][3];
 extern double const rec601_to_xyz[3][3];
 extern double const rec709_to_xyz[3][3];
 
-}      
+}
 
 }
index 6737637760d230d36b1b9a7342ded490ba0c71d3..fe67facc97b3c5d69320925df0966417dad56a85 100644 (file)
@@ -73,9 +73,9 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
        } catch (FileError& e) {
                boost::throw_exception (FileError ("could not load CPL file", file, e.number ()));
        }
-       
+
        /* Now cherry-pick the required bits into our own data structure */
-       
+
        _name = cpl->annotation_text;
        _content_kind = cpl->content_kind;
 
@@ -91,7 +91,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
                } else {
                        p = (*i)->asset_list->main_stereoscopic_picture;
                }
-               
+
                _fps = p->edit_rate.numerator;
                _length += p->duration;
 
@@ -125,7 +125,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
                                        throw;
                                }
                        }
-                       
+
                } else {
                        try {
                                pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
@@ -140,20 +140,20 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
                                        /* Trim urn:uuid: */
                                        picture->set_key_id (p->key_id.substr (9));
                                }
-                               
+
                        } catch (MXFFileError) {
                                if (require_mxfs) {
                                        throw;
                                }
                        }
-                       
+
                }
-               
+
                if ((*i)->asset_list->main_sound) {
-                       
+
                        try {
                                pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_sound->id);
-                       
+
                                sound.reset (new SoundAsset (asset.first, asset.second->chunks.front()->path));
                                shared_ptr<parse::MainSound> s = (*i)->asset_list->main_sound;
 
@@ -172,7 +172,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
                }
 
                if ((*i)->asset_list->main_subtitle) {
-                       
+
                        pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_subtitle->id);
 
                        subtitle.reset (new SubtitleAsset (asset.first, asset.second->chunks.front()->path));
@@ -181,7 +181,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
                        subtitle->set_edit_rate (_fps);
                        subtitle->set_duration ((*i)->asset_list->main_subtitle->duration);
                }
-                       
+
                _reels.push_back (shared_ptr<Reel> (new Reel (picture, sound, subtitle)));
        }
 }
@@ -214,7 +214,7 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Sig
        if (signer) {
                root->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "dsig");
        }
-       
+
        root->add_child("Id")->add_child_text ("urn:uuid:" + _id);
        root->add_child("AnnotationText")->add_child_text (_name);
        root->add_child("IssueDate")->add_child_text (metadata.issue_date);
@@ -230,7 +230,7 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Sig
        root->add_child("RatingList");
 
        xmlpp::Element* reel_list = root->add_child ("ReelList");
-       
+
        for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
                (*i)->write_to_cpl (reel_list);
        }
@@ -291,9 +291,9 @@ CPL::write_to_assetmap (xmlpp::Node* node) const
        chunk->add_child("Offset")->add_child_text("0");
        chunk->add_child("Length")->add_child_text (raw_convert<string> (_length));
 }
-       
-       
-       
+
+
+
 bool
 CPL::equals (CPL const & other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
@@ -323,10 +323,10 @@ CPL::equals (CPL const & other, EqualityOptions opt, boost::function<void (NoteT
                note (ERROR, String::compose ("reel counts differ (%1 vs %2)", _reels.size(), other._reels.size()));
                return false;
        }
-       
+
        list<shared_ptr<Reel> >::const_iterator a = _reels.begin ();
        list<shared_ptr<Reel> >::const_iterator b = other._reels.begin ();
-       
+
        while (a != _reels.end ()) {
                if (!(*a)->equals (*b, opt, note)) {
                        return false;
index 0c213f8aa15551d1464d8d301292804adee03ef4..e80ea99a2c15ca3cbd8faf2a5095014bbe33cf5a 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -37,14 +37,14 @@ namespace parse {
        class AssetMap;
        class AssetMapAsset;
 }
-       
+
 class Asset;
 class Reel;
 class XMLMetadata;
 class MXFMetadata;
 class Signer;
 class KDM;
-       
+
 /** @brief A CPL within a DCP */
 class CPL
 {
@@ -53,7 +53,7 @@ public:
        CPL (boost::filesystem::path, std::string file, std::list<PathAssetMap> asset_maps, bool require_mxfs = true);
 
        void add_reel (boost::shared_ptr<Reel> reel);
-       
+
        /** @return the length in frames */
        int length () const {
                return _length;
@@ -93,18 +93,18 @@ public:
        }
 
        boost::filesystem::path filename () const;
-       
+
        bool equals (CPL const & other, EqualityOptions options, boost::function<void (NoteType, std::string)> note) const;
-       
+
        void write_xml (bool, XMLMetadata const &, boost::shared_ptr<const Signer>) const;
        void write_to_assetmap (xmlpp::Node *) const;
        void write_to_pkl (xmlpp::Node *, bool) const;
 
        void add_kdm (KDM const &);
-       
+
 private:
        std::pair<std::string, boost::shared_ptr<const parse::AssetMapAsset> > asset_from_id (std::list<PathAssetMap>, std::string id) const;
-       
+
        boost::filesystem::path _directory;
        /** the name of the DCP */
        std::string _name;
index 87a9565b709d59ef025bee5a6ef38f3df35da3cb..a182498d45216228d7728857ea7853fc5eca344e 100644 (file)
@@ -71,7 +71,7 @@ DCP::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Sig
 
        string pkl_uuid = make_uuid ();
        string pkl_path = write_pkl (pkl_uuid, interop, metadata, signer);
-       
+
        write_volindex (interop);
        write_assetmap (pkl_uuid, boost::filesystem::file_size (pkl_path), interop, metadata);
 }
@@ -80,7 +80,7 @@ std::string
 DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, shared_ptr<const Signer> signer) const
 {
        assert (!_cpls.empty ());
-       
+
        boost::filesystem::path p;
        p /= _directory;
        stringstream s;
@@ -94,7 +94,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
        } else {
                pkl = doc.create_root_node("PackingList", "http://www.smpte-ra.org/schemas/429-8/2007/PKL");
        }
-       
+
        if (signer) {
                pkl->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "dsig");
        }
@@ -111,7 +111,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
        for (list<shared_ptr<const Asset> >::const_iterator i = a.begin(); i != a.end(); ++i) {
                (*i)->write_to_pkl (asset_list, interop);
        }
-       
+
        for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
                (*i)->write_to_pkl (asset_list, interop);
        }
@@ -119,7 +119,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
        if (signer) {
                signer->sign (pkl, interop);
        }
-               
+
        doc.write_to_file (p.string (), "UTF-8");
        return p.string ();
 }
@@ -178,7 +178,7 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata
                root->add_child("IssueDate")->add_child_text (metadata.issue_date);
                root->add_child("Issuer")->add_child_text (metadata.issuer);
        }
-               
+
        xmlpp::Node* asset_list = root->add_child ("AssetList");
 
        xmlpp::Node* asset = asset_list->add_child ("Asset");
@@ -190,7 +190,7 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length, bool interop, XMLMetadata
        chunk->add_child("VolumeIndex")->add_child_text ("1");
        chunk->add_child("Offset")->add_child_text ("0");
        chunk->add_child("Length")->add_child_text (raw_convert<string> (pkl_length));
-       
+
        for (list<shared_ptr<CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
                (*i)->write_to_assetmap (asset_list);
        }
@@ -229,7 +229,7 @@ DCP::read_assets ()
                                boost::throw_exception (FileError ("could not find AssetMap file", p, -1));
                        }
                }
-               
+
        } catch (FileError& e) {
                boost::throw_exception (FileError ("could not load AssetMap file", e.filename(), e.number ()));
        }
@@ -241,7 +241,7 @@ DCP::read_assets ()
 
                boost::filesystem::path t = _directory;
                t /= (*i)->chunks.front()->path;
-               
+
                if (boost::algorithm::ends_with (t.string(), ".mxf") || boost::algorithm::ends_with (t.string(), ".ttf")) {
                        continue;
                }
@@ -267,7 +267,7 @@ DCP::read_assets ()
                        }
                }
        }
-       
+
        if (_files.cpls.empty ()) {
                boost::throw_exception (DCPReadError ("no CPL files found"));
        }
@@ -360,12 +360,12 @@ void
 DCP::add_kdm (KDM const & kdm)
 {
        list<KDMKey> keys = kdm.keys ();
-       
+
        for (list<shared_ptr<CPL> >::iterator i = _cpls.begin(); i != _cpls.end(); ++i) {
                for (list<KDMKey>::iterator j = keys.begin(); j != keys.end(); ++j) {
                        if (j->cpl_id() == (*i)->id()) {
                                (*i)->add_kdm (kdm);
-                       }                               
+                       }
                }
        }
 }
index 45ccce8875f12aed2c2941391d52d5a37a22fab3..edc1fc55e52fa3bbe953a64b244a1ed1bc91b2ef 100644 (file)
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -40,7 +40,7 @@ namespace xmlpp {
 namespace libdcp
 {
 
-class Asset;   
+class Asset;
 class PictureAsset;
 class SoundAsset;
 class SubtitleAsset;
@@ -57,7 +57,7 @@ namespace parse {
 /** @class DCP
  *  @brief A class to create or read a DCP.
  */
-       
+
 class DCP : public boost::noncopyable
 {
 public:
@@ -127,7 +127,7 @@ private:
         *  @param pkl_uuid UUID to use.
         */
        std::string write_pkl (std::string pkl_uuid, bool, XMLMetadata const &, boost::shared_ptr<const Signer>) const;
-       
+
        /** Write the VOLINDEX file */
        void write_volindex (bool) const;
 
index 47c15a2fd1005860df508115b8e197c7ac4eef2d..ea49f9ca8d7db28b75051cde574549f376a3b5f3 100644 (file)
@@ -73,7 +73,7 @@ Time::Time (string time, int tcr_)
        if (b.size() != 4) {
                boost::throw_exception (DCPReadError ("unrecognised time specification"));
        }
-       
+
        h = raw_convert<int> (b[0]);
        m = raw_convert<int> (b[1]);
        s = raw_convert<int> (b[2]);
@@ -198,7 +198,7 @@ libdcp::operator- (Time a, Time b)
        } else {
                r.tcr = a.tcr;
        }
-       
+
        r.e = a.e - b.e;
        if (r.e < 0) {
                r.e += a.tcr;
index 23f99b80a9edb738fe27325aeaf6e4e3374908f7..b3c0590ab4e3c30633009458d0891bba01181681 100644 (file)
@@ -33,7 +33,7 @@ namespace libdcp {
 /** @class Time
  *  @brief A representation of time within a DCP.
  */
-       
+
 class Time
 {
 public:
@@ -58,9 +58,9 @@ public:
                , e (e_)
                , tcr (tcr_)
        {}
-       
+
        Time (std::string time, int tcr_);
-       
+
        int h;   ///< hours
        int m;   ///< minutes
        int s;   ///< seconds
@@ -81,7 +81,7 @@ extern bool operator< (Time const & a, Time const & b);
 extern bool operator> (Time const & a, Time const & b);
 extern bool operator>= (Time const & a, Time const & b);
 extern std::ostream & operator<< (std::ostream & s, Time const & t);
-extern Time operator+ (Time a, Time b);        
+extern Time operator+ (Time a, Time b);
 extern Time operator- (Time a, Time b);
 extern float operator/ (Time a, Time const & b);
 
index dfbea60bcdb8490666783498357e4e676242e66c..fd1dd6a6c53074fdfec130d720bd017dd0585536 100644 (file)
@@ -78,7 +78,7 @@ public:
                : FileError (message, filename, number)
        {}
 };
-       
+
 /** @brief A miscellaneous exception */
 class MiscError : public StringError
 {
@@ -86,7 +86,7 @@ public:
        MiscError (std::string const & message)
                : StringError (message)
        {}
-       
+
        ~MiscError () throw () {}
 };
 
@@ -97,7 +97,7 @@ public:
        DCPReadError (std::string const & message)
                : StringError (message)
        {}
-       
+
        ~DCPReadError () throw () {}
 };
 
@@ -118,7 +118,7 @@ public:
        NotEncryptedError (std::string const & asset);
        ~NotEncryptedError () throw () {}
 };
-       
+
 }
 
 #endif
index 8b7fee097d4f038e6c2d175f1ba24d1da86f6b68..0586976aefcc2ad3d34795891eb63d9d538bac1c 100644 (file)
@@ -28,7 +28,7 @@ public:
        Image (Size);
        Image (Image const &);
        Image (boost::shared_ptr<const Image>);
-       
+
        virtual ~Image () {}
        virtual uint8_t** data () const = 0;
        virtual int* stride () const = 0;
@@ -39,7 +39,7 @@ public:
 
 protected:
        void swap (Image &);
-       
+
        Size _size;
 
 };
index 787d7adf24afd05dc7a464b4f7f6e76a1d6ecb5b..aacd2599a9650b55a8a6e0e1eab8596ee296f4de 100644 (file)
@@ -50,14 +50,14 @@ KDM::KDM (boost::filesystem::path kdm, boost::filesystem::path private_key)
        : _xml_kdm (new xml::DCinemaSecurityMessage (kdm))
 {
        /* Read the private key */
-          
+
        FILE* private_key_file = fopen_boost (private_key, "r");
        if (!private_key_file) {
                throw FileError ("could not find RSA private key file", private_key, errno);
        }
-       
+
        RSA* rsa = PEM_read_RSAPrivateKey (private_key_file, 0, 0, 0);
-       fclose (private_key_file);      
+       fclose (private_key_file);
        if (!rsa) {
                throw FileError ("could not read RSA private key file", private_key, errno);
        }
@@ -106,7 +106,7 @@ KDM::KDM (
        */
 
        parse::CPL cpl (cpl_file);
-       
+
        xml::AuthenticatedPublic& apu = _xml_kdm->authenticated_public;
 
        /* AuthenticatedPublic */
@@ -167,7 +167,7 @@ KDM::KDM (
                        if ((*i)->asset_list->main_picture->key_id.empty ()) {
                                throw NotEncryptedError ("MainPicture");
                        }
-                       
+
                        KDMKey kkey (
                                signer, cpl.id.substr (9), "MDIK", (*i)->asset_list->main_picture->key_id.substr (9),
                                not_valid_before, not_valid_after, key
@@ -190,17 +190,17 @@ KDM::KDM (
                        _keys.push_back (kkey);
                        _xml_kdm->authenticated_private.encrypted_keys.push_back (kkey.encrypted_base64 (recipient_cert));
                }
-               
+
                if ((*i)->asset_list->main_sound) {
                        if ((*i)->asset_list->main_sound->key_id.empty ()) {
                                throw NotEncryptedError ("MainSound");
                        }
-                       
+
                        KDMKey kkey (
                                signer, cpl.id.substr (9), "MDAK", (*i)->asset_list->main_sound->key_id.substr (9),
                                not_valid_before, not_valid_after, key
                                );
-                       
+
                        _keys.push_back (kkey);
                        _xml_kdm->authenticated_private.encrypted_keys.push_back (kkey.encrypted_base64 (recipient_cert));
                }
@@ -234,7 +234,7 @@ KDM::operator= (KDM const & other)
 
        return *this;
 }
-     
+
 void
 KDM::as_xml (boost::filesystem::path path) const
 {
@@ -334,7 +334,7 @@ KDMKey::encrypted_base64 (shared_ptr<const Certificate> recipient_cert) const
        assert (_key_type.length() == 4);
        assert (_not_valid_before.length() == 25);
        assert (_not_valid_after.length() == 25);
-       
+
        /* XXX: SMPTE only */
        uint8_t block[138];
        uint8_t* p = block;
@@ -396,7 +396,7 @@ string
 KDMKey::get_uuid (unsigned char const ** p) const
 {
        stringstream g;
-       
+
        for (int i = 0; i < 16; ++i) {
                g << setw(2) << setfill('0') << hex << static_cast<int> (**p);
                (*p)++;
index 443712c4d715e84c00082f3ad468ed86644d269b..e6e6bce2aa48c12bd4b403e2286cee231a6e3bb5 100644 (file)
--- a/src/kdm.h
+++ b/src/kdm.h
@@ -85,7 +85,7 @@ public:
                boost::posix_time::ptime until,
                Key key
                );
-       
+
        KDMKey (KDMKey const &);
 
        KDMKey& operator= (KDMKey const &);
@@ -94,7 +94,7 @@ public:
        std::string cpl_id () const {
                return _cpl_id;
        }
-       
+
        /** @return ID of the key */
        std::string key_id () const {
                return _key_id;
@@ -119,10 +119,10 @@ public:
         *  @return The data block encrypted with a certificate's public key and converted to base 64.
         */
        std::string encrypted_base64 (boost::shared_ptr<const Certificate> cert) const;
-       
+
 private:
        friend class ::kdm_key_test;
-       
+
        void get (uint8_t *, uint8_t const **, int) const;
        std::string get (uint8_t const **, int) const;
        std::string get_uuid (uint8_t const **) const;
@@ -131,7 +131,7 @@ private:
        void put_uuid (uint8_t **, std::string) const;
 
        friend bool operator== (KDMKey const &, KDMKey const &);
-       
+
        uint8_t _signer_thumbprint[20];
        std::string _cpl_id;
        std::string _key_type;
@@ -167,7 +167,7 @@ public:
                DCI_SPECIFIC
        };
 
-       
+
        /** Create a new KDM.
         *  @param cpl CPL file that the KDM is for.
         *  @param signer Certificate chain to sign the KDM with.
index 8cac04a39416357df8e41badacc43215b7d422ea..5e8211f422963319185c10324b5aad1860ad54fb 100644 (file)
@@ -68,7 +68,7 @@ Key::operator= (Key const & other)
        if (this == &other) {
                return *this;
        }
-       
+
        memcpy (_value, other._value, ASDCP::KeyLen);
        return *this;
 }
@@ -77,7 +77,7 @@ string
 Key::hex () const
 {
        stringstream g;
-       
+
        for (unsigned int i = 0; i < ASDCP::KeyLen; ++i) {
                g << setw(2) << setfill('0') << std::hex << static_cast<int> (_value[i]);
        }
index ad2914671dcdc9d8a53c75ae71eff220d62f3f6f..965b4096ea3c8c3aee680ee305af848eef4fc9b8 100644 (file)
--- a/src/lut.h
+++ b/src/lut.h
@@ -39,7 +39,7 @@ public:
        virtual ~LUT() {
                delete[] _lut;
        }
-       
+
        float const * lut() const {
                return _lut;
        }
index b4c0896dab1efe20d2bc2c56dc1e1f9d2cd248ac..50b4040beb55ad196f2d348d3377c865d5fa7547 100644 (file)
@@ -47,7 +47,7 @@ public:
        XMLMetadata ();
 
        void set_issue_date_now ();
-       
+
        std::string issuer;
        std::string creator;
        std::string issue_date;
index f70db2b44d9cdc9d55d1b1b6d9f2d86d1d7dd2cc..dd870be323a9763828f7347531b07f33eb25ecd1 100644 (file)
@@ -52,14 +52,14 @@ MonoPictureAsset::create (boost::function<boost::filesystem::path (int)> get_pat
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (FileError ("could not open JPEG2000 file for reading", get_path(0), r));
        }
-       
+
        ASDCP::JP2K::PictureDescriptor picture_desc;
        j2k_parser.FillPictureDescriptor (picture_desc);
        picture_desc.EditRate = ASDCP::Rational (_edit_rate, 1);
-       
+
        ASDCP::WriterInfo writer_info;
        fill_writer_info (&writer_info);
-       
+
        ASDCP::JP2K::MXFWriter mxf_writer;
        r = mxf_writer.OpenWrite (path().string().c_str(), writer_info, picture_desc, 16384, false);
        if (ASDCP_FAILURE (r)) {
@@ -84,7 +84,7 @@ MonoPictureAsset::create (boost::function<boost::filesystem::path (int)> get_pat
                        (*_progress) (0.5 * float (i) / _intrinsic_duration);
                }
        }
-       
+
        r = mxf_writer.Finalize();
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("error in finalising video MXF", path().string(), r));
@@ -99,7 +99,7 @@ MonoPictureAsset::read ()
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string(), r));
        }
-       
+
        ASDCP::JP2K::PictureDescriptor desc;
        if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
@@ -136,13 +136,13 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, bo
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string(), r));
        }
-       
+
        ASDCP::JP2K::MXFReader reader_B;
        r = reader_B.OpenRead (other->path().string().c_str());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string(), r));
        }
-       
+
        ASDCP::JP2K::PictureDescriptor desc_A;
        if (ASDCP_FAILURE (reader_A.FillPictureDescriptor (desc_A))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
@@ -151,7 +151,7 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, bo
        if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
        }
-       
+
        if (!descriptor_equals (desc_A, desc_B, note)) {
                return false;
        }
@@ -163,11 +163,11 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, bo
                if (i >= other_picture->intrinsic_duration()) {
                        return false;
                }
-               
+
                note (PROGRESS, "Comparing video frame " + lexical_cast<string> (i) + " of " + lexical_cast<string> (_intrinsic_duration));
                shared_ptr<const MonoPictureFrame> frame_A = get_frame (i);
                shared_ptr<const MonoPictureFrame> frame_B = other_picture->get_frame (i);
-               
+
                if (!frame_buffer_equals (
                            i, opt, note,
                            frame_A->j2k_data(), frame_A->j2k_size(),
index ae2df4d23e525397a4b1b3f1dc030223eb8033db..37cd925e56dcfa2ed46a2f603518591b6833dc5c 100644 (file)
@@ -59,6 +59,6 @@ private:
        int edit_rate_factor () const;
 };
 
-}      
+}
 
 #endif
index ebf3ec00967acdd1ea633e62ffc56aa598b2a155..f91e5e54945878dd7e0fee459716d322e7973cef 100644 (file)
@@ -95,7 +95,7 @@ void
 MonoPictureAssetWriter::finalize ()
 {
        assert (!_finalized);
-       
+
        Kumu::Result_t r = _state->mxf_writer.Finalize();
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("error in finalizing video MXF", _asset->path().string(), r));
index e39226233d7a2db8533b3f40d325ae07567f112e..ae93589c1387f0fc7c79305f761a4d2d97d40791 100644 (file)
@@ -52,7 +52,7 @@ private:
        /* do this with an opaque pointer so we don't have to include
           ASDCP headers
        */
-          
+
        struct ASDCPState;
        boost::shared_ptr<ASDCPState> _state;
 };
index 0eedfb95033d1030fbefe504fd0a5dfbf3ac7549..623b2904a46d78baacc32368c02165146bd4114c 100644 (file)
@@ -33,7 +33,7 @@ namespace libdcp {
 
 class ARGBFrame;
 
-/** A single frame of a 2D (monoscopic) picture asset */       
+/** A single frame of a 2D (monoscopic) picture asset */
 class MonoPictureFrame
 {
 public:
index 28ac1933371cf8cfe8b0862230ae48acbade168c..e59f4f7860470e6705fcd41f8737590c62f77d20 100644 (file)
@@ -89,20 +89,20 @@ MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::fun
        if (!Asset::equals (other, opt, note)) {
                return false;
        }
-       
+
        shared_ptr<const MXFAsset> other_mxf = dynamic_pointer_cast<const MXFAsset> (other);
        if (!other_mxf) {
                note (ERROR, "comparing an MXF asset with a non-MXF asset");
                return false;
        }
-       
+
        if (_file_name != other_mxf->_file_name) {
                note (ERROR, "MXF names differ");
                if (!opt.mxf_names_can_differ) {
                        return false;
                }
        }
-       
+
        return true;
 }
 
@@ -135,7 +135,7 @@ MXFAsset::set_key (Key key)
                /* No key ID so far; we now need one */
                _key_id = make_uuid ();
        }
-       
+
        _decryption_context = new ASDCP::AESDecContext;
        if (ASDCP_FAILURE (_decryption_context->InitKey (_key->value ()))) {
                throw MiscError ("could not set up decryption context");
@@ -145,9 +145,9 @@ MXFAsset::set_key (Key key)
        if (ASDCP_FAILURE (_encryption_context->InitKey (_key->value ()))) {
                throw MiscError ("could not set up encryption context");
        }
-       
+
        uint8_t cbc_buffer[ASDCP::CBC_BLOCK_SIZE];
-       
+
        Kumu::FortunaRNG rng;
        if (ASDCP_FAILURE (_encryption_context->SetIVec (rng.FillRandom (cbc_buffer, ASDCP::CBC_BLOCK_SIZE)))) {
                throw MiscError ("could not set up CBC initialization vector");
index 4eafdcba935b37b714b0baa70c7f634957944e69..a15ec942a8d71a91c3986c01d63eb84793105b49 100644 (file)
@@ -37,9 +37,9 @@ namespace ASDCP {
 namespace libdcp
 {
 
-class MXFMetadata;     
+class MXFMetadata;
 
-/** @brief Parent class for assets which have MXF files */     
+/** @brief Parent class for assets which have MXF files */
 class MXFAsset : public Asset
 {
 public:
@@ -50,13 +50,13 @@ public:
         *  @param file_name Name of MXF file.
         */
        MXFAsset (boost::filesystem::path directory, boost::filesystem::path file_name);
-       
+
        ~MXFAsset ();
 
        virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
        virtual void write_to_cpl (xmlpp::Element *) const;
        virtual std::string key_type () const = 0;
-       
+
        /** Fill in a ADSCP::WriteInfo struct.
         *  @param w struct to fill in.
         */
@@ -77,7 +77,7 @@ public:
        std::string key_id () const {
                return _key_id;
        }
-       
+
        void set_key (Key);
 
        boost::optional<Key> key () const {
@@ -112,7 +112,7 @@ protected:
        virtual std::pair<std::string, std::string> cpl_node_attribute () const {
                return std::make_pair ("", "");
        }
-       
+
        /** Signal to emit to report progress, or 0 */
        boost::signals2::signal<void (float)>* _progress;
        ASDCP::AESEncContext* _encryption_context;
index 8d3b0347fe144a9ef8c3f8acd4cfaa6f4800f631..045ab51a3570af4ca554e5aab60f537f805bd4b9 100644 (file)
@@ -63,7 +63,7 @@ void
 PictureAsset::write_to_cpl (xmlpp::Element* node) const
 {
        MXFAsset::write_to_cpl (node);
-       
+
        xmlpp::Node::NodeList c = node->get_children ();
        xmlpp::Node::NodeList::iterator i = c.begin();
        while (i != c.end() && (*i)->get_name() != cpl_node_name ()) {
@@ -106,7 +106,7 @@ PictureAsset::descriptor_equals (
 //             a.CodingStyleDefault != b.CodingStyleDefault ||
 //             a.QuantizationDefault != b.QuantizationDefault
                ) {
-               
+
                note (ERROR, "video MXF picture descriptors differ");
                return false;
        }
@@ -114,7 +114,7 @@ PictureAsset::descriptor_equals (
        if (a.ContainerDuration != b.ContainerDuration) {
                note (ERROR, "video container durations differ");
        }
-       
+
 //             for (unsigned int j = 0; j < ASDCP::JP2K::MaxComponents; ++j) {
 //                     if (a.ImageComponents[j] != b.ImageComponents[j]) {
 //                             notes.pack_start ("video MXF picture descriptors differ");
@@ -135,24 +135,24 @@ PictureAsset::frame_buffer_equals (
                /* Easy result; the J2K data is identical */
                return true;
        }
-               
+
        /* Decompress the images to bitmaps */
        shared_ptr<XYZFrame> image_A = decompress_j2k (const_cast<uint8_t*> (data_A), size_A, 0);
        shared_ptr<XYZFrame> image_B = decompress_j2k (const_cast<uint8_t*> (data_B), size_B, 0);
-       
+
        /* Compare them */
-       
+
        vector<int> abs_diffs (image_A->size().width * image_A->size().height * 3);
        int d = 0;
        int max_diff = 0;
-       
+
        for (int c = 0; c < 3; ++c) {
-               
+
                if (image_A->size() != image_B->size()) {
                        note (ERROR, "image sizes for frame " + lexical_cast<string>(frame) + " differ");
                        return false;
                }
-               
+
                int const pixels = image_A->size().width * image_A->size().height;
                for (int j = 0; j < pixels; ++j) {
                        int const t = abs (image_A->data(c)[j] - image_B->data(c)[j]);
@@ -160,23 +160,23 @@ PictureAsset::frame_buffer_equals (
                        max_diff = max (max_diff, t);
                }
        }
-               
+
        uint64_t total = 0;
        for (vector<int>::iterator j = abs_diffs.begin(); j != abs_diffs.end(); ++j) {
                total += *j;
        }
-       
+
        double const mean = double (total) / abs_diffs.size ();
-       
+
        uint64_t total_squared_deviation = 0;
        for (vector<int>::iterator j = abs_diffs.begin(); j != abs_diffs.end(); ++j) {
                total_squared_deviation += pow (*j - mean, 2);
        }
-       
+
        double const std_dev = sqrt (double (total_squared_deviation) / abs_diffs.size());
-       
+
        note (NOTE, "mean difference " + lexical_cast<string> (mean) + ", deviation " + lexical_cast<string> (std_dev));
-       
+
        if (mean > opt.max_mean_pixel_error) {
                note (
                        ERROR,
@@ -184,7 +184,7 @@ PictureAsset::frame_buffer_equals (
                        " out of range " + lexical_cast<string>(opt.max_mean_pixel_error) +
                        " in frame " + lexical_cast<string>(frame)
                        );
-               
+
                return false;
        }
 
@@ -195,7 +195,7 @@ PictureAsset::frame_buffer_equals (
                        " out of range " + lexical_cast<string>(opt.max_std_dev_pixel_error) +
                        " in frame " + lexical_cast<string>(frame)
                        );
-               
+
                return false;
        }
 
index b404abd2e5d0bb897d23391adcd3e520e4291d5f..a56ef5e103199ad6f649199fb36aa008dac7388b 100644 (file)
@@ -38,7 +38,7 @@ namespace ASDCP {
 namespace libdcp
 {
 
-class MonoPictureFrame;        
+class MonoPictureFrame;
 class StereoPictureFrame;
 class PictureAssetWriter;
 
@@ -47,7 +47,7 @@ class PictureAsset : public MXFAsset
 {
 public:
        /** Construct a PictureAsset.
-        *  
+        *
         *  @param directory Directory where MXF file is.
         *  @param mxf_name Name of MXF file.
         */
@@ -58,7 +58,7 @@ public:
         *      Interop mode (set_interop)
         *      Edit rate    (set_edit_rate)
         *      MXF Metadata (set_metadata)
-        *      
+        *
         *  @param overwrite true to overwrite an existing MXF file; in this mode, writing can be resumed to a partially-written MXF; false if the
         *  MXF file does not exist.
         */
@@ -67,7 +67,7 @@ public:
        virtual void read () = 0;
        virtual void create (std::vector<boost::filesystem::path> const &) {}
        virtual void create (boost::function<boost::filesystem::path (int)>) {}
-       
+
        Size size () const {
                return _size;
        }
@@ -100,7 +100,7 @@ private:
        std::string key_type () const;
        virtual int edit_rate_factor () const = 0;
 };
-       
+
 
 }
 
index d30d9a858654c3a908c8e4410d0ebe1532f866c0..532876137803e14bb7bd9909ed2435c7a61327c3 100644 (file)
 
 namespace libdcp {
 
-class PictureAsset;    
+class PictureAsset;
 
-/** Information about a single frame (either a monoscopic frame or a left *or* right eye stereoscopic frame) */        
+/** Information about a single frame (either a monoscopic frame or a left *or* right eye stereoscopic frame) */
 struct FrameInfo
 {
        FrameInfo ()
                : offset (0)
                , size (0)
        {}
-       
+
        FrameInfo (uint64_t o, uint64_t s, std::string h)
                : offset (o)
                , size (s)
@@ -58,7 +58,7 @@ public:
        virtual FrameInfo write (uint8_t *, int) = 0;
        virtual void finalize () = 0;
        virtual void fake_write (int) = 0;
-       
+
 protected:
        template <class P, class Q>
        friend void start (PictureAssetWriter *, boost::shared_ptr<P>, Q *, uint8_t *, int);
@@ -66,7 +66,7 @@ protected:
        PictureAssetWriter (PictureAsset *, bool);
 
        PictureAsset* _asset;
-       
+
        /** Number of picture frames written to the asset so far.  For stereo assets
         *  this will be incremented for each eye (i.e. there will be twice the number
         *  of frames as in a mono asset).
index 528487450017ee2f48c04acdc8ecdc632878cd37..d8383e0f26cf7a6858e4934420c36a09430774f1 100644 (file)
@@ -24,7 +24,7 @@ struct ASDCPStateBase
        ASDCPStateBase ()
                : frame_buffer (4 * Kumu::Megabyte)
        {}
-       
+
        ASDCP::JP2K::CodestreamParser j2k_parser;
        ASDCP::JP2K::FrameBuffer frame_buffer;
        ASDCP::WriterInfo writer_info;
@@ -41,9 +41,9 @@ void libdcp::start (PictureAssetWriter* writer, shared_ptr<P> state, Q* asset, u
 
        state->j2k_parser.FillPictureDescriptor (state->picture_descriptor);
        state->picture_descriptor.EditRate = ASDCP::Rational (asset->edit_rate(), 1);
-       
+
        asset->fill_writer_info (&state->writer_info);
-       
+
        Kumu::Result_t r = state->mxf_writer.OpenWrite (
                asset->path().string().c_str(),
                state->writer_info,
index ff51c025b78dd664ebd9a47e827e77b042bf42c0..826fc31fc330a0006022d548c503d665732ea9c4 100644 (file)
@@ -40,7 +40,7 @@ Reel::write_to_cpl (xmlpp::Element* node) const
        xmlpp::Element* reel = node->add_child ("Reel");
        reel->add_child("Id")->add_child_text ("urn:uuid:" + make_uuid());
        xmlpp::Element* asset_list = reel->add_child ("AssetList");
-       
+
        if (_main_picture && dynamic_pointer_cast<MonoPictureAsset> (_main_picture)) {
                /* Mono pictures come before other stuff... */
                _main_picture->write_to_cpl (asset_list);
@@ -59,7 +59,7 @@ Reel::write_to_cpl (xmlpp::Element* node) const
                _main_picture->write_to_cpl (asset_list);
        }
 }
-       
+
 bool
 Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
 {
@@ -67,7 +67,7 @@ Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::f
                note (ERROR, "reel has different assets");
                return false;
        }
-       
+
        if (_main_picture && !_main_picture->equals (other->_main_picture, opt, note)) {
                return false;
        }
@@ -76,7 +76,7 @@ Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::f
                note (ERROR, "reel has different assets");
                return false;
        }
-       
+
        if (_main_sound && !_main_sound->equals (other->_main_sound, opt, note)) {
                return false;
        }
@@ -85,7 +85,7 @@ Reel::equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::f
                note (ERROR, "reel has different assets");
                return false;
        }
-       
+
        if (_main_subtitle && !_main_subtitle->equals (other->_main_subtitle, opt, note)) {
                return false;
        }
@@ -103,7 +103,7 @@ void
 Reel::add_kdm (KDM const & kdm)
 {
        list<KDMKey> keys = kdm.keys ();
-       
+
        for (list<KDMKey>::iterator i = keys.begin(); i != keys.end(); ++i) {
                if (i->key_id() == _main_picture->key_id()) {
                        _main_picture->set_key (i->key ());
index 35302f17d96cdd0baf52a69314953b1adce07a73..2e1e457f47dc4fe1ae7164a30b431dea588f698e 100644 (file)
@@ -36,9 +36,9 @@ namespace libdcp {
 class PictureAsset;
 class SoundAsset;
 class SubtitleAsset;
-class KDM;     
+class KDM;
 
-/** @brief A reel within a DCP; the part which actually contains picture, sound and subtitle data */   
+/** @brief A reel within a DCP; the part which actually contains picture, sound and subtitle data */
 class Reel
 {
 public:
@@ -51,7 +51,7 @@ public:
                , _main_sound (sound)
                , _main_subtitle (subtitle)
        {}
-       
+
        boost::shared_ptr<const PictureAsset> main_picture () const {
                return _main_picture;
        }
@@ -59,7 +59,7 @@ public:
        boost::shared_ptr<const SoundAsset> main_sound () const {
                return _main_sound;
        }
-       
+
        boost::shared_ptr<const SubtitleAsset> main_subtitle () const {
                return _main_subtitle;
        }
@@ -69,7 +69,7 @@ public:
        bool encrypted () const;
 
        void set_mxf_keys (libdcp::Key);
-       
+
        bool equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> notes) const;
 
        void add_kdm (KDM const &);
index bd01b8005171f13a239ea3bb05ab7dea22b13cfc..509e320a32dac03e3a154d2aa25fcfd9d92c7372 100644 (file)
@@ -43,11 +43,11 @@ libdcp::xyz_to_rgb (shared_ptr<const XYZFrame> xyz_frame, shared_ptr<const LUT>
        struct {
                double x, y, z;
        } s;
-       
+
        struct {
                double r, g, b;
        } d;
-       
+
        int* xyz_x = xyz_frame->data (0);
        int* xyz_y = xyz_frame->data (1);
        int* xyz_z = xyz_frame->data (2);
@@ -55,13 +55,13 @@ libdcp::xyz_to_rgb (shared_ptr<const XYZFrame> xyz_frame, shared_ptr<const LUT>
        shared_ptr<ARGBFrame> argb_frame (new ARGBFrame (xyz_frame->size ()));
 
        uint8_t* argb = argb_frame->data ();
-       
+
        for (int y = 0; y < xyz_frame->size().height; ++y) {
                uint8_t* argb_line = argb;
                for (int x = 0; x < xyz_frame->size().width; ++x) {
 
                        assert (*xyz_x >= 0 && *xyz_y >= 0 && *xyz_z >= 0 && *xyz_x < 4096 && *xyz_y < 4096 && *xyz_z < 4096);
-                       
+
                        /* In gamma LUT */
                        s.x = lut_in->lut()[*xyz_x++];
                        s.y = lut_in->lut()[*xyz_y++];
@@ -76,23 +76,23 @@ libdcp::xyz_to_rgb (shared_ptr<const XYZFrame> xyz_frame, shared_ptr<const LUT>
                        d.r = ((s.x * colour_matrix::xyz_to_rgb[0][0]) + (s.y * colour_matrix::xyz_to_rgb[0][1]) + (s.z * colour_matrix::xyz_to_rgb[0][2]));
                        d.g = ((s.x * colour_matrix::xyz_to_rgb[1][0]) + (s.y * colour_matrix::xyz_to_rgb[1][1]) + (s.z * colour_matrix::xyz_to_rgb[1][2]));
                        d.b = ((s.x * colour_matrix::xyz_to_rgb[2][0]) + (s.y * colour_matrix::xyz_to_rgb[2][1]) + (s.z * colour_matrix::xyz_to_rgb[2][2]));
-                       
+
                        d.r = min (d.r, 1.0);
                        d.r = max (d.r, 0.0);
-                       
+
                        d.g = min (d.g, 1.0);
                        d.g = max (d.g, 0.0);
-                       
+
                        d.b = min (d.b, 1.0);
                        d.b = max (d.b, 0.0);
-                       
+
                        /* Out gamma LUT */
                        *argb_line++ = lut_out->lut()[(int) (d.b * max_colour)] * 0xff;
                        *argb_line++ = lut_out->lut()[(int) (d.g * max_colour)] * 0xff;
                        *argb_line++ = lut_out->lut()[(int) (d.r * max_colour)] * 0xff;
                        *argb_line++ = 0xff;
                }
-               
+
                argb += argb_frame->stride ();
        }
 
@@ -110,7 +110,7 @@ libdcp::rgb_to_xyz (
 {
        assert (lut_in->bit_depth() == 12);
        assert (lut_out->bit_depth() == 16);
-       
+
        shared_ptr<XYZFrame> xyz (new XYZFrame (rgb->size ()));
 
        struct {
@@ -134,16 +134,16 @@ libdcp::rgb_to_xyz (
                        s.r = lut_in->lut()[*p++ >> 4];
                        s.g = lut_in->lut()[*p++ >> 4];
                        s.b = lut_in->lut()[*p++ >> 4];
-                       
+
                        /* RGB to XYZ Matrix */
                        d.x = ((s.r * rgb_to_xyz[0][0]) +
                               (s.g * rgb_to_xyz[0][1]) +
                               (s.b * rgb_to_xyz[0][2]));
-                       
+
                        d.y = ((s.r * rgb_to_xyz[1][0]) +
                               (s.g * rgb_to_xyz[1][1]) +
                               (s.b * rgb_to_xyz[1][2]));
-                       
+
                        d.z = ((s.r * rgb_to_xyz[2][0]) +
                               (s.g * rgb_to_xyz[2][1]) +
                               (s.b * rgb_to_xyz[2][2]));
@@ -160,7 +160,7 @@ libdcp::rgb_to_xyz (
                        e.z = ((d.x * bradford[2][0]) +
                               (d.y * bradford[2][1]) +
                               (d.z * bradford[2][2]));
-                       
+
                        /* DCI companding */
                        e.x = e.x * DCI_COEFFICIENT * 65535;
                        e.y = e.y * DCI_COEFFICIENT * 65535;
@@ -169,7 +169,7 @@ libdcp::rgb_to_xyz (
                        assert (e.x >= 0 && e.x < 65536);
                        assert (e.y >= 0 && e.y < 65536);
                        assert (e.z >= 0 && e.z < 65536);
-                       
+
                        /* Out gamma LUT */
                        xyz->data(0)[jn] = lut_out->lut()[(int) e.x] * 4096;
                        xyz->data(1)[jn] = lut_out->lut()[(int) e.y] * 4096;
@@ -201,6 +201,6 @@ libdcp::xyz_to_xyz (shared_ptr<const Image> xyz_16)
                        ++jn;
                }
        }
-       
+
        return xyz_12;
 }
index 690ba08ea95d9377f56f868b9806669c6ebc41b8..23b131317a4f20ccacb27c7850f19d80c4b81458 100644 (file)
 
 namespace libdcp {
 
-class ARGBFrame;       
+class ARGBFrame;
 class XYZFrame;
 class LUT;
 class Image;
-       
+
 extern boost::shared_ptr<ARGBFrame> xyz_to_rgb (
        boost::shared_ptr<const XYZFrame>, boost::shared_ptr<const LUT>, boost::shared_ptr<const LUT>
        );
@@ -36,5 +36,5 @@ extern boost::shared_ptr<XYZFrame> rgb_to_xyz (
        );
 
 extern boost::shared_ptr<XYZFrame> xyz_to_xyz (boost::shared_ptr<const Image>);
-       
+
 }
index a6978885c8e403ea8d29a6eee24bbab413cdb091..c7dfdd0635b581c9fcfef16e5c3c65c737e6edf5 100644 (file)
@@ -41,16 +41,16 @@ Signer::sign (xmlpp::Element* parent, bool interop) const
        add_signer (parent, "dsig");
 
        xmlpp::Element* signature = parent->add_child("Signature", "dsig");
-       
+
        xmlpp::Element* signed_info = signature->add_child ("SignedInfo", "dsig");
        signed_info->add_child("CanonicalizationMethod", "dsig")->set_attribute ("Algorithm", "http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
-       
+
        if (interop) {
                signed_info->add_child("SignatureMethod", "dsig")->set_attribute("Algorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
        } else {
                signed_info->add_child("SignatureMethod", "dsig")->set_attribute("Algorithm", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
        }
-       
+
        xmlpp::Element* reference = signed_info->add_child("Reference", "dsig");
        reference->set_attribute ("URI", "");
 
@@ -84,13 +84,13 @@ Signer::add_signature_value (xmlpp::Node* parent, string ns) const
        list<shared_ptr<Certificate> > c = _certificates.leaf_to_root ();
        for (list<shared_ptr<Certificate> >::iterator i = c.begin(); i != c.end(); ++i) {
                xmlpp::Element* data = key_info->add_child("X509Data", ns);
-               
+
                {
                        xmlpp::Element* serial = data->add_child("X509IssuerSerial", ns);
                        serial->add_child("X509IssuerName", ns)->add_child_text((*i)->issuer ());
                        serial->add_child("X509SerialNumber", ns)->add_child_text((*i)->serial ());
                }
-               
+
                data->add_child("X509Certificate", ns)->add_child_text((*i)->certificate());
        }
 
@@ -124,13 +124,13 @@ Signer::add_signer (xmlpp::Element* parent, string ns) const
 
        {
                xmlpp::Element* data = signer->add_child("X509Data", ns);
-               
+
                {
                        xmlpp::Element* serial_element = data->add_child("X509IssuerSerial", ns);
                        serial_element->add_child("X509IssuerName", ns)->add_child_text (_certificates.leaf()->issuer());
                        serial_element->add_child("X509SerialNumber", ns)->add_child_text (_certificates.leaf()->serial());
                }
-               
+
                data->add_child("X509SubjectName", ns)->add_child_text (_certificates.leaf()->subject());
        }
 }
index efb8099bcbbd86b5f3402a4b41eedc1f5e44e905..3374e961c18adc76f854e69c06862ad3ed0f1565 100644 (file)
@@ -41,11 +41,11 @@ public:
        CertificateChain const & certificates () const {
                return _certificates;
        }
-       
-private:       
+
+private:
 
        void add_signer (xmlpp::Element* parent, std::string ns) const;
-       
+
        CertificateChain _certificates;
        /** Filename of signer key */
        boost::filesystem::path _key;
index f35e4ff61732c8f8d957455144d26f1e4ab2ab9b..a2443888cd7b2754effa1797af08d7203ad2f78c 100644 (file)
@@ -86,7 +86,7 @@ static void command (string cmd)
  *  @param openssl openssl binary name (or full path if openssl is not on the system path).
  *  @return SHA1 digest of corresponding public key, with escaped / characters.
  */
-       
+
 static string
 public_key_digest (boost::filesystem::path private_key, boost::filesystem::path openssl)
 {
@@ -119,7 +119,7 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path
        }
 
        /* Decode the base64 of the public key */
-               
+
        unsigned char buffer[512];
        int const N = libdcp::base64_decode (pub, buffer, 1024);
 
@@ -143,9 +143,9 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path
        string dig = Kumu::base64encode (digest, SHA_DIGEST_LENGTH, digest_base64, 64);
 #ifdef LIBDCP_WINDOWS
        boost::replace_all (dig, "/", "\\/");
-#else  
+#else
        boost::replace_all (dig, "/", "\\\\/");
-#endif 
+#endif
        return dig;
 }
 
@@ -202,7 +202,7 @@ libdcp::make_signer_chain (boost::filesystem::path directory, boost::filesystem:
                  << "OU = Organization unit\n"
                  << "CN = Entity and dnQualifier\n";
        }
-               
+
        string const inter_subject = "/O=example.org/OU=example.org/CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION/dnQualifier="
                + public_key_digest ("intermediate.key", openssl);
 
@@ -213,7 +213,7 @@ libdcp::make_signer_chain (boost::filesystem::path directory, boost::filesystem:
                command (s.str().c_str());
        }
 
-       
+
        command (
                quoted_openssl +
                " x509 -req -sha256 -days 3649 -CA ca.self-signed.pem -CAkey ca.key -set_serial 6"
index 179f6cd5a762d505442da0611647edec5f374c84..6539c0ad23a3ddba2e361f84100cdc994df30793 100644 (file)
@@ -100,7 +100,7 @@ SoundAsset::create (boost::function<boost::filesystem::path (Channel)> get_path)
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (FileError ("could not open WAV file for reading", get_path(LEFT), r));
        }
-       
+
        ASDCP::PCM::AudioDescriptor audio_desc;
        pcm_parser_channel[0]->FillAudioDescriptor (audio_desc);
        audio_desc.ChannelCount = 0;
@@ -135,7 +135,7 @@ SoundAsset::create (boost::function<boost::filesystem::path (Channel)> get_path)
        for (int i = 0; i < _channels; ++i) {
 
                boost::filesystem::path const path = get_path (channels[i]);
-               
+
                Kumu::Result_t r = pcm_parser_channel[i]->OpenRead (path.string().c_str(), asdcp_edit_rate);
                if (ASDCP_FAILURE (r)) {
                        boost::throw_exception (FileError ("could not open WAV file for reading", path, r));
@@ -160,7 +160,7 @@ SoundAsset::create (boost::function<boost::filesystem::path (Channel)> get_path)
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (FileError ("could not open audio MXF for writing", path().string(), r));
        }
-       
+
        for (int i = 0; i < _intrinsic_duration; ++i) {
 
                for (int j = 0; j < _channels; ++j) {
@@ -218,7 +218,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::f
        if (!MXFAsset::equals (other, opt, note)) {
                return false;
        }
-                    
+
        ASDCP::PCM::MXFReader reader_A;
        Kumu::Result_t r = reader_A.OpenRead (path().string().c_str());
        if (ASDCP_FAILURE (r)) {
@@ -239,7 +239,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::f
        if (ASDCP_FAILURE (reader_B.FillAudioDescriptor (desc_B))) {
                boost::throw_exception (DCPReadError ("could not read audio MXF information"));
        }
-       
+
        if (
                desc_A.EditRate != desc_B.EditRate ||
                desc_A.AudioSamplingRate != desc_B.AudioSamplingRate ||
@@ -252,28 +252,28 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::f
                desc_A.ContainerDuration != desc_B.ContainerDuration
 //             desc_A.ChannelFormat != desc_B.ChannelFormat ||
                ) {
-               
+
                note (ERROR, "audio MXF picture descriptors differ");
                return false;
        }
-       
+
        ASDCP::PCM::FrameBuffer buffer_A (1 * Kumu::Megabyte);
        ASDCP::PCM::FrameBuffer buffer_B (1 * Kumu::Megabyte);
-       
+
        for (int i = 0; i < _intrinsic_duration; ++i) {
                if (ASDCP_FAILURE (reader_A.ReadFrame (i, buffer_A))) {
                        boost::throw_exception (DCPReadError ("could not read audio frame"));
                }
-               
+
                if (ASDCP_FAILURE (reader_B.ReadFrame (i, buffer_B))) {
                        boost::throw_exception (DCPReadError ("could not read audio frame"));
                }
-               
+
                if (buffer_A.Size() != buffer_B.Size()) {
                        note (ERROR, "sizes of audio data for frame " + lexical_cast<string>(i) + " differ");
                        return false;
                }
-               
+
                if (memcmp (buffer_A.RoData(), buffer_B.RoData(), buffer_A.Size()) != 0) {
                        for (uint32_t i = 0; i < buffer_A.Size(); ++i) {
                                int const d = abs (buffer_A.RoData()[i] - buffer_B.RoData()[i]);
@@ -319,7 +319,7 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* a)
        , _frame_buffer_offset (0)
 {
        _state->encryption_context = a->encryption_context ();
-       
+
        /* Derived from ASDCP::Wav::SimpleWaveHeader::FillADesc */
        _state->audio_desc.EditRate = ASDCP::Rational (_asset->edit_rate(), 1);
        _state->audio_desc.AudioSamplingRate = ASDCP::Rational (_asset->sampling_rate(), 1);
@@ -334,13 +334,13 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* a)
           in ASDCP's WriteMXFFooter, but it stops a valgrind warning.
        */
        _state->audio_desc.ContainerDuration = 0;
-       
+
        _state->frame_buffer.Capacity (ASDCP::PCM::CalcFrameBufferSize (_state->audio_desc));
        _state->frame_buffer.Size (ASDCP::PCM::CalcFrameBufferSize (_state->audio_desc));
        memset (_state->frame_buffer.Data(), 0, _state->frame_buffer.Capacity());
-       
+
        _asset->fill_writer_info (&_state->writer_info);
-       
+
        Kumu::Result_t r = _state->mxf_writer.OpenWrite (_asset->path().string().c_str(), _state->writer_info, _state->audio_desc);
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (FileError ("could not open audio MXF for writing", _asset->path().string(), r));
@@ -391,7 +391,7 @@ SoundAssetWriter::finalize ()
        if (_frame_buffer_offset > 0) {
                write_current_frame ();
        }
-       
+
        if (ASDCP_FAILURE (_state->mxf_writer.Finalize())) {
                boost::throw_exception (MiscError ("could not finalise audio MXF"));
        }
index c52a5436a4c713ee913a954e5975a4979bfebac2..e9fba11d06cdfc937277509f3c16d0115582ad6e 100644 (file)
@@ -48,13 +48,13 @@ private:
        /* no copy construction */
        SoundAssetWriter (SoundAssetWriter const &);
        SoundAssetWriter& operator= (SoundAssetWriter const &);
-       
+
        void write_current_frame ();
 
        /* do this with an opaque pointer so we don't have to include
           ASDCP headers
        */
-          
+
        struct ASDCPState;
        boost::shared_ptr<ASDCPState> _state;
 
@@ -91,7 +91,7 @@ public:
        void create (boost::function<boost::filesystem::path (Channel)> get_path);
 
        boost::shared_ptr<SoundAssetWriter> start_write ();
-       
+
        bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
 
        boost::shared_ptr<const SoundFrame> get_frame (int n) const;
@@ -99,7 +99,7 @@ public:
        void set_channels (int c) {
                _channels = c;
        }
-       
+
        int channels () const {
                return _channels;
        }
@@ -117,7 +117,7 @@ protected:
        std::string asdcp_kind () const {
                return "Sound";
        }
-       
+
 private:
        std::string key_type () const;
        void construct (boost::function<boost::filesystem::path (Channel)> get_path);
index 85921f9ccc73ed529a4c9190e3fea52f648359ba..5da11025f59aed2a6b373b99faf4d9e47a82d487 100644 (file)
@@ -42,13 +42,13 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string(), r));
        }
-       
+
        ASDCP::JP2K::MXFSReader reader_B;
        r = reader_B.OpenRead (other->path().string().c_str());
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", other->path().string(), r));
        }
-       
+
        ASDCP::JP2K::PictureDescriptor desc_A;
        if (ASDCP_FAILURE (reader_A.FillPictureDescriptor (desc_A))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
@@ -57,18 +57,18 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
        if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
        }
-       
+
        if (!descriptor_equals (desc_A, desc_B, note)) {
                return false;
        }
-       
+
        shared_ptr<const StereoPictureAsset> other_picture = dynamic_pointer_cast<const StereoPictureAsset> (other);
        assert (other_picture);
 
        for (int i = 0; i < _intrinsic_duration; ++i) {
                shared_ptr<const StereoPictureFrame> frame_A = get_frame (i);
                shared_ptr<const StereoPictureFrame> frame_B = other_picture->get_frame (i);
-               
+
                if (!frame_buffer_equals (
                            i, opt, note,
                            frame_A->left_j2k_data(), frame_A->left_j2k_size(),
@@ -76,7 +76,7 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
                            )) {
                        return false;
                }
-               
+
                if (!frame_buffer_equals (
                            i, opt, note,
                            frame_A->right_j2k_data(), frame_A->right_j2k_size(),
@@ -92,7 +92,7 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
 StereoPictureAsset::StereoPictureAsset (boost::filesystem::path directory, boost::filesystem::path mxf_name)
        : PictureAsset (directory, mxf_name)
 {
-       
+
 }
 
 void
@@ -103,7 +103,7 @@ StereoPictureAsset::read ()
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string(), r));
        }
-       
+
        ASDCP::JP2K::PictureDescriptor desc;
        if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) {
                boost::throw_exception (DCPReadError ("could not read video MXF information"));
index 64cdb6b331fd16e31d1bbda7b6d7f3cea7f1cc21..220ad43173e385dfebece55ac8103129b99b6c8f 100644 (file)
 #include "picture_asset.h"
 
 namespace libdcp {
-       
-/** A 3D (stereoscopic) picture asset */       
+
+/** A 3D (stereoscopic) picture asset */
 class StereoPictureAsset : public PictureAsset
 {
 public:
        StereoPictureAsset (boost::filesystem::path directory, boost::filesystem::path mxf_name);
 
        void read ();
-       
+
        /** Start a progressive write to a StereoPictureAsset */
        boost::shared_ptr<PictureAssetWriter> start_write (bool);
 
index b4b0ad524e607a6650440e324bde20c3484bd908..ce8311689e527377d9e21ca9cd144237d65bc0c0 100644 (file)
@@ -107,7 +107,7 @@ void
 StereoPictureAssetWriter::finalize ()
 {
        assert (!_finalized);
-       
+
        Kumu::Result_t r = _state->mxf_writer.Finalize();
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (MXFFileError ("error in finalizing video MXF", _asset->path().string(), r));
index 771524c44106ae276779b2865f03520299914c70..33ab8e91683c699169ad508e3c71043a43d3eaae 100644 (file)
@@ -52,7 +52,7 @@ private:
        /* do this with an opaque pointer so we don't have to include
           ASDCP headers
        */
-          
+
        struct ASDCPState;
        boost::shared_ptr<ASDCPState> _state;
 
index dce1f106dc57e8cce6584cc94cac8bd566bd62c1..c362d743b0d4b1a742e3a8e9b4e39058a8615610 100644 (file)
@@ -83,7 +83,7 @@ StereoPictureFrame::argb_frame (Eye eye, int reduce, float srgb_gamma) const
                xyz_frame = decompress_j2k (const_cast<uint8_t*> (_buffer->Right.RoData()), _buffer->Right.Size(), reduce);
                break;
        }
-       
+
        return xyz_to_rgb (xyz_frame, GammaLUT::cache.get (12, DCI_GAMMA), GammaLUT::cache.get (12, 1 / srgb_gamma));
 }
 
index 878f6ab4c40e21858357cadf1a13f10e3ff06502..772e130ef6430fc3ee936dc3f1f6d9737e2ebcc5 100644 (file)
@@ -33,7 +33,7 @@ namespace libdcp {
 
 class ARGBFrame;
 
-/** A single frame of a 3D (stereoscopic) picture asset */     
+/** A single frame of a 3D (stereoscopic) picture asset */
 class StereoPictureFrame
 {
 public:
index 0e76a62d734ee1a044e9376414021c0c33cd7013..8e741a4e6b90592cf8c122dbb8d501dc922cc184 100644 (file)
@@ -102,14 +102,14 @@ SubtitleAsset::read_xml (string xml_file)
                shared_ptr<cxml::Document> xml (new cxml::Document ("SubtitleReel"));
                xml->read_file (xml_file);
                read_xml (xml, true);
-       }               
+       }
 }
 
 void
 SubtitleAsset::read_xml (shared_ptr<cxml::Document> xml, bool smpte)
 {
        /* XXX: hacks aplenty in here; need separate parsers for DCSubtitle (Interop) and SubtitleReel (SMPTE) */
-       
+
        /* DCSubtitle */
        optional<string> x = xml->optional_string_child ("SubtitleID");
        if (!x) {
@@ -175,14 +175,14 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState& parse_state)
        if (empty_or_white_space (text)) {
                return;
        }
-       
+
        if (parse_state.text_nodes.empty() || parse_state.subtitle_nodes.empty ()) {
                return;
        }
 
        assert (!parse_state.text_nodes.empty ());
        assert (!parse_state.subtitle_nodes.empty ());
-       
+
        libdcp::parse::Font effective_font (parse_state.font_nodes);
        libdcp::parse::Text effective_text (*parse_state.text_nodes.back ());
        libdcp::parse::Subtitle effective_subtitle (*parse_state.subtitle_nodes.back ());
@@ -213,10 +213,10 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState& parse_state)
                                effective_subtitle.fade_down_time
                                )
                        );
-               
+
                _subtitles.push_back (parse_state.current);
        }
-       
+
        if (effective_font.italic.get()) {
                parse_state.current->set_text (parse_state.current->text() + "<i>" + text + "</i>");
        } else {
@@ -297,7 +297,7 @@ Subtitle::size_in_pixels (int screen_height) const
           height is 11 inches, so a 72pt font would be 1/11th of the screen
           height.
        */
-       
+
        return _size * screen_height / (11 * 72);
 }
 
@@ -334,7 +334,7 @@ libdcp::operator<< (ostream& s, Subtitle const & sub)
        } else {
                s << "non-italic";
        }
-       
+
        s << ", size " << sub.size() << ", color " << sub.color()
          << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ", halign " << ((int) sub.h_align()) << "; "
          << "effect " << ((int) sub.effect()) << ", effect color " << sub.effect_color();
@@ -487,7 +487,7 @@ SubtitleAsset::xml_as_string () const
                }
 
                xmlpp::Element* text = subtitle->add_child ("Text");
-               text->set_attribute ("VAlign", valign_to_string ((*i)->v_align()));             
+               text->set_attribute ("VAlign", valign_to_string ((*i)->v_align()));
                text->set_attribute ("HAlign", halign_to_string ((*i)->h_align()));
                text->set_attribute ("VPosition", raw_convert<string> ((*i)->v_position()));
                text->add_child_text ((*i)->text());
index 335b9f37b0af22c3456b12b003348339d34e2d1a..e4381b31adbf1cc7205a9e6d4bd758b9ebcf5ad0 100644 (file)
@@ -114,7 +114,7 @@ public:
        int size () const {
                return _size;
        }
-       
+
        int size_in_pixels (int screen_height) const;
 
 private:
@@ -123,7 +123,7 @@ private:
        Color _color;
        /** Size in points as if the screen height is 11 inches, so a 72pt font
         *  would be 1/11th of the screen height.
-        */ 
+        */
        int _size;
        Time _in;
        Time _out;
index 920cc5e9866f4b46bc2d92815639bddbbed42750..728dd79a5ef509a1a22b810f28a289c52fcd6084 100644 (file)
@@ -180,7 +180,7 @@ libdcp::string_to_valign (string s)
        } else if (s == "bottom") {
                return VERTICAL_BOTTOM;
        }
-       
+
        boost::throw_exception (DCPReadError ("unknown subtitle valign type"));
 }
 
@@ -209,6 +209,6 @@ libdcp::string_to_halign (string s)
        } else if (s == "right") {
                return HORIZONTAL_RIGHT;
        }
-       
+
        boost::throw_exception (DCPReadError ("unknown subtitle halign type"));
 }
index 36dcc3fe51c4f094bd8b72eaeb3fe753d0bd590d..841d484f39eae9ce6566e00542867aef7f237056 100644 (file)
@@ -99,7 +99,7 @@ enum Eye
        EYE_LEFT,
        EYE_RIGHT
 };
-       
+
 class Fraction
 {
 public:
@@ -113,9 +113,9 @@ public:
 
 extern bool operator== (Fraction const & a, Fraction const & b);
 extern bool operator!= (Fraction const & a, Fraction const & b);
-       
+
 struct EqualityOptions {
-       EqualityOptions () 
+       EqualityOptions ()
                : max_mean_pixel_error (0)
                , max_std_dev_pixel_error (0)
                , max_audio_sample_error (0)
@@ -130,7 +130,7 @@ struct EqualityOptions {
        bool mxf_names_can_differ;
 };
 
-/* Win32 defines this */       
+/* Win32 defines this */
 #undef ERROR
 
 enum NoteType {
index 4ac3685c4cd9ab9c5087ce20ac5c45d6cc85d89c..f32cd36c47e362fa13a9e73e1abb113503ff4c46 100644 (file)
@@ -87,7 +87,7 @@ libdcp::make_digest (string filename, boost::function<void (float)>* progress)
        if (ASDCP_FAILURE (r)) {
                boost::throw_exception (FileError ("could not open file to compute digest", filename, r));
        }
-       
+
        SHA_CTX sha;
        SHA1_Init (&sha);
 
@@ -99,13 +99,13 @@ libdcp::make_digest (string filename, boost::function<void (float)>* progress)
        while (1) {
                ui32_t read = 0;
                Kumu::Result_t r = reader.Read (read_buffer.Data(), read_buffer.Capacity(), &read);
-               
+
                if (r == Kumu::RESULT_ENDOFFILE) {
                        break;
                } else if (ASDCP_FAILURE (r)) {
                        boost::throw_exception (FileError ("could not read file to compute digest", filename, r));
                }
-               
+
                SHA1_Update (&sha, read_buffer.Data(), read);
 
                if (progress) {
@@ -164,7 +164,7 @@ libdcp::ContentKind
 libdcp::content_kind_from_string (string type)
 {
        transform (type.begin(), type.end(), type.begin(), ::tolower);
-       
+
        if (type == "feature") {
                return FEATURE;
        } else if (type == "short") {
@@ -249,7 +249,7 @@ libdcp::init ()
        if (xmlSecCryptoDLLoadLibrary(BAD_CAST XMLSEC_CRYPTO) < 0) {
                throw MiscError ("unable to load default xmlsec-crypto library");
        }
-#endif 
+#endif
 
        if (xmlSecCryptoAppInit(0) < 0) {
                throw MiscError ("could not initialise crypto");
@@ -289,7 +289,7 @@ libdcp::base64_decode (string const & in, unsigned char* out, int out_length)
                        *p++ = in[i];
                }
        }
-               
+
        BIO* bmem = BIO_new_mem_buf (in_buffer, p - in_buffer);
        bmem = BIO_push (b64, bmem);
        int const N = BIO_read (bmem, out, out_length);
index 94ee136a2aac206b3700c36944d39d6fb65cf872..ba4e1046a6c328fb4055f4a7e9a4e050422434a6 100644 (file)
@@ -58,11 +58,11 @@ struct Size {
        float ratio () const {
                return float (width) / height;
        }
-       
+
        int width;
        int height;
 };
-       
+
 extern bool operator== (Size const & a, Size const & b);
 extern bool operator!= (Size const & a, Size const & b);
 
@@ -85,7 +85,7 @@ extern std::string tm_to_string (struct tm *);
 extern std::string utc_offset_to_string (boost::posix_time::time_duration);
 extern std::string ptime_to_string (boost::posix_time::ptime);
 extern FILE * fopen_boost (boost::filesystem::path, std::string);
-       
+
 }
 
 #endif
index 52abd13a746e3864daa886ba1d1101ac6c3d4092..83e0d93f8b1703c25fbb595c920423609f0d4dc3 100644 (file)
@@ -4,5 +4,5 @@ namespace libdcp {
 extern char const * version;
 extern char const * git_commit;
 extern bool built_with_debug;
-       
+
 }
index 5978ff7ec10d7346a941d5ebbb71297c3fc5b33c..12062f96a7bbef803a8a40f322207876cb665f2b 100644 (file)
--- a/src/xml.h
+++ b/src/xml.h
@@ -44,7 +44,7 @@ template <class T>
 boost::shared_ptr<T> type_child (boost::shared_ptr<const cxml::Node> node, std::string name) {
        return boost::shared_ptr<T> (new T (node->node_child (name)));
 }
-       
+
 template <class T>
 boost::shared_ptr<T>
 optional_type_child (boost::shared_ptr<const cxml::Node> node, std::string name)
@@ -70,7 +70,7 @@ type_children (boost::shared_ptr<const cxml::Node> node, std::string name)
 {
        return type_children<T> (*node.get(), name);
 }
-       
+
 template <class T>
 std::list<boost::shared_ptr<T> >
 type_grand_children (cxml::Node const & node, std::string name, std::string sub)
@@ -85,7 +85,7 @@ type_grand_children (boost::shared_ptr<const cxml::Node> node, std::string name,
 {
        return type_grand_children<T> (*node.get(), name, sub);
 }
-       
+
 }
 
 #endif
index f5b0ee86cfb1113ba574b92297e88493736f8ec1..0d21ec8f36273946df05976c755c015d83f1a3d1 100644 (file)
@@ -33,7 +33,7 @@ XYZFrame::XYZFrame (opj_image_t* image)
 XYZFrame::XYZFrame (Size size)
 {
        opj_image_cmptparm_t cmptparm[3];
-       
+
        for (int i = 0; i < 3; ++i) {
                cmptparm[i].dx = 1;
                cmptparm[i].dy = 1;
index 0a66bc66fc26d6c91b50b7eea850a1de0e5915fa..0dfcdfa3e443216b5650ee9a127b4554c13ab2c3 100644 (file)
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE (certificates)
 
        /* Leaf */
        BOOST_CHECK_EQUAL (*i, c.leaf ());
-       
+
        BOOST_CHECK_EQUAL (
                c.leaf()->issuer(),
                "dnQualifier=bmtwThq3srgxIAeRMjX6BFhgLDw=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org"
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (certificates)
                c.leaf()->subject(),
                "dnQualifier=d95fGDzERNdxfYPgphvAR8A18L4=,CN=CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION,OU=example.org,O=example.org"
                );
-       
+
        ++i;
 
        /* Intermediate */
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE (certificates)
                (*i)->subject(),
                "dnQualifier=bmtwThq3srgxIAeRMjX6BFhgLDw=,CN=.smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION,OU=example.org,O=example.org"
                );
-       
+
        ++i;
 
        /* Root */
index a878e6b45d896da130568c2a0d566d9bcca779cf..a545a5bc2b9254e9ea691b54c2a44f637829e778 100644 (file)
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE (cpl_sar)
                xmlpp::Document doc;
                xmlpp::Element* el = doc.create_root_node ("Test");
                mp->write_to_cpl (el);
-               
+
                cxml::Node node (el);
                BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), "1.85");
        }
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (cpl_sar)
                xmlpp::Document doc;
                xmlpp::Element* el = doc.create_root_node ("Test");
                mp->write_to_cpl (el);
-               
+
                cxml::Node node (el);
                BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), "2.39");
        }
index d0c8b973e91264d70c0db47e29f3565050d539a3..a16695c853d8bfacf18e375fafa27c052143725c 100644 (file)
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (dcp_test)
        ms->set_channels (2);
        ms->set_metadata (mxf_meta);
        ms->create (wav);
-       
+
        cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ())));
        d.add_cpl (cpl);
 
index 5980952b357d9414695251ee02912add14f733d3..4a26e8df4bd6b47491190059ef0a3935677ea410 100644 (file)
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (encryption)
        boost::filesystem::remove_all ("build/test/signer");
        boost::filesystem::create_directory ("build/test/signer");
        libdcp::make_signer_chain ("build/test/signer", "openssl");
-       
+
        Kumu::libdcp_test = true;
 
        libdcp::MXFMetadata mxf_metadata;
@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE (encryption)
        xml_metadata.issuer = "OpenDCP 0.0.25";
        xml_metadata.creator = "OpenDCP 0.0.25";
        xml_metadata.issue_date = "2012-07-17T04:45:18+00:00";
-       
+
        boost::filesystem::remove_all ("build/test/DCP/bar");
        boost::filesystem::create_directories ("build/test/DCP/bar");
        libdcp::DCP d ("build/test/DCP/bar");
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE (encryption)
        shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/DCP/bar", "A Test DCP", libdcp::FEATURE, 24, 24));
 
        libdcp::Key key;
-       
+
        shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/DCP/bar", "video.mxf"));
        mp->set_progress (&d.Progress);
        mp->set_edit_rate (24);
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE (encryption)
        ms->set_metadata (mxf_metadata);
        ms->set_key (key);
        ms->create (wav);
-       
+
        cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ())));
        d.add_cpl (cpl);
 
@@ -115,18 +115,18 @@ BOOST_AUTO_TEST_CASE (encryption)
                );
 
        kdm.as_xml ("build/test/bar.kdm.xml");
-       
+
        int r = system (
                "xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/bar.kdm.xml "
                "> build/test/xmllint.log 2>&1 < /dev/null"
                );
 
-#ifdef DCPOMATIC_POSIX 
+#ifdef DCPOMATIC_POSIX
        BOOST_CHECK_EQUAL (WEXITSTATUS (r), 0);
 #else
        BOOST_CHECK_EQUAL (r, 0);
-#endif 
-               
+#endif
+
        r = system ("xmlsec1 verify "
                "--pubkey-cert-pem test/ref/crypt/leaf.signed.pem "
                "--trusted-pem test/ref/crypt/intermediate.signed.pem "
@@ -134,10 +134,10 @@ BOOST_AUTO_TEST_CASE (encryption)
                "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPublic "
                "--id-attr:Id http://www.smpte-ra.org/schemas/430-3/2006/ETM:AuthenticatedPrivate "
                    "build/test/bar.kdm.xml > build/test/xmlsec1.log 2>&1 < /dev/null");
-       
-#ifdef DCPOMATIC_POSIX 
+
+#ifdef DCPOMATIC_POSIX
        BOOST_CHECK_EQUAL (WEXITSTATUS (r), 0);
 #else
        BOOST_CHECK_EQUAL (r, 0);
-#endif 
+#endif
 }
index eeff4f419d15aafefd84edcc25352a62aee7646a..854cf305d9b0bbd304a29c4c847047a33fa02bf2 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (error_test)
        /* Trying to create video/audio MXFs using a non-existant file should throw an exception */
        libdcp::MonoPictureAsset pa ("build/test/fred", "video.mxf");
        BOOST_CHECK_THROW (pa.create (p), libdcp::FileError);
-       
+
        libdcp::SoundAsset sa ("build/test/fred", "audio.mxf");
        sa.set_channels (1);
        BOOST_CHECK_THROW (sa.create (p), libdcp::FileError);
index 0f0db031f81383a1d1125db4783255a73f7120d8..4e110fc72e7de3f6499f8b3e321b4a0275340dcb 100644 (file)
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE (kdm_test)
                );
 
        list<libdcp::KDMKey> keys = kdm.keys ();
-       
+
        BOOST_CHECK_EQUAL (keys.size(), 2);
 
        BOOST_CHECK_EQUAL (keys.front().cpl_id(), "eece17de-77e8-4a55-9347-b6bab5724b9f");
@@ -61,9 +61,9 @@ BOOST_AUTO_TEST_CASE (kdm_passthrough_test)
                "xmldiff -c test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml build/kdm.xml"
                );
 
-#ifdef LIBDCP_WINDOWS  
+#ifdef LIBDCP_WINDOWS
        BOOST_CHECK_EQUAL (r, 0);
-#else  
+#else
        BOOST_CHECK_EQUAL (WEXITSTATUS (r), 0);
-#endif 
+#endif
 }
index 42697c37b5806ed2fa304fe164fd305ad2258ba2..1a2dbfa6de59a9232de4dc6351d15b412b9ff90d 100644 (file)
@@ -44,8 +44,8 @@ BOOST_AUTO_TEST_CASE (recovery)
 #ifdef LIBDCP_POSIX
        /* XXX: fix this posix-only stuff */
        Kumu::ResetTestRNG ();
-#endif 
-       
+#endif
+
        boost::filesystem::remove_all ("build/test/baz");
        boost::filesystem::create_directories ("build/test/baz");
        shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/baz", "video1.mxf"));
@@ -74,9 +74,9 @@ BOOST_AUTO_TEST_CASE (recovery)
                fclose (f);
        }
 
-#ifdef LIBDCP_POSIX    
+#ifdef LIBDCP_POSIX
        Kumu::ResetTestRNG ();
-#endif 
+#endif
 
        mp.reset (new libdcp::MonoPictureAsset ("build/test/baz", "video2.mxf"));
        mp->set_edit_rate (24);
@@ -92,6 +92,6 @@ BOOST_AUTO_TEST_CASE (recovery)
        for (int i = 4; i < 24; ++i) {
                writer->write (data, size);
        }
-       
+
        writer->finalize ();
 }
index 3a982d1b6d8472651cb34d9834e5c407c76c1435..eb4cad9f2f4b5c2d593f213da506a18c00caa21b 100644 (file)
@@ -19,16 +19,16 @@ main (int argc, char* argv[])
                        cerr << "Syntax: " << argv[0] << " <dcp>\n";
                        exit (EXIT_FAILURE);
                }
-               
+
                DCP* dcp = new DCP (argv[1]);
                dcp->read (false);
-               
+
                list<shared_ptr<CPL> > cpls = dcp->cpls ();
                for (list<boost::shared_ptr<CPL> >::iterator i = cpls.begin(); i != cpls.end(); ++i) {
-                       
+
                        list<shared_ptr<Reel> > reels = (*i)->reels ();
                        for (list<shared_ptr<Reel> >::iterator j = reels.begin(); j != reels.end(); ++j) {
-                               
+
                                if ((*j)->main_subtitle()) {
                                        (*j)->main_subtitle()->write_xml ();
                                }
@@ -46,6 +46,6 @@ main (int argc, char* argv[])
                cerr << e.what() << " when reading " << argv[1] << "\n";
                exit (EXIT_FAILURE);
        }
-       
+
        return 0;
 }
index f5a5054d2dcfa7188856c33a791accbc35d58175..c404dd7def1da3d15ae9bbd79411c0269bff82f5 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (round_trip_test)
        boost::filesystem::remove_all ("build/test/signer");
        boost::filesystem::create_directory ("build/test/signer");
        libdcp::make_signer_chain ("build/test/signer", "openssl");
-       
+
        libdcp::CertificateChain chain;
        chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem"))));
        chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem"))));
index f0a7e96f1039d7c6ba7817203edccc008ef961d9..76251137f98f44fa241b8f9e670e07078d63702c 100644 (file)
@@ -9,7 +9,7 @@ int main (int argc, char* argv[])
                cerr << "Syntax: " << argv[0] << " <subtitle file>\n";
                exit (EXIT_FAILURE);
        }
-       
+
        libdcp::SubtitleAsset s ("foo", "bar", "baz");
        s.read_xml (argv[1]);
        cout << s.xml_as_string ();
index 1f53b02e36f7abe70e2a7bebc5d0b7797ee5df29..ebf0ada5a7cc6e964616aa147734408e90ddf7e2 100644 (file)
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (subtitles1)
                                   libdcp::Time (0, 0, 0, 1, 250),
                                   libdcp::Time (0, 0, 0, 1, 250)
                                   ));
-                                                        
+
        s = subs.subtitles_during (libdcp::Time (0, 0, 7, 190, 250), libdcp::Time (0, 0, 7, 191, 250));
        BOOST_CHECK_EQUAL (s.size(), 2);
        BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle (
index f7114e90752d59a1257f58e45ade2825e2e47b7f..6cc5a12bb4d8565ae38d92e09493aaf2ff097e10 100644 (file)
@@ -27,7 +27,7 @@ using std::string;
 BOOST_AUTO_TEST_CASE (base64_decode_test)
 {
        int const N = 256;
-       
+
        ifstream f ("test/data/base64_test");
        BOOST_CHECK (f.good ());
        string s;