From: Carl Hetherington Date: Thu, 25 Jun 2015 15:22:08 +0000 (+0100) Subject: No-op: whitespace. X-Git-Tag: v0.102.0~2 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=e520f1009eaa552c7b3931ced85c0f19d8aff554;p=libdcp.git No-op: whitespace. --- diff --git a/src/asset.cc b/src/asset.cc index 00ad67bc..be0792c1 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -115,7 +115,7 @@ Asset::equals (shared_ptr other, EqualityOptions, boost::function_intrinsic_duration) { note (ERROR, "asset intrinsic durations differ"); } diff --git a/src/asset.h b/src/asset.h index 6db8e5c2..64c46c4f 100644 --- a/src/asset.h +++ b/src/asset.h @@ -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 <Type> 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; }; diff --git a/src/certificates.cc b/src/certificates.cc index 8682b831..1a30fd7f 100644 --- a/src/certificates.cc +++ b/src/certificates.cc @@ -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); diff --git a/src/certificates.h b/src/certificates.h index 2bf8d0db..7a90a867 100644 --- a/src/certificates.h +++ b/src/certificates.h @@ -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); diff --git a/src/colour_matrix.h b/src/colour_matrix.h index a42c8dff..532ce7c9 100644 --- a/src/colour_matrix.h +++ b/src/colour_matrix.h @@ -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]; -} +} } diff --git a/src/cpl.cc b/src/cpl.cc index 67376377..fe67facc 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -73,9 +73,9 @@ CPL::CPL (boost::filesystem::path directory, string file, list 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 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 ass throw; } } - + } else { try { pair > asset = asset_from_id (asset_maps, p->id); @@ -140,20 +140,20 @@ CPL::CPL (boost::filesystem::path directory, string file, list 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 > 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 s = (*i)->asset_list->main_sound; @@ -172,7 +172,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list ass } if ((*i)->asset_list->main_subtitle) { - + pair > 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 ass subtitle->set_edit_rate (_fps); subtitle->set_duration ((*i)->asset_list->main_subtitle->duration); } - + _reels.push_back (shared_ptr (new Reel (picture, sound, subtitle))); } } @@ -214,7 +214,7 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptrset_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_ptradd_child("RatingList"); xmlpp::Element* reel_list = root->add_child ("ReelList"); - + for (list >::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 (_length)); } - - - + + + bool CPL::equals (CPL const & other, EqualityOptions opt, boost::function note) const { @@ -323,10 +323,10 @@ CPL::equals (CPL const & other, EqualityOptions opt, boost::function >::const_iterator a = _reels.begin (); list >::const_iterator b = other._reels.begin (); - + while (a != _reels.end ()) { if (!(*a)->equals (*b, opt, note)) { return false; diff --git a/src/cpl.h b/src/cpl.h index 0c213f8a..e80ea99a 100644 --- 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 asset_maps, bool require_mxfs = true); void add_reel (boost::shared_ptr 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 note) const; - + void write_xml (bool, XMLMetadata const &, boost::shared_ptr) const; void write_to_assetmap (xmlpp::Node *) const; void write_to_pkl (xmlpp::Node *, bool) const; void add_kdm (KDM const &); - + private: std::pair > asset_from_id (std::list, std::string id) const; - + boost::filesystem::path _directory; /** the name of the DCP */ std::string _name; diff --git a/src/dcp.cc b/src/dcp.cc index 87a9565b..a182498d 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -71,7 +71,7 @@ DCP::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr 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 >::const_iterator i = a.begin(); i != a.end(); ++i) { (*i)->write_to_pkl (asset_list, interop); } - + for (list >::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 (pkl_length)); - + for (list >::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 keys = kdm.keys (); - + for (list >::iterator i = _cpls.begin(); i != _cpls.end(); ++i) { for (list::iterator j = keys.begin(); j != keys.end(); ++j) { if (j->cpl_id() == (*i)->id()) { (*i)->add_kdm (kdm); - } + } } } } diff --git a/src/dcp.h b/src/dcp.h index 45ccce88..edc1fc55 100644 --- 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; - + /** Write the VOLINDEX file */ void write_volindex (bool) const; diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 47c15a2f..ea49f9ca 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -73,7 +73,7 @@ Time::Time (string time, int tcr_) if (b.size() != 4) { boost::throw_exception (DCPReadError ("unrecognised time specification")); } - + h = raw_convert (b[0]); m = raw_convert (b[1]); s = raw_convert (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; diff --git a/src/dcp_time.h b/src/dcp_time.h index 23f99b80..b3c0590a 100644 --- a/src/dcp_time.h +++ b/src/dcp_time.h @@ -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); diff --git a/src/exceptions.h b/src/exceptions.h index dfbea60b..fd1dd6a6 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -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 diff --git a/src/image.h b/src/image.h index 8b7fee09..0586976a 100644 --- a/src/image.h +++ b/src/image.h @@ -28,7 +28,7 @@ public: Image (Size); Image (Image const &); Image (boost::shared_ptr); - + virtual ~Image () {} virtual uint8_t** data () const = 0; virtual int* stride () const = 0; @@ -39,7 +39,7 @@ public: protected: void swap (Image &); - + Size _size; }; diff --git a/src/kdm.cc b/src/kdm.cc index 787d7adf..aacd2599 100644 --- a/src/kdm.cc +++ b/src/kdm.cc @@ -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 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 (**p); (*p)++; diff --git a/src/kdm.h b/src/kdm.h index 443712c4..e6e6bce2 100644 --- 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 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. diff --git a/src/key.cc b/src/key.cc index 8cac04a3..5e8211f4 100644 --- a/src/key.cc +++ b/src/key.cc @@ -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 (_value[i]); } diff --git a/src/lut.h b/src/lut.h index ad291467..965b4096 100644 --- a/src/lut.h +++ b/src/lut.h @@ -39,7 +39,7 @@ public: virtual ~LUT() { delete[] _lut; } - + float const * lut() const { return _lut; } diff --git a/src/metadata.h b/src/metadata.h index b4c0896d..50b4040b 100644 --- a/src/metadata.h +++ b/src/metadata.h @@ -47,7 +47,7 @@ public: XMLMetadata (); void set_issue_date_now (); - + std::string issuer; std::string creator; std::string issue_date; diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc index f70db2b4..dd870be3 100644 --- a/src/mono_picture_asset.cc +++ b/src/mono_picture_asset.cc @@ -52,14 +52,14 @@ MonoPictureAsset::create (boost::function 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 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 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 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 other, EqualityOptions opt, bo if (i >= other_picture->intrinsic_duration()) { return false; } - + note (PROGRESS, "Comparing video frame " + lexical_cast (i) + " of " + lexical_cast (_intrinsic_duration)); shared_ptr frame_A = get_frame (i); shared_ptr frame_B = other_picture->get_frame (i); - + if (!frame_buffer_equals ( i, opt, note, frame_A->j2k_data(), frame_A->j2k_size(), diff --git a/src/mono_picture_asset.h b/src/mono_picture_asset.h index ae2df4d2..37cd925e 100644 --- a/src/mono_picture_asset.h +++ b/src/mono_picture_asset.h @@ -59,6 +59,6 @@ private: int edit_rate_factor () const; }; -} +} #endif diff --git a/src/mono_picture_asset_writer.cc b/src/mono_picture_asset_writer.cc index ebf3ec00..f91e5e54 100644 --- a/src/mono_picture_asset_writer.cc +++ b/src/mono_picture_asset_writer.cc @@ -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)); diff --git a/src/mono_picture_asset_writer.h b/src/mono_picture_asset_writer.h index e3922623..ae93589c 100644 --- a/src/mono_picture_asset_writer.h +++ b/src/mono_picture_asset_writer.h @@ -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 _state; }; diff --git a/src/mono_picture_frame.h b/src/mono_picture_frame.h index 0eedfb95..623b2904 100644 --- a/src/mono_picture_frame.h +++ b/src/mono_picture_frame.h @@ -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: diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index 28ac1933..e59f4f78 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -89,20 +89,20 @@ MXFAsset::equals (shared_ptr other, EqualityOptions opt, boost::fun if (!Asset::equals (other, opt, note)) { return false; } - + shared_ptr other_mxf = dynamic_pointer_cast (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"); diff --git a/src/mxf_asset.h b/src/mxf_asset.h index 4eafdcba..a15ec942 100644 --- a/src/mxf_asset.h +++ b/src/mxf_asset.h @@ -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 other, EqualityOptions opt, boost::function 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 () const { @@ -112,7 +112,7 @@ protected: virtual std::pair cpl_node_attribute () const { return std::make_pair ("", ""); } - + /** Signal to emit to report progress, or 0 */ boost::signals2::signal* _progress; ASDCP::AESEncContext* _encryption_context; diff --git a/src/picture_asset.cc b/src/picture_asset.cc index 8d3b0347..045ab51a 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -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 image_A = decompress_j2k (const_cast (data_A), size_A, 0); shared_ptr image_B = decompress_j2k (const_cast (data_B), size_B, 0); - + /* Compare them */ - + vector 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(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::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::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 (mean) + ", deviation " + lexical_cast (std_dev)); - + if (mean > opt.max_mean_pixel_error) { note ( ERROR, @@ -184,7 +184,7 @@ PictureAsset::frame_buffer_equals ( " out of range " + lexical_cast(opt.max_mean_pixel_error) + " in frame " + lexical_cast(frame) ); - + return false; } @@ -195,7 +195,7 @@ PictureAsset::frame_buffer_equals ( " out of range " + lexical_cast(opt.max_std_dev_pixel_error) + " in frame " + lexical_cast(frame) ); - + return false; } diff --git a/src/picture_asset.h b/src/picture_asset.h index b404abd2..a56ef5e1 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -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 const &) {} virtual void create (boost::function) {} - + Size size () const { return _size; } @@ -100,7 +100,7 @@ private: std::string key_type () const; virtual int edit_rate_factor () const = 0; }; - + } diff --git a/src/picture_asset_writer.h b/src/picture_asset_writer.h index d30d9a85..53287613 100644 --- a/src/picture_asset_writer.h +++ b/src/picture_asset_writer.h @@ -30,16 +30,16 @@ 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 friend void start (PictureAssetWriter *, boost::shared_ptr

, 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). diff --git a/src/picture_asset_writer_common.cc b/src/picture_asset_writer_common.cc index 52848745..d8383e0f 100644 --- a/src/picture_asset_writer_common.cc +++ b/src/picture_asset_writer_common.cc @@ -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

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, diff --git a/src/reel.cc b/src/reel.cc index ff51c025..826fc31f 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -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 (_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 other, EqualityOptions opt, boost::function note) const { @@ -67,7 +67,7 @@ Reel::equals (boost::shared_ptr 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 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 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 keys = kdm.keys (); - + for (list::iterator i = keys.begin(); i != keys.end(); ++i) { if (i->key_id() == _main_picture->key_id()) { _main_picture->set_key (i->key ()); diff --git a/src/reel.h b/src/reel.h index 35302f17..2e1e457f 100644 --- a/src/reel.h +++ b/src/reel.h @@ -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 main_picture () const { return _main_picture; } @@ -59,7 +59,7 @@ public: boost::shared_ptr main_sound () const { return _main_sound; } - + boost::shared_ptr 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 other, EqualityOptions opt, boost::function notes) const; void add_kdm (KDM const &); diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc index bd01b800..509e320a 100644 --- a/src/rgb_xyz.cc +++ b/src/rgb_xyz.cc @@ -43,11 +43,11 @@ libdcp::xyz_to_rgb (shared_ptr xyz_frame, shared_ptr 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 xyz_frame, shared_ptr shared_ptr 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 xyz_frame, shared_ptr 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 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 xyz_16) ++jn; } } - + return xyz_12; } diff --git a/src/rgb_xyz.h b/src/rgb_xyz.h index 690ba08e..23b13131 100644 --- a/src/rgb_xyz.h +++ b/src/rgb_xyz.h @@ -21,11 +21,11 @@ namespace libdcp { -class ARGBFrame; +class ARGBFrame; class XYZFrame; class LUT; class Image; - + extern boost::shared_ptr xyz_to_rgb ( boost::shared_ptr, boost::shared_ptr, boost::shared_ptr ); @@ -36,5 +36,5 @@ extern boost::shared_ptr rgb_to_xyz ( ); extern boost::shared_ptr xyz_to_xyz (boost::shared_ptr); - + } diff --git a/src/signer.cc b/src/signer.cc index a6978885..c7dfdd06 100644 --- a/src/signer.cc +++ b/src/signer.cc @@ -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 > c = _certificates.leaf_to_root (); for (list >::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()); } } diff --git a/src/signer.h b/src/signer.h index efb8099b..3374e961 100644 --- a/src/signer.h +++ b/src/signer.h @@ -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; diff --git a/src/signer_chain.cc b/src/signer_chain.cc index f35e4ff6..a2443888 100644 --- a/src/signer_chain.cc +++ b/src/signer_chain.cc @@ -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" diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 179f6cd5..6539c0ad 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -100,7 +100,7 @@ SoundAsset::create (boost::function 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 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 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 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 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 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(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")); } diff --git a/src/sound_asset.h b/src/sound_asset.h index c52a5436..e9fba11d 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -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 _state; @@ -91,7 +91,7 @@ public: void create (boost::function get_path); boost::shared_ptr start_write (); - + bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; boost::shared_ptr 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 get_path); diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc index 85921f9c..5da11025 100644 --- a/src/stereo_picture_asset.cc +++ b/src/stereo_picture_asset.cc @@ -42,13 +42,13 @@ StereoPictureAsset::equals (shared_ptr 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 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 other_picture = dynamic_pointer_cast (other); assert (other_picture); for (int i = 0; i < _intrinsic_duration; ++i) { shared_ptr frame_A = get_frame (i); shared_ptr 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 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 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")); diff --git a/src/stereo_picture_asset.h b/src/stereo_picture_asset.h index 64cdb6b3..220ad431 100644 --- a/src/stereo_picture_asset.h +++ b/src/stereo_picture_asset.h @@ -23,15 +23,15 @@ #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 start_write (bool); diff --git a/src/stereo_picture_asset_writer.cc b/src/stereo_picture_asset_writer.cc index b4b0ad52..ce831168 100644 --- a/src/stereo_picture_asset_writer.cc +++ b/src/stereo_picture_asset_writer.cc @@ -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)); diff --git a/src/stereo_picture_asset_writer.h b/src/stereo_picture_asset_writer.h index 771524c4..33ab8e91 100644 --- a/src/stereo_picture_asset_writer.h +++ b/src/stereo_picture_asset_writer.h @@ -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 _state; diff --git a/src/stereo_picture_frame.cc b/src/stereo_picture_frame.cc index dce1f106..c362d743 100644 --- a/src/stereo_picture_frame.cc +++ b/src/stereo_picture_frame.cc @@ -83,7 +83,7 @@ StereoPictureFrame::argb_frame (Eye eye, int reduce, float srgb_gamma) const xyz_frame = decompress_j2k (const_cast (_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)); } diff --git a/src/stereo_picture_frame.h b/src/stereo_picture_frame.h index 878f6ab4..772e130e 100644 --- a/src/stereo_picture_frame.h +++ b/src/stereo_picture_frame.h @@ -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: diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 0e76a62d..8e741a4e 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -102,14 +102,14 @@ SubtitleAsset::read_xml (string xml_file) shared_ptr xml (new cxml::Document ("SubtitleReel")); xml->read_file (xml_file); read_xml (xml, true); - } + } } void SubtitleAsset::read_xml (shared_ptr xml, bool smpte) { /* XXX: hacks aplenty in here; need separate parsers for DCSubtitle (Interop) and SubtitleReel (SMPTE) */ - + /* DCSubtitle */ optional 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() + "" + text + ""); } 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 ((*i)->v_position())); text->add_child_text ((*i)->text()); diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index 335b9f37..e4381b31 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -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; diff --git a/src/types.cc b/src/types.cc index 920cc5e9..728dd79a 100644 --- a/src/types.cc +++ b/src/types.cc @@ -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")); } diff --git a/src/types.h b/src/types.h index 36dcc3fe..841d484f 100644 --- a/src/types.h +++ b/src/types.h @@ -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 { diff --git a/src/util.cc b/src/util.cc index 4ac3685c..f32cd36c 100644 --- a/src/util.cc +++ b/src/util.cc @@ -87,7 +87,7 @@ libdcp::make_digest (string filename, boost::function* 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* 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); diff --git a/src/util.h b/src/util.h index 94ee136a..ba4e1046 100644 --- a/src/util.h +++ b/src/util.h @@ -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 diff --git a/src/version.h b/src/version.h index 52abd13a..83e0d93f 100644 --- a/src/version.h +++ b/src/version.h @@ -4,5 +4,5 @@ namespace libdcp { extern char const * version; extern char const * git_commit; extern bool built_with_debug; - + } diff --git a/src/xml.h b/src/xml.h index 5978ff7e..12062f96 100644 --- a/src/xml.h +++ b/src/xml.h @@ -44,7 +44,7 @@ template boost::shared_ptr type_child (boost::shared_ptr node, std::string name) { return boost::shared_ptr (new T (node->node_child (name))); } - + template boost::shared_ptr optional_type_child (boost::shared_ptr node, std::string name) @@ -70,7 +70,7 @@ type_children (boost::shared_ptr node, std::string name) { return type_children (*node.get(), name); } - + template std::list > type_grand_children (cxml::Node const & node, std::string name, std::string sub) @@ -85,7 +85,7 @@ type_grand_children (boost::shared_ptr node, std::string name, { return type_grand_children (*node.get(), name, sub); } - + } #endif diff --git a/src/xyz_frame.cc b/src/xyz_frame.cc index f5b0ee86..0d21ec8f 100644 --- a/src/xyz_frame.cc +++ b/src/xyz_frame.cc @@ -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; diff --git a/test/certificates_test.cc b/test/certificates_test.cc index 0a66bc66..0dfcdfa3 100644 --- a/test/certificates_test.cc +++ b/test/certificates_test.cc @@ -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 */ diff --git a/test/cpl_sar.cc b/test/cpl_sar.cc index a878e6b4..a545a5bc 100644 --- a/test/cpl_sar.cc +++ b/test/cpl_sar.cc @@ -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"); } diff --git a/test/dcp_test.cc b/test/dcp_test.cc index d0c8b973..a16695c8 100644 --- a/test/dcp_test.cc +++ b/test/dcp_test.cc @@ -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 (new libdcp::Reel (mp, ms, shared_ptr ()))); d.add_cpl (cpl); diff --git a/test/encryption_test.cc b/test/encryption_test.cc index 5980952b..4a26e8df 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -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 cpl (new libdcp::CPL ("build/test/DCP/bar", "A Test DCP", libdcp::FEATURE, 24, 24)); libdcp::Key key; - + shared_ptr 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 (new libdcp::Reel (mp, ms, shared_ptr ()))); 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 } diff --git a/test/error_test.cc b/test/error_test.cc index eeff4f41..854cf305 100644 --- a/test/error_test.cc +++ b/test/error_test.cc @@ -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); diff --git a/test/kdm_test.cc b/test/kdm_test.cc index 0f0db031..4e110fc7 100644 --- a/test/kdm_test.cc +++ b/test/kdm_test.cc @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE (kdm_test) ); list 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 } diff --git a/test/recovery_test.cc b/test/recovery_test.cc index 42697c37..1a2dbfa6 100644 --- a/test/recovery_test.cc +++ b/test/recovery_test.cc @@ -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 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 (); } diff --git a/test/rewrite_subs.cc b/test/rewrite_subs.cc index 3a982d1b..eb4cad9f 100644 --- a/test/rewrite_subs.cc +++ b/test/rewrite_subs.cc @@ -19,16 +19,16 @@ main (int argc, char* argv[]) cerr << "Syntax: " << argv[0] << " \n"; exit (EXIT_FAILURE); } - + DCP* dcp = new DCP (argv[1]); dcp->read (false); - + list > cpls = dcp->cpls (); for (list >::iterator i = cpls.begin(); i != cpls.end(); ++i) { - + list > reels = (*i)->reels (); for (list >::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; } diff --git a/test/round_trip_test.cc b/test/round_trip_test.cc index f5a5054d..c404dd7d 100644 --- a/test/round_trip_test.cc +++ b/test/round_trip_test.cc @@ -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 (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem")))); chain.add (shared_ptr (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem")))); diff --git a/test/subs_in_out.cc b/test/subs_in_out.cc index f0a7e96f..76251137 100644 --- a/test/subs_in_out.cc +++ b/test/subs_in_out.cc @@ -9,7 +9,7 @@ int main (int argc, char* argv[]) cerr << "Syntax: " << argv[0] << " \n"; exit (EXIT_FAILURE); } - + libdcp::SubtitleAsset s ("foo", "bar", "baz"); s.read_xml (argv[1]); cout << s.xml_as_string (); diff --git a/test/subtitle_tests.cc b/test/subtitle_tests.cc index 1f53b02e..ebf0ada5 100644 --- a/test/subtitle_tests.cc +++ b/test/subtitle_tests.cc @@ -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 ( diff --git a/test/util_test.cc b/test/util_test.cc index f7114e90..6cc5a12b 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -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;