From 9e523d8a4062ad52330dff6c2ba50e54184c9bb2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 24 Jun 2015 01:06:04 +0100 Subject: [PATCH] No-op: whitespace. --- src/asset.cc | 10 ++-- src/asset.h | 2 +- src/asset_writer.cc | 4 +- src/certificate_chain.cc | 12 ++--- src/certificate_chain.h | 2 +- src/certificates.cc | 18 +++---- src/certificates.h | 4 +- src/colour_conversion.cc | 4 +- src/colour_conversion.h | 6 +-- src/colour_matrix.h | 2 +- src/cpl.cc | 12 ++--- src/cpl.h | 8 +-- src/data.h | 6 +-- src/dcp.h | 8 +-- src/dcp_time.cc | 6 +-- src/dcp_time.h | 2 +- src/decrypted_kdm.cc | 16 +++--- src/decrypted_kdm_key.h | 2 +- src/encrypted_kdm.cc | 68 +++++++++++++------------- src/encrypted_kdm.h | 6 +-- src/exceptions.cc | 2 +- src/exceptions.h | 6 +-- src/font_asset.h | 2 +- src/font_node.cc | 4 +- src/font_node.h | 4 +- src/interop_load_font_node.cc | 2 +- src/interop_load_font_node.h | 2 +- src/interop_subtitle_asset.cc | 6 +-- src/interop_subtitle_asset.h | 4 +- src/key.cc | 4 +- src/load_font_node.h | 2 +- src/local_time.cc | 2 +- src/local_time.h | 2 +- src/metadata.h | 2 +- src/modified_gamma_transfer_function.h | 4 +- src/mono_picture_asset.cc | 16 +++--- src/mono_picture_asset.h | 6 +-- src/mono_picture_asset_writer.h | 2 +- src/mxf.cc | 4 +- src/mxf.h | 4 +- src/object.h | 4 +- src/openjpeg_image.cc | 2 +- src/picture_asset.cc | 32 ++++++------ src/picture_asset.h | 4 +- src/picture_asset_writer.h | 4 +- src/picture_asset_writer_common.cc | 8 +-- src/reel.cc | 16 +++--- src/reel.h | 8 +-- src/reel_asset.h | 2 +- src/reel_mono_picture_asset.h | 2 +- src/reel_mxf.h | 2 +- src/reel_picture_asset.cc | 6 +-- src/reel_picture_asset.h | 2 +- src/reel_sound_asset.h | 2 +- src/reel_stereo_picture_asset.h | 2 +- src/reel_subtitle_asset.h | 2 +- src/ref.h | 4 +- src/rgb_xyz.cc | 34 ++++++------- src/rgb_xyz.h | 12 ++--- src/signer.cc | 18 +++---- src/signer.h | 10 ++-- src/smpte_load_font_node.cc | 2 +- src/smpte_load_font_node.h | 4 +- src/smpte_subtitle_asset.cc | 30 ++++++------ src/smpte_subtitle_asset.h | 12 ++--- src/sound_asset.cc | 14 +++--- src/sound_asset.h | 6 +-- src/sound_asset_writer.cc | 10 ++-- src/sound_asset_writer.h | 2 +- src/stereo_picture_asset.cc | 14 +++--- src/stereo_picture_asset.h | 6 +-- src/stereo_picture_asset_writer.cc | 2 +- src/stereo_picture_asset_writer.h | 2 +- src/stereo_picture_frame.cc | 2 +- src/stereo_picture_frame.h | 4 +- src/subtitle_asset.cc | 14 +++--- src/subtitle_asset.h | 14 +++--- src/subtitle_node.cc | 4 +- src/subtitle_node.h | 2 +- src/subtitle_string.cc | 4 +- src/subtitle_string.h | 2 +- src/text_node.cc | 6 +-- src/text_node.h | 2 +- src/transfer_function.cc | 2 +- src/types.cc | 4 +- src/types.h | 6 +-- src/util.cc | 20 ++++---- src/util.h | 4 +- src/version.h | 2 +- src/xml.h | 6 +-- test/certificates_test.cc | 8 +-- test/colour_test.cc | 2 +- test/cpl_sar_test.cc | 4 +- test/dcp_test.cc | 16 +++--- test/decryption_test.cc | 4 +- test/encryption_test.cc | 28 +++++------ test/kdm_test.cc | 8 +-- test/local_time_test.cc | 2 +- test/read_interop_subtitle_test.cc | 2 +- test/recovery_test.cc | 10 ++-- test/rewrite_subs.cc | 10 ++-- test/rgb_xyz_test.cc | 6 +-- test/round_trip_test.cc | 2 +- test/test.cc | 6 +-- test/util_test.cc | 14 +++--- test/write_subtitle_test.cc | 2 +- tools/common.cc | 2 +- tools/dcpdiff.cc | 2 +- tools/dcpdumpsub.cc | 2 +- tools/dcpinfo.cc | 8 +-- 110 files changed, 397 insertions(+), 397 deletions(-) diff --git a/src/asset.cc b/src/asset.cc index 5760c905..3d397831 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -53,7 +53,7 @@ void Asset::write_to_pkl (xmlpp::Node* node, Standard standard) const { DCP_ASSERT (!_file.empty ()); - + xmlpp::Node* asset = node->add_child ("Asset"); asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); asset->add_child("AnnotationText")->add_child_text (_id); @@ -76,11 +76,11 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const boost::filesystem::canonical (root), boost::filesystem::canonical (_file) ); - + if (!path) { throw MiscError (String::compose ("Asset %1 is not within the directory %2", _file, root)); } - + chunk->add_child("Path")->add_child_text (path.get().string ()); chunk->add_child("VolumeIndex")->add_child_text ("1"); chunk->add_child("Offset")->add_child_text ("0"); @@ -91,7 +91,7 @@ string Asset::hash (function progress) const { DCP_ASSERT (!_file.empty ()); - + if (_hash.empty ()) { _hash = make_digest (_file, progress); } @@ -122,4 +122,4 @@ Asset::set_file (boost::filesystem::path file) const _file = boost::filesystem::absolute (file); _hash.clear (); } - + diff --git a/src/asset.h b/src/asset.h index 7c6aab95..12fe2657 100644 --- a/src/asset.h +++ b/src/asset.h @@ -19,7 +19,7 @@ /** @file src/asset.h * @brief Asset class. - */ + */ #ifndef LIBDCP_ASSET_H #define LIBDCP_ASSET_H diff --git a/src/asset_writer.cc b/src/asset_writer.cc index eb55feaf..4611b38a 100644 --- a/src/asset_writer.cc +++ b/src/asset_writer.cc @@ -45,9 +45,9 @@ AssetWriter::AssetWriter (MXF* mxf, boost::filesystem::path file) if (ASDCP_FAILURE (_encryption_context->InitKey (mxf->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/certificate_chain.cc b/src/certificate_chain.cc index 4f92d8d9..22754f4e 100644 --- a/src/certificate_chain.cc +++ b/src/certificate_chain.cc @@ -125,7 +125,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 = dcp::base64_decode (pub, buffer, 1024); @@ -149,9 +149,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; } @@ -167,7 +167,7 @@ dcp::make_certificate_chain ( { boost::filesystem::path directory = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path (); boost::filesystem::create_directories (directory); - + boost::filesystem::path const cwd = boost::filesystem::current_path (); boost::filesystem::current_path (directory); @@ -221,7 +221,7 @@ dcp::make_certificate_chain ( << "OU = Organization unit\n" << "CN = Entity and dnQualifier\n"; } - + string const inter_subject = "/O=" + organisation + "/OU=" + organisational_unit + "/CN=" + intermediate_common_name + @@ -234,7 +234,7 @@ dcp::make_certificate_chain ( 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/certificate_chain.h b/src/certificate_chain.h index e074f8fd..dcb9c141 100644 --- a/src/certificate_chain.h +++ b/src/certificate_chain.h @@ -41,5 +41,5 @@ boost::filesystem::path make_certificate_chain ( std::string intermediate_common_name = ".smpte-430-2.INTERMEDIATE.NOT_FOR_PRODUCTION", std::string leaf_common_name = "CS.smpte-430-2.LEAF.NOT_FOR_PRODUCTION" ); - + } diff --git a/src/certificates.cc b/src/certificates.cc index 1c0ef984..cc443746 100644 --- a/src/certificates.cc +++ b/src/certificates.cc @@ -46,7 +46,7 @@ Certificate::Certificate (X509* c) : _certificate (c) , _public_key (0) { - + } /** Load an X509 certificate from a string. @@ -109,7 +109,7 @@ Certificate::operator= (Certificate const & other) _certificate = 0; RSA_free (_public_key); _public_key = 0; - + read_string (other.certificate (true)); return *this; @@ -123,12 +123,12 @@ string Certificate::certificate (bool with_begin_end) const { DCP_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; @@ -144,7 +144,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; } @@ -177,7 +177,7 @@ Certificate::get_name_part (X509_NAME* n, int nid) DCP_ASSERT (p != -1); return asn_to_utf8 (X509_NAME_ENTRY_get_data (X509_NAME_get_entry (n, p))); } - + string Certificate::name_for_xml (X509_NAME* name) { @@ -225,11 +225,11 @@ Certificate::serial () const ASN1_INTEGER* s = X509_get_serialNumber (_certificate); DCP_ASSERT (s); - + BIGNUM* b = ASN1_INTEGER_to_BN (s, 0); char* c = BN_bn2dec (b); BN_free (b); - + string st (c); OPENSSL_free (c); @@ -240,7 +240,7 @@ string Certificate::thumbprint () const { DCP_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 ebc4cc53..0cc52396 100644 --- a/src/certificates.h +++ b/src/certificates.h @@ -74,7 +74,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); @@ -103,7 +103,7 @@ public: Certificate leaf () const; typedef std::list List; - + List leaf_to_root () const; List root_to_leaf () const; diff --git a/src/colour_conversion.cc b/src/colour_conversion.cc index fc1c9db8..1fbed166 100644 --- a/src/colour_conversion.cc +++ b/src/colour_conversion.cc @@ -116,7 +116,7 @@ ColourConversion::ColourConversion ( , _adjusted_white (adjusted_white) , _out (out) { - + } bool @@ -189,7 +189,7 @@ ColourConversion::xyz_to_rgb () const /* backsubstitute to get the inverse */ lu_substitute (A, pm, xyz_to_rgb); - + return xyz_to_rgb; } diff --git a/src/colour_conversion.h b/src/colour_conversion.h index 1f824c81..1e293f78 100644 --- a/src/colour_conversion.h +++ b/src/colour_conversion.h @@ -48,7 +48,7 @@ class ColourConversion public: ColourConversion () {} - + ColourConversion ( boost::shared_ptr in, YUVToRGB yuv_to_rgb, @@ -87,7 +87,7 @@ public: boost::optional adjusted_white () const { return _adjusted_white; } - + boost::shared_ptr out () const { return _out; } @@ -123,7 +123,7 @@ public: void unset_adjusted_white () { _adjusted_white = boost::optional (); } - + void set_out (boost::shared_ptr f) { _out = f; } diff --git a/src/colour_matrix.h b/src/colour_matrix.h index fd89ed3a..d4f64591 100644 --- a/src/colour_matrix.h +++ b/src/colour_matrix.h @@ -24,6 +24,6 @@ namespace colour_matrix { extern double const xyz_to_rgb[3][3]; extern double const rgb_to_xyz[3][3]; -} +} } diff --git a/src/cpl.cc b/src/cpl.cc index b11452d9..766b91c3 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -120,7 +120,7 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, 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 (_annotation_text); root->add_child("IssueDate")->add_child_text (_metadata.issue_date); @@ -170,7 +170,7 @@ CPL::reel_assets () const return c; } - + bool CPL::equals (shared_ptr other, EqualityOptions opt, NoteHandler note) const { @@ -178,7 +178,7 @@ CPL::equals (shared_ptr other, EqualityOptions opt, NoteHandler not if (!other_cpl) { return false; } - + if (_annotation_text != other_cpl->_annotation_text && !opt.cpl_annotation_texts_can_differ) { stringstream s; s << "CPL: annotation texts differ: " << _annotation_text << " vs " << other_cpl->_annotation_text << "\n"; @@ -195,10 +195,10 @@ CPL::equals (shared_ptr other, EqualityOptions opt, NoteHandler not note (DCP_ERROR, String::compose ("CPL: reel counts differ (%1 vs %2)", _reels.size(), other_cpl->_reels.size())); return false; } - + list >::const_iterator a = _reels.begin (); list >::const_iterator b = other_cpl->_reels.begin (); - + while (a != _reels.end ()) { if (!(*a)->equals (*b, opt, note)) { return false; @@ -255,4 +255,4 @@ CPL::pkl_type (Standard standard) const DCP_ASSERT (false); } } - + diff --git a/src/cpl.h b/src/cpl.h index 4993bcd5..932e6b76 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -37,14 +37,14 @@ #include namespace dcp { - + class ReelAsset; class Reel; class XMLMetadata; class MXFMetadata; class Signer; class DecryptedKDM; - + /** @class CPL * @brief A Composition Playlist. */ @@ -67,7 +67,7 @@ public: std::string annotation_text () const { return _annotation_text; } - + /** @return contents of the <ContentTitleText> node */ std::string content_title_text () const { return _content_title_text; @@ -82,7 +82,7 @@ public: void set_content_version_label_text (std::string text) { _content_version_label_text = text; } - + /** @return the type of the content, used by media servers * to categorise things (e.g. feature, trailer, etc.) */ diff --git a/src/data.h b/src/data.h index d1f52b3b..d169c5c5 100644 --- a/src/data.h +++ b/src/data.h @@ -20,17 +20,17 @@ #include namespace dcp { - + class Data { public: Data () {} - + Data (boost::shared_array data_, boost::uintmax_t size_) : data (data_) , size (size_) {} - + boost::shared_array data; boost::uintmax_t size; }; diff --git a/src/dcp.h b/src/dcp.h index 03f0a802..ed5e5e3e 100644 --- a/src/dcp.h +++ b/src/dcp.h @@ -41,7 +41,7 @@ namespace xmlpp { namespace dcp { -class Content; +class Content; class Reel; class CPL; class XMLMetadata; @@ -53,7 +53,7 @@ class DCPReadError; /** @class DCP * @brief A class to create or read a DCP. */ - + class DCP : public boost::noncopyable { public: @@ -67,7 +67,7 @@ public: DCP (boost::filesystem::path directory); typedef std::list > ReadErrors; - + /** Read the DCP's structure into this object. * @param keep_going true to try to keep going in the face of (some) errors. * @param errors List of errors that will be added to if keep_going is true. @@ -108,7 +108,7 @@ private: XMLMetadata metadata, boost::shared_ptr signer ) const; - + void write_volindex (Standard standard) const; /** Write the ASSETMAP file. diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 43c1ee49..8101bed1 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -59,7 +59,7 @@ Time::set (double seconds, int tcr_) { s = floor (seconds); tcr = tcr_; - + e = int (round ((seconds - s) * tcr)); if (s >= 60) { @@ -86,7 +86,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]); @@ -218,7 +218,7 @@ dcp::operator- (Time a, Time b) } else { r.tcr = a.tcr; } - + r.e = a.e - b.e; if (r.e < 0) { r.e += r.tcr; diff --git a/src/dcp_time.h b/src/dcp_time.h index 88a4d8a1..1221fb32 100644 --- a/src/dcp_time.h +++ b/src/dcp_time.h @@ -87,7 +87,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/decrypted_kdm.cc b/src/decrypted_kdm.cc index 9661281d..9a9a1694 100644 --- a/src/decrypted_kdm.cc +++ b/src/decrypted_kdm.cc @@ -77,7 +77,7 @@ static string get_uuid (unsigned char ** p) { stringstream g; - + for (int i = 0; i < 16; ++i) { g << setw(2) << setfill('0') << hex << static_cast (**p); (*p)++; @@ -109,7 +109,7 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key) if (!bio) { throw MiscError ("could not create memory BIO"); } - + RSA* rsa = PEM_read_bio_RSAPrivateKey (bio, 0, 0, 0); if (!rsa) { throw FileError ("could not read RSA private key file", private_key, errno); @@ -174,8 +174,8 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key) } default: DCP_ASSERT (false); - } - + } + delete[] decrypted; } @@ -229,14 +229,14 @@ DecryptedKDM::encrypt (shared_ptr signer, Certificate recipient, F base64_decode (signer->certificates().leaf().thumbprint (), p, 20); p += 20; - + put_uuid (&p, i.cpl_id ()); put (&p, i.type ()); put_uuid (&p, i.id ()); put (&p, _not_valid_before.as_string ()); put (&p, _not_valid_after.as_string ()); put (&p, i.key().value(), ASDCP::KeyLen); - + /* Encrypt using the projector's public key */ RSA* rsa = recipient.public_key (); unsigned char encrypted[RSA_size(rsa)]; @@ -244,7 +244,7 @@ DecryptedKDM::encrypt (shared_ptr signer, Certificate recipient, F if (encrypted_len == -1) { throw MiscError (String::compose ("Could not encrypt KDM (%1)", ERR_error_string (ERR_get_error(), 0))); } - + /* Lazy overallocation */ char out[encrypted_len * 2]; Kumu::base64encode (encrypted, encrypted_len, out, encrypted_len * 2); @@ -256,7 +256,7 @@ DecryptedKDM::encrypt (shared_ptr signer, Certificate recipient, F } lines << out[i]; } - + keys.push_back (lines.str ()); } diff --git a/src/decrypted_kdm_key.h b/src/decrypted_kdm_key.h index 2a06199c..70ee6ad8 100644 --- a/src/decrypted_kdm_key.h +++ b/src/decrypted_kdm_key.h @@ -57,7 +57,7 @@ public: return _cpl_id; } -private: +private: std::string _type; std::string _id; Key _key; diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc index 4d41a066..fe96250f 100644 --- a/src/encrypted_kdm.cc +++ b/src/encrypted_kdm.cc @@ -35,19 +35,19 @@ using namespace dcp; namespace dcp { -/** Namespace for classes used to hold our data; they are internal to this .cc file */ +/** Namespace for classes used to hold our data; they are internal to this .cc file */ namespace data { class Signer { public: Signer () {} - + Signer (shared_ptr node) : x509_issuer_name (node->string_child ("X509IssuerName")) , x509_serial_number (node->string_child ("X509SerialNumber")) { - + } void as_xml (xmlpp::Element* node) const @@ -55,7 +55,7 @@ public: node->add_child("X509IssuerName", "ds")->add_child_text (x509_issuer_name); node->add_child("X509SerialNumber", "ds")->add_child_text (x509_serial_number); } - + string x509_issuer_name; string x509_serial_number; }; @@ -64,7 +64,7 @@ class X509Data { public: X509Data () {} - + X509Data (boost::shared_ptr node) : x509_issuer_serial (Signer (node->node_child ("X509IssuerSerial"))) , x509_certificate (node->string_child ("X509Certificate")) @@ -77,16 +77,16 @@ public: x509_issuer_serial.as_xml (node->add_child ("X509IssuerSerial", "ds")); node->add_child("X509Certificate", "ds")->add_child_text (x509_certificate); } - + Signer x509_issuer_serial; std::string x509_certificate; }; - + class Reference { public: Reference () {} - + Reference (string u) : uri (u) {} @@ -97,14 +97,14 @@ public: { } - + void as_xml (xmlpp::Element* node) const { node->set_attribute ("URI", uri); node->add_child("DigestMethod", "ds")->set_attribute ("Algorithm", "http://www.w3.org/2001/04/xmlenc#sha256"); node->add_child("DigestValue", "ds")->add_child_text (digest_value); } - + string uri; string digest_value; }; @@ -140,16 +140,16 @@ public: node->add_child ("SignatureMethod", "ds")->set_attribute ( "Algorithm", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" ); - + authenticated_public.as_xml (node->add_child ("Reference", "ds")); authenticated_private.as_xml (node->add_child ("Reference", "ds")); } - + private: Reference authenticated_public; Reference authenticated_private; }; - + class Signature { public: @@ -169,7 +169,7 @@ public: { signed_info.as_xml (node->add_child ("SignedInfo", "ds")); node->add_child("SignatureValue", "ds")->add_child_text (signature_value); - + xmlpp::Element* key_info_node = node->add_child ("KeyInfo", "ds"); for (std::list::const_iterator i = x509_data.begin(); i != x509_data.end(); ++i) { i->as_xml (key_info_node->add_child ("X509Data", "ds")); @@ -185,7 +185,7 @@ class AuthenticatedPrivate { public: AuthenticatedPrivate () {} - + AuthenticatedPrivate (shared_ptr node) { list > encrypted_key_nodes = node->node_children ("EncryptedKey"); @@ -208,7 +208,7 @@ public: cipher_data->add_child("CipherValue", "enc")->add_child_text (*i); } } - + list encrypted_key; }; @@ -216,7 +216,7 @@ class TypedKeyId { public: TypedKeyId () {} - + TypedKeyId (shared_ptr node) : key_type (node->string_child ("KeyType")) , key_id (node->string_child ("KeyId").substr (9)) @@ -243,7 +243,7 @@ class KeyIdList { public: KeyIdList () {} - + KeyIdList (shared_ptr node) { list > typed_key_id_nodes = node->node_children ("TypedKeyId"); @@ -266,7 +266,7 @@ class AuthorizedDeviceInfo { public: AuthorizedDeviceInfo () {} - + AuthorizedDeviceInfo (shared_ptr node) : device_list_identifier (node->string_child ("DeviceListIdentifier").substr (9)) , device_list_description (node->string_child ("DeviceListDescription")) @@ -293,7 +293,7 @@ class X509IssuerSerial { public: X509IssuerSerial () {} - + X509IssuerSerial (shared_ptr node) : x509_issuer_name (node->string_child ("X509IssuerName")) , x509_serial_number (node->string_child ("X509SerialNumber")) @@ -315,7 +315,7 @@ class Recipient { public: Recipient () {} - + Recipient (shared_ptr node) : x509_issuer_serial (node->node_child ("X509IssuerSerial")) , x509_subject_name (node->string_child ("X509SubjectName")) @@ -328,7 +328,7 @@ public: x509_issuer_serial.as_xml (node->add_child ("X509IssuerSerial")); node->add_child("X509SubjectName")->add_child_text (x509_subject_name); } - + X509IssuerSerial x509_issuer_serial; string x509_subject_name; }; @@ -337,7 +337,7 @@ class KDMRequiredExtensions { public: KDMRequiredExtensions () {} - + KDMRequiredExtensions (shared_ptr node) : recipient (node->node_child ("Recipient")) , composition_playlist_id (node->string_child ("CompositionPlaylistId").substr (9)) @@ -353,7 +353,7 @@ public: void as_xml (xmlpp::Element* node) const { node->set_attribute ("xmlns", "http://www.smpte-ra.org/schemas/430-1/2006/KDM"); - + recipient.as_xml (node->add_child ("Recipient")); node->add_child("CompositionPlaylistId")->add_child_text ("urn:uuid:" + composition_playlist_id); if (content_authenticator) { @@ -364,12 +364,12 @@ public: node->add_child("ContentKeysNotValidAfter")->add_child_text (not_valid_after.as_string ()); authorized_device_info.as_xml (node->add_child ("AuthorizedDeviceInfo")); key_id_list.as_xml (node->add_child ("KeyIdList")); - + xmlpp::Element* forensic_mark_flag_list = node->add_child ("ForensicMarkFlagList"); forensic_mark_flag_list->add_child("ForensicMarkFlag")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-picture-disable"); forensic_mark_flag_list->add_child("ForensicMarkFlag")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable"); } - + Recipient recipient; string composition_playlist_id; boost::optional content_authenticator; @@ -384,7 +384,7 @@ class RequiredExtensions { public: RequiredExtensions () {} - + RequiredExtensions (shared_ptr node) : kdm_required_extensions (node->node_child ("KDMRequiredExtensions")) { @@ -395,7 +395,7 @@ public: { kdm_required_extensions.as_xml (node->add_child ("KDMRequiredExtensions")); } - + KDMRequiredExtensions kdm_required_extensions; }; @@ -406,7 +406,7 @@ public: : message_id (make_uuid ()) , issue_date (LocalTime().as_string ()) {} - + AuthenticatedPublic (shared_ptr node) : message_id (node->string_child ("MessageId").substr (9)) , annotation_text (node->string_child ("AnnotationText")) @@ -420,7 +420,7 @@ public: void as_xml (xmlpp::Element* node, map& references) const { references["ID_AuthenticatedPublic"] = node->set_attribute ("Id", "ID_AuthenticatedPublic"); - + node->add_child("MessageId")->add_child_text ("urn:uuid:" + message_id); node->add_child("MessageType")->add_child_text ("http://www.smpte-ra.org/430-1/2006/KDM#kdm-key-type"); node->add_child("AnnotationText")->add_child_text (annotation_text); @@ -449,13 +449,13 @@ public: { } - + EncryptedKDMData (shared_ptr node) : authenticated_public (node->node_child ("AuthenticatedPublic")) , authenticated_private (node->node_child ("AuthenticatedPrivate")) , signature (node->node_child ("Signature")) { - + } shared_ptr as_xml () const @@ -506,7 +506,7 @@ EncryptedKDM::EncryptedKDM ( : _data (new data::EncryptedKDMData) { /* Fill our XML-ish description in with the juicy bits that the caller has given */ - + data::AuthenticatedPublic& aup = _data->authenticated_public; aup.signer.x509_issuer_name = signer->certificates().leaf().issuer (); aup.signer.x509_serial_number = signer->certificates().leaf().serial (); @@ -589,7 +589,7 @@ EncryptedKDM::as_xml (boost::filesystem::path path) const fwrite (x.c_str(), 1, x.length(), f); fclose (f); } - + string EncryptedKDM::as_xml () const { diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h index f89ba596..dc98e1f1 100644 --- a/src/encrypted_kdm.h +++ b/src/encrypted_kdm.h @@ -39,7 +39,7 @@ namespace data { class EncryptedKDMData; } -class Signer; +class Signer; class Certificate; /** @class EncryptedKDM @@ -70,7 +70,7 @@ public: * keys (also key id, CPL id etc.) */ std::list keys () const; - + private: friend class DecryptedKDM; @@ -88,7 +88,7 @@ private: std::list > key_ids, std::list keys ); - + data::EncryptedKDMData* _data; }; diff --git a/src/exceptions.cc b/src/exceptions.cc index 4045021c..e1eaa52e 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -65,7 +65,7 @@ MissingAssetError::MissingAssetError (boost::filesystem::path path, AssetType ty case UNKNOWN: break; } - + _message = String::compose ("Missing asset %1%2", path.string(), type_name); } diff --git a/src/exceptions.h b/src/exceptions.h index e613c980..01ac9ccc 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -39,7 +39,7 @@ public: StringError (std::string message) : _message (message) {} - + ~StringError () throw () {} /** @return error message */ @@ -86,7 +86,7 @@ public: : FileError (message, filename, number) {} }; - + /** @class MiscError * @brief A miscellaneous exception */ @@ -124,7 +124,7 @@ public: MAIN_SUBTITLE, //< main subtitle is missing UNKNOWN //< something is missing but we don't know what }; - + MissingAssetError (boost::filesystem::path, AssetType = UNKNOWN); ~MissingAssetError () throw () {} diff --git a/src/font_asset.h b/src/font_asset.h index 13333777..d0999322 100644 --- a/src/font_asset.h +++ b/src/font_asset.h @@ -32,7 +32,7 @@ class FontAsset : public Asset { public: FontAsset (boost::filesystem::path file); - + private: std::string pkl_type (Standard standard) const; }; diff --git a/src/font_node.cc b/src/font_node.cc index 963eb0d8..c3141d86 100644 --- a/src/font_node.cc +++ b/src/font_node.cc @@ -34,7 +34,7 @@ using namespace dcp; FontNode::FontNode (cxml::ConstNodePtr node, int tcr) { text = node->content (); - + id = node->optional_string_attribute ("Id"); size = node->optional_number_attribute ("Size").get_value_or (0); aspect_adjust = node->optional_number_attribute ("AspectAdjust"); @@ -61,7 +61,7 @@ FontNode::FontNode (cxml::ConstNodePtr node, int tcr) BOOST_FOREACH (cxml::NodePtr& i, f) { font_nodes.push_back (shared_ptr (new FontNode (i, tcr))); } - + list t = node->node_children ("Text"); BOOST_FOREACH (cxml::NodePtr& i, t) { text_nodes.push_back (shared_ptr (new TextNode (i, tcr))); diff --git a/src/font_node.h b/src/font_node.h index 60005218..92dd6b21 100644 --- a/src/font_node.h +++ b/src/font_node.h @@ -39,7 +39,7 @@ public: FontNode () : size (0) {} - + FontNode (cxml::ConstNodePtr node, int tcr); FontNode (std::list > const & font_nodes); @@ -51,7 +51,7 @@ public: boost::optional colour; boost::optional effect; boost::optional effect_colour; - + std::list > subtitle_nodes; std::list > font_nodes; std::list > text_nodes; diff --git a/src/interop_load_font_node.cc b/src/interop_load_font_node.cc index 7c15f401..6bd865c9 100644 --- a/src/interop_load_font_node.cc +++ b/src/interop_load_font_node.cc @@ -39,7 +39,7 @@ InteropLoadFontNode::InteropLoadFontNode (cxml::ConstNodePtr node) x = node->optional_string_attribute ("ID"); } id = x.get_value_or (""); - + uri = node->string_attribute ("URI"); } diff --git a/src/interop_load_font_node.h b/src/interop_load_font_node.h index 5afe8693..f21a03aa 100644 --- a/src/interop_load_font_node.h +++ b/src/interop_load_font_node.h @@ -23,7 +23,7 @@ #include namespace dcp { - + class InteropLoadFontNode : public LoadFontNode { public: diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index e329158e..ffa7d50b 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -63,7 +63,7 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) InteropSubtitleAsset::InteropSubtitleAsset () { - + } Glib::ustring @@ -102,7 +102,7 @@ InteropSubtitleAsset::equals (shared_ptr other_asset, EqualityOptio if (!SubtitleAsset::equals (other_asset, options, note)) { return false; } - + shared_ptr other = dynamic_pointer_cast (other_asset); if (!other) { return false; @@ -150,7 +150,7 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const if (!f) { throw FileError ("Could not open file for writing", p, -1); } - + Glib::ustring const s = xml_as_string (); fwrite (s.c_str(), 1, s.bytes(), f); fclose (f); diff --git a/src/interop_subtitle_asset.h b/src/interop_subtitle_asset.h index 4d2c2893..41ed83b3 100644 --- a/src/interop_subtitle_asset.h +++ b/src/interop_subtitle_asset.h @@ -48,7 +48,7 @@ public: std::list > load_font_nodes () const; void add_font (std::string id, boost::filesystem::path file); - + Glib::ustring xml_as_string () const; void write (boost::filesystem::path path) const; void resolve_fonts (std::list > objects); @@ -92,7 +92,7 @@ public: } protected: - + std::string pkl_type (Standard) const { return "text/xml"; } diff --git a/src/key.cc b/src/key.cc index 43e59dfc..46b09efb 100644 --- a/src/key.cc +++ b/src/key.cc @@ -72,7 +72,7 @@ Key::operator= (Key const & other) if (this == &other) { return *this; } - + memcpy (_value, other._value, ASDCP::KeyLen); return *this; } @@ -81,7 +81,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/load_font_node.h b/src/load_font_node.h index 3ff70497..6f916ef0 100644 --- a/src/load_font_node.h +++ b/src/load_font_node.h @@ -37,7 +37,7 @@ public: {} virtual ~LoadFontNode () {} - + std::string id; }; diff --git a/src/local_time.cc b/src/local_time.cc index 09729543..b8feb849 100644 --- a/src/local_time.cc +++ b/src/local_time.cc @@ -84,7 +84,7 @@ LocalTime::LocalTime (string s) { /* 2013-01-05T18:06:59+04:00 or 2013-01-05T18:06:59.123+04:00 */ /* 0123456789012345678901234 or 01234567890123456789012345678 */ - + if (s.length() < 25) { throw TimeFormatError (s); } diff --git a/src/local_time.h b/src/local_time.h index 5112307c..4a7f3cd8 100644 --- a/src/local_time.h +++ b/src/local_time.h @@ -53,7 +53,7 @@ public: bool operator== (LocalTime const & other) const; bool operator!= (LocalTime const & other) const; - + private: friend class ::local_time_test; diff --git a/src/metadata.h b/src/metadata.h index 734e58b9..8bab79fe 100644 --- a/src/metadata.h +++ b/src/metadata.h @@ -59,7 +59,7 @@ public: XMLMetadata (); void set_issue_date_now (); - + std::string issuer; std::string creator; std::string issue_date; diff --git a/src/modified_gamma_transfer_function.h b/src/modified_gamma_transfer_function.h index 2a7a7b59..e8875d4b 100644 --- a/src/modified_gamma_transfer_function.h +++ b/src/modified_gamma_transfer_function.h @@ -52,10 +52,10 @@ public: } bool about_equal (boost::shared_ptr, double epsilon) const; - + protected: double * make_lut (int bit_depth, bool inverse) const; - + private: double _power; double _threshold; diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc index 19210ce8..91ab0d8a 100644 --- a/src/mono_picture_asset.cc +++ b/src/mono_picture_asset.cc @@ -40,14 +40,14 @@ MonoPictureAsset::MonoPictureAsset (boost::filesystem::path file) if (ASDCP_FAILURE (r)) { boost::throw_exception (MXFFileError ("could not open MXF file for reading", file.string(), r)); } - + ASDCP::JP2K::PictureDescriptor desc; if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) { boost::throw_exception (DCPReadError ("could not read video MXF information")); } read_picture_descriptor (desc); - + ASDCP::WriterInfo info; if (ASDCP_FAILURE (reader.FillWriterInfo (info))) { boost::throw_exception (DCPReadError ("could not read video MXF information")); @@ -59,7 +59,7 @@ MonoPictureAsset::MonoPictureAsset (boost::filesystem::path file) MonoPictureAsset::MonoPictureAsset (Fraction edit_rate) : PictureAsset (edit_rate) { - + } shared_ptr @@ -80,13 +80,13 @@ MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, No if (ASDCP_FAILURE (r)) { boost::throw_exception (MXFFileError ("could not open MXF file for reading", _file.string(), r)); } - + ASDCP::JP2K::MXFReader reader_B; r = reader_B.OpenRead (other->file().string().c_str()); if (ASDCP_FAILURE (r)) { boost::throw_exception (MXFFileError ("could not open MXF file for reading", other->file().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")); @@ -95,7 +95,7 @@ MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, No 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; } @@ -107,11 +107,11 @@ MonoPictureAsset::equals (shared_ptr other, EqualityOptions opt, No if (i >= other_picture->intrinsic_duration()) { return false; } - + note (DCP_PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _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 fc1e4f9c..a10eada0 100644 --- a/src/mono_picture_asset.h +++ b/src/mono_picture_asset.h @@ -24,7 +24,7 @@ namespace dcp { -class MonoPictureAssetWriter; +class MonoPictureAssetWriter; /** @class MonoPictureAsset * @brief A 2D (monoscopic) picture asset. @@ -50,13 +50,13 @@ public: EqualityOptions opt, NoteHandler note ) const; - + boost::shared_ptr get_frame (int n) const; private: std::string cpl_node_name () const; }; -} +} #endif diff --git a/src/mono_picture_asset_writer.h b/src/mono_picture_asset_writer.h index 6478c9bf..81782454 100644 --- a/src/mono_picture_asset_writer.h +++ b/src/mono_picture_asset_writer.h @@ -59,7 +59,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/mxf.cc b/src/mxf.cc index 5d90d60e..1c493901 100644 --- a/src/mxf.cc +++ b/src/mxf.cc @@ -94,7 +94,7 @@ MXF::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"); @@ -112,7 +112,7 @@ MXF::read_writer_info (ASDCP::WriterInfo const & info) } _metadata.read (info); - + Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer)); return buffer; } diff --git a/src/mxf.h b/src/mxf.h index 9f008314..b4efd14f 100644 --- a/src/mxf.h +++ b/src/mxf.h @@ -39,7 +39,7 @@ namespace dcp { class MXFMetadata; -class PictureAssetWriter; +class PictureAssetWriter; /** @class MXF * @brief Parent for classes which represent MXF files. @@ -85,7 +85,7 @@ public: MXFMetadata metadata () const { return _metadata; } - + protected: template friend void start (PictureAssetWriter* writer, boost::shared_ptr

state, Standard standard, Q* mxf, uint8_t* data, int size); diff --git a/src/object.h b/src/object.h index 70cbe999..303e46d3 100644 --- a/src/object.h +++ b/src/object.h @@ -48,11 +48,11 @@ public: protected: friend class ::write_subtitle_test; - + /** ID */ std::string _id; }; - + } #endif diff --git a/src/openjpeg_image.cc b/src/openjpeg_image.cc index d8bb0fcb..4d5b12e2 100644 --- a/src/openjpeg_image.cc +++ b/src/openjpeg_image.cc @@ -40,7 +40,7 @@ OpenJPEGImage::OpenJPEGImage (opj_image_t* image) OpenJPEGImage::OpenJPEGImage (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/src/picture_asset.cc b/src/picture_asset.cc index e9eff5b0..625a0dd7 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -96,7 +96,7 @@ PictureAsset::descriptor_equals ( // a.CodingStyleDefault != b.CodingStyleDefault || // a.QuantizationDefault != b.QuantizationDefault ) { - + note (DCP_ERROR, "video MXF picture descriptors differ"); return false; } @@ -104,7 +104,7 @@ PictureAsset::descriptor_equals ( if (a.ContainerDuration != b.ContainerDuration) { note (DCP_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"); @@ -125,24 +125,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 (DCP_ERROR, String::compose ("image sizes for frame %1 differ", frame)); 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]); @@ -150,29 +150,29 @@ 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 (DCP_NOTE, String::compose ("mean difference %1, deviation %2", mean, std_dev)); - + if (mean > opt.max_mean_pixel_error) { note ( DCP_ERROR, String::compose ("mean %1 out of range %2 in frame %3", mean, opt.max_mean_pixel_error, frame) ); - + return false; } @@ -181,7 +181,7 @@ PictureAsset::frame_buffer_equals ( DCP_ERROR, String::compose ("standard deviation %1 out of range %2 in frame %3", std_dev, opt.max_std_dev_pixel_error, frame) ); - + return false; } diff --git a/src/picture_asset.h b/src/picture_asset.h index 51b69e7c..2c3917a4 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -38,7 +38,7 @@ namespace ASDCP { namespace dcp { -class MonoPictureFrame; +class MonoPictureFrame; class StereoPictureFrame; class PictureAssetWriter; @@ -119,7 +119,7 @@ protected: private: std::string pkl_type (Standard standard) const; }; - + } diff --git a/src/picture_asset_writer.h b/src/picture_asset_writer.h index 48832e43..e263d479 100644 --- a/src/picture_asset_writer.h +++ b/src/picture_asset_writer.h @@ -35,7 +35,7 @@ namespace dcp { -class PictureAsset; +class PictureAsset; /** @class FrameInfo * @brief Information about a single frame (either a monoscopic frame or a left *or* right eye stereoscopic frame) @@ -46,7 +46,7 @@ struct FrameInfo : offset (0) , size (0) {} - + FrameInfo (uint64_t o, uint64_t s, std::string h) : offset (o) , size (s) diff --git a/src/picture_asset_writer_common.cc b/src/picture_asset_writer_common.cc index 0696bc48..43b84385 100644 --- a/src/picture_asset_writer_common.cc +++ b/src/picture_asset_writer_common.cc @@ -26,7 +26,7 @@ struct ASDCPStateBase ASDCPStateBase () : frame_buffer (4 * Kumu::Megabyte) {} - + ASDCP::JP2K::CodestreamParser j2k_parser; ASDCP::JP2K::FrameBuffer frame_buffer; ASDCP::WriterInfo writer_info; @@ -39,7 +39,7 @@ template void dcp::start (PictureAssetWriter* writer, shared_ptr

state, Standard standard, Q* asset, uint8_t* data, int size) { asset->set_file (writer->_file); - + if (ASDCP_FAILURE (state->j2k_parser.OpenReadFrame (data, size, state->frame_buffer))) { boost::throw_exception (MiscError ("could not parse J2K frame")); } @@ -49,9 +49,9 @@ void dcp::start (PictureAssetWriter* writer, shared_ptr

state, Standard stand asset->set_size (Size (state->picture_descriptor.StoredWidth, state->picture_descriptor.StoredHeight)); asset->set_screen_aspect_ratio (Fraction (state->picture_descriptor.AspectRatio.Numerator, state->picture_descriptor.AspectRatio.Denominator)); - + asset->fill_writer_info (&state->writer_info, asset->id(), standard); - + Kumu::Result_t r = state->mxf_writer.OpenWrite ( asset->file().string().c_str(), state->writer_info, diff --git a/src/reel.cc b/src/reel.cc index 4d92d345..3c3c7892 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -49,17 +49,17 @@ Reel::Reel (boost::shared_ptr node) if (main_picture) { _main_picture.reset (new ReelMonoPictureAsset (main_picture)); } - + shared_ptr main_stereoscopic_picture = asset_list->optional_node_child ("MainStereoscopicPicture"); if (main_stereoscopic_picture) { _main_picture.reset (new ReelStereoPictureAsset (main_stereoscopic_picture)); } - + shared_ptr main_sound = asset_list->optional_node_child ("MainSound"); if (main_sound) { _main_sound.reset (new ReelSoundAsset (main_sound)); } - + shared_ptr main_subtitle = asset_list->optional_node_child ("MainSubtitle"); if (main_subtitle) { _main_subtitle.reset (new ReelSubtitleAsset (main_subtitle)); @@ -75,7 +75,7 @@ Reel::write_to_cpl (xmlpp::Element* node, Standard standard) 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, standard); @@ -94,7 +94,7 @@ Reel::write_to_cpl (xmlpp::Element* node, Standard standard) const _main_picture->write_to_cpl (asset_list, standard); } } - + bool Reel::equals (boost::shared_ptr other, EqualityOptions opt, NoteHandler note) const { @@ -102,7 +102,7 @@ Reel::equals (boost::shared_ptr other, EqualityOptions opt, NoteHand note (DCP_ERROR, "Reel: assets differ"); return false; } - + if (_main_picture && !_main_picture->equals (other->_main_picture, opt, note)) { return false; } @@ -111,7 +111,7 @@ Reel::equals (boost::shared_ptr other, EqualityOptions opt, NoteHand note (DCP_ERROR, "Reel: assets differ"); return false; } - + if (_main_sound && !_main_sound->equals (other->_main_sound, opt, note)) { return false; } @@ -120,7 +120,7 @@ Reel::equals (boost::shared_ptr other, EqualityOptions opt, NoteHand note (DCP_ERROR, "Reel: assets differ"); return false; } - + if (_main_subtitle && !_main_subtitle->equals (other->_main_subtitle, opt, note)) { return false; } diff --git a/src/reel.h b/src/reel.h index 278a0f91..010322c2 100644 --- a/src/reel.h +++ b/src/reel.h @@ -41,12 +41,12 @@ class ReelSoundAsset; class ReelSubtitleAsset; class Content; -/** @brief A reel within a DCP; the part which actually refers to picture, sound and subtitle data */ +/** @brief A reel within a DCP; the part which actually refers to picture, sound and subtitle data */ class Reel : public Object { public: Reel () {} - + Reel ( boost::shared_ptr picture, boost::shared_ptr sound, @@ -58,7 +58,7 @@ public: {} Reel (boost::shared_ptr); - + boost::shared_ptr main_picture () const { return _main_picture; } @@ -66,7 +66,7 @@ public: boost::shared_ptr main_sound () const { return _main_sound; } - + boost::shared_ptr main_subtitle () const { return _main_subtitle; } diff --git a/src/reel_asset.h b/src/reel_asset.h index e9704acd..371a8f3e 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -67,7 +67,7 @@ public: Ref& asset_ref () { return _asset_ref; } - + int64_t entry_point () const { return _entry_point; } diff --git a/src/reel_mono_picture_asset.h b/src/reel_mono_picture_asset.h index 5fcb31c8..54450233 100644 --- a/src/reel_mono_picture_asset.h +++ b/src/reel_mono_picture_asset.h @@ -28,7 +28,7 @@ namespace dcp { -class MonoPictureAsset; +class MonoPictureAsset; /** @class ReelMonoPictureAsset * @brief Part of a Reel's description which refers to a monoscopic picture asset. diff --git a/src/reel_mxf.h b/src/reel_mxf.h index 5e8aa84e..6989a81f 100644 --- a/src/reel_mxf.h +++ b/src/reel_mxf.h @@ -46,7 +46,7 @@ public: /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */ virtual std::string key_type () const = 0; - + /** @return true if a KeyId is specified for this asset, implying * that its content is encrypted. */ diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc index 7099d7d2..ccb4bd56 100644 --- a/src/reel_picture_asset.cc +++ b/src/reel_picture_asset.cc @@ -49,7 +49,7 @@ ReelPictureAsset::ReelPictureAsset (shared_ptr asset, int64_t entr , _frame_rate (asset->frame_rate ()) , _screen_aspect_ratio (asset->screen_aspect_ratio ()) { - + } ReelPictureAsset::ReelPictureAsset (shared_ptr node) @@ -77,7 +77,7 @@ ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const /* Find */ xmlpp::Node* mp = find_child (node, cpl_node_name ()); - + mp->add_child ("FrameRate")->add_child_text (String::compose ("%1 %2", _frame_rate.numerator, _frame_rate.denominator)); if (standard == INTEROP) { stringstream s; @@ -108,7 +108,7 @@ ReelPictureAsset::equals (shared_ptr other, EqualityOptions opt if (!ReelAsset::equals (other, opt, note)) { return false; } - + shared_ptr rpa = dynamic_pointer_cast (other); if (!rpa) { return false; diff --git a/src/reel_picture_asset.h b/src/reel_picture_asset.h index 4feafeb0..637c9635 100644 --- a/src/reel_picture_asset.h +++ b/src/reel_picture_asset.h @@ -62,7 +62,7 @@ public: private: std::string key_type () const; - + Fraction _frame_rate; Fraction _screen_aspect_ratio; }; diff --git a/src/reel_sound_asset.h b/src/reel_sound_asset.h index 9767307a..8f39e8a0 100644 --- a/src/reel_sound_asset.h +++ b/src/reel_sound_asset.h @@ -49,7 +49,7 @@ public: boost::shared_ptr asset () const { return boost::dynamic_pointer_cast (_asset_ref.object ()); } - + private: std::string key_type () const; std::string cpl_node_name () const; diff --git a/src/reel_stereo_picture_asset.h b/src/reel_stereo_picture_asset.h index 07d31a03..72b225bc 100644 --- a/src/reel_stereo_picture_asset.h +++ b/src/reel_stereo_picture_asset.h @@ -28,7 +28,7 @@ namespace dcp { -class StereoPictureAsset; +class StereoPictureAsset; /** @class ReelStereoPictureAsset * @brief Part of a Reel's description which refers to a stereoscopic picture asset. diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index 55881f7e..876b3511 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -44,7 +44,7 @@ public: return boost::dynamic_pointer_cast (_asset_ref.object ()); } -private: +private: std::string cpl_node_name () const; }; diff --git a/src/ref.h b/src/ref.h index 287d5081..8194e585 100644 --- a/src/ref.h +++ b/src/ref.h @@ -91,7 +91,7 @@ public: if (!_object) { throw UnresolvedRefError (_id); } - + return _object; } @@ -102,7 +102,7 @@ public: if (!_object) { throw UnresolvedRefError (_id); } - + return _object.get (); } diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc index 50c3bf7e..2c67e62f 100644 --- a/src/rgb_xyz.cc +++ b/src/rgb_xyz.cc @@ -62,11 +62,11 @@ dcp::xyz_to_rgba ( struct { double x, y, z; } s; - + struct { double r, g, b; } d; - + int* xyz_x = xyz_image->data (0); int* xyz_y = xyz_image->data (1); int* xyz_z = xyz_image->data (2); @@ -77,13 +77,13 @@ dcp::xyz_to_rgba ( int const height = xyz_image->size().height; int const width = xyz_image->size().width; - + for (int y = 0; y < height; ++y) { uint8_t* argb_line = argb; for (int x = 0; x < width; ++x) { DCP_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[*xyz_x++]; s.y = lut_in[*xyz_y++]; @@ -98,16 +98,16 @@ dcp::xyz_to_rgba ( d.r = ((s.x * matrix(0, 0)) + (s.y * matrix(0, 1)) + (s.z * matrix(0, 2))); d.g = ((s.x * matrix(1, 0)) + (s.y * matrix(1, 1)) + (s.z * matrix(1, 2))); d.b = ((s.x * matrix(2, 0)) + (s.y * matrix(2, 1)) + (s.z * matrix(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[int(rint(d.b * max_colour))] * 0xff; *argb_line++ = lut_out[int(rint(d.g * max_colour))] * 0xff; @@ -141,7 +141,7 @@ dcp::xyz_to_rgb ( struct { double x, y, z; } s; - + struct { double r, g, b; } d; @@ -183,7 +183,7 @@ dcp::xyz_to_rgb ( } cz = max (min (cz, 4095), 0); } - + /* In gamma LUT */ s.x = lut_in[cx]; s.y = lut_in[cy]; @@ -198,13 +198,13 @@ dcp::xyz_to_rgb ( d.r = ((s.x * matrix(0, 0)) + (s.y * matrix(0, 1)) + (s.z * matrix(0, 2))); d.g = ((s.x * matrix(1, 0)) + (s.y * matrix(1, 1)) + (s.z * matrix(1, 2))); d.b = ((s.x * matrix(2, 0)) + (s.y * matrix(2, 1)) + (s.z * matrix(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); @@ -243,7 +243,7 @@ dcp::rgb_to_xyz ( struct { double x, y, z; } e; - + double const * lut_in = conversion.in()->lut (12, false); double const * lut_out = conversion.out()->lut (16, true); boost::numeric::ublas::matrix const rgb_to_xyz = conversion.rgb_to_xyz (); @@ -268,7 +268,7 @@ dcp::rgb_to_xyz ( e.x = ((d.x * bradford(0, 0)) + (d.y * bradford(0, 1)) + (d.z * bradford(0, 2))); e.y = ((d.x * bradford(1, 0)) + (d.y * bradford(1, 1)) + (d.z * bradford(1, 2))); 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; @@ -279,7 +279,7 @@ dcp::rgb_to_xyz ( if (e.x < 0 || e.y < 0 || e.z < 0 || e.x > 65535 || e.y > 65535 || e.z > 65535) { ++clamped; } - + e.x = max (0.0, e.x); e.y = max (0.0, e.y); e.z = max (0.0, e.z); @@ -324,6 +324,6 @@ dcp::xyz_to_xyz (uint8_t const * xyz_16, dcp::Size size, int stride) ++jn; } } - + return xyz_12; } diff --git a/src/rgb_xyz.h b/src/rgb_xyz.h index 40aaf762..7bd1cd8e 100644 --- a/src/rgb_xyz.h +++ b/src/rgb_xyz.h @@ -24,17 +24,17 @@ namespace dcp { -class ARGBImage; +class ARGBImage; class OpenJPEGImage; class Image; class ColourConversion; - + extern void xyz_to_rgba ( boost::shared_ptr, ColourConversion const & conversion, uint8_t* rgba ); - + extern void xyz_to_rgb ( boost::shared_ptr, ColourConversion const & conversion, @@ -42,7 +42,7 @@ extern void xyz_to_rgb ( int stride, boost::optional note = boost::optional () ); - + extern boost::shared_ptr rgb_to_xyz ( uint8_t const * rgb, dcp::Size size, @@ -50,7 +50,7 @@ extern boost::shared_ptr rgb_to_xyz ( ColourConversion const & conversion, boost::optional note = boost::optional () ); - + extern boost::shared_ptr xyz_to_xyz (uint8_t const * xyz, dcp::Size size, int stride); - + } diff --git a/src/signer.cc b/src/signer.cc index f6cc76ac..c04ac122 100644 --- a/src/signer.cc +++ b/src/signer.cc @@ -84,7 +84,7 @@ void Signer::sign (xmlpp::Element* parent, Standard standard) const { /* */ - + xmlpp::Element* signer = parent->add_child("Signer"); xmlpp::Element* data = signer->add_child("X509Data", "dsig"); xmlpp::Element* serial_element = data->add_child("X509IssuerSerial", "dsig"); @@ -93,18 +93,18 @@ Signer::sign (xmlpp::Element* parent, Standard standard) const data->add_child("X509SubjectName", "dsig")->add_child_text (_certificates.leaf().subject()); /* */ - + 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 (standard == 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", ""); @@ -138,13 +138,13 @@ Signer::add_signature_value (xmlpp::Node* parent, string ns) const CertificateChain::List c = _certificates.leaf_to_root (); for (CertificateChain::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()); } @@ -156,7 +156,7 @@ Signer::add_signature_value (xmlpp::Node* parent, string ns) const signature_context->signKey = xmlSecCryptoAppKeyLoadMemory ( reinterpret_cast (_key.c_str()), _key.size(), xmlSecKeyDataFormatPem, 0, 0, 0 ); - + if (signature_context->signKey == 0) { throw FileError ("could not load private key file", _key, 0); } @@ -185,7 +185,7 @@ Signer::valid () const if (!bio) { throw MiscError ("could not create memory BIO"); } - + RSA* private_key = PEM_read_bio_RSAPrivateKey (bio, 0, 0, 0); RSA* public_key = _certificates.leaf().public_key (); bool const valid = !BN_cmp (private_key->n, public_key->n); diff --git a/src/signer.h b/src/signer.h index 1d53d5ba..97cfa6d1 100644 --- a/src/signer.h +++ b/src/signer.h @@ -51,7 +51,7 @@ public: std::string intermediate_common_name, std::string leaf_common_name ); - + /** @param c Certificate chain to sign with. * @param k Key to sign with as a PEM-format string. */ @@ -70,7 +70,7 @@ public: CertificateChain& certificates () { return _certificates; } - + std::string key () const { return _key; } @@ -80,10 +80,10 @@ public: } bool valid () const; - -private: + +private: void create (boost::filesystem::path directory); - + /** Certificate chain to sign with */ CertificateChain _certificates; /** Key to sign with as a PEM-format string */ diff --git a/src/smpte_load_font_node.cc b/src/smpte_load_font_node.cc index b3ae3ff8..3efd2d58 100644 --- a/src/smpte_load_font_node.cc +++ b/src/smpte_load_font_node.cc @@ -35,7 +35,7 @@ SMPTELoadFontNode::SMPTELoadFontNode (shared_ptr node) : LoadFontNode (node->string_attribute ("ID")) , urn (node->content().substr (9)) { - + } bool diff --git a/src/smpte_load_font_node.h b/src/smpte_load_font_node.h index 5d02fb1b..823b2d8d 100644 --- a/src/smpte_load_font_node.h +++ b/src/smpte_load_font_node.h @@ -30,7 +30,7 @@ namespace cxml { } namespace dcp { - + /** @class SMPTELoadFontNode * @brief Parser for LoadFont nodes from SMPTE subtitle XML. */ @@ -46,5 +46,5 @@ public: bool operator== (SMPTELoadFontNode const & a, SMPTELoadFontNode const & b); bool operator!= (SMPTELoadFontNode const & a, SMPTELoadFontNode const & b); - + } diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index e426ae22..8ea68362 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -52,7 +52,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset () : _edit_rate (24, 1) , _time_code_rate (24) { - + } /** Construct a SMPTESubtitleAsset by reading an MXF file. @@ -68,14 +68,14 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) } /* Read the subtitle XML */ - + string s; reader.ReadTimedTextResource (s, 0, 0); stringstream t; t << s; shared_ptr xml (new cxml::Document ("SubtitleReel")); xml->read_stream (t); - + ASDCP::WriterInfo info; reader.FillWriterInfo (info); _id = read_writer_info (info); @@ -112,7 +112,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) BOOST_FOREACH (cxml::NodePtr& i, f) { font_nodes.push_back (shared_ptr (new FontNode (i, _time_code_rate))); } - + parse_subtitles (xml, font_nodes); /* Read fonts */ @@ -148,8 +148,8 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file) } } } - - + + } list > @@ -199,9 +199,9 @@ SMPTESubtitleAsset::xml_as_string () const load_font->add_child_text (i->urn); load_font->set_attribute ("ID", i->id); } - + subtitles_as_xml (root->add_child ("SubtitleList", "dcst"), _time_code_rate, "dcst"); - + return doc.write_to_string_formatted ("UTF-8"); } @@ -211,7 +211,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const { ASDCP::WriterInfo writer_info; fill_writer_info (&writer_info, _id, SMPTE); - + ASDCP::TimedText::TimedTextDescriptor descriptor; descriptor.EditRate = ASDCP::Rational (_edit_rate.numerator, _edit_rate.denominator); descriptor.EncodingName = "UTF-8"; @@ -227,7 +227,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const descriptor.ResourceList.push_back (res); } } - + descriptor.NamespaceName = "dcst"; memcpy (descriptor.AssetID, writer_info.AssetUUID, ASDCP::UUIDlen); descriptor.ContainerDuration = latest_subtitle_out().as_editable_units (_edit_rate.numerator / _edit_rate.denominator); @@ -297,7 +297,7 @@ SMPTESubtitleAsset::equals (shared_ptr other_asset, EqualityOptions note (DCP_ERROR, "Subtitle content title texts differ"); return false; } - + if (_language != other->_language) { note (DCP_ERROR, "Subtitle languages differ"); return false; @@ -307,7 +307,7 @@ SMPTESubtitleAsset::equals (shared_ptr other_asset, EqualityOptions note (DCP_ERROR, "Subtitle annotation texts differ"); return false; } - + if (_issue_date != other->_issue_date) { if (options.issue_dates_can_differ) { note (DCP_NOTE, "Subtitle issue dates differ"); @@ -316,12 +316,12 @@ SMPTESubtitleAsset::equals (shared_ptr other_asset, EqualityOptions return false; } } - + if (_reel_number != other->_reel_number) { note (DCP_ERROR, "Subtitle reel numbers differ"); return false; } - + if (_edit_rate != other->_edit_rate) { note (DCP_ERROR, "Subtitle edit rates differ"); return false; @@ -331,7 +331,7 @@ SMPTESubtitleAsset::equals (shared_ptr other_asset, EqualityOptions note (DCP_ERROR, "Subtitle time code rates differ"); return false; } - + if (_start_time != other->_start_time) { note (DCP_ERROR, "Subtitle start times differ"); return false; diff --git a/src/smpte_subtitle_asset.h b/src/smpte_subtitle_asset.h index a01ef775..444c53e6 100644 --- a/src/smpte_subtitle_asset.h +++ b/src/smpte_subtitle_asset.h @@ -37,7 +37,7 @@ class SMPTESubtitleAsset : public SubtitleAsset, public MXF { public: SMPTESubtitleAsset (); - + /** @param file File name */ SMPTESubtitleAsset (boost::filesystem::path file); @@ -47,7 +47,7 @@ public: EqualityOptions, NoteHandler note ) const; - + std::list > load_font_nodes () const; Glib::ustring xml_as_string () const; @@ -111,15 +111,15 @@ public: boost::optional