summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-24 01:06:04 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-24 01:06:04 +0100
commit9e523d8a4062ad52330dff6c2ba50e54184c9bb2 (patch)
treecc10da19d90f9ad1d17066e152602c3f88e5bf2b /src
parent242d42f32a1fbcf9fb1fe64d8c98e907e407703d (diff)
No-op: whitespace.
Diffstat (limited to 'src')
-rw-r--r--src/asset.cc10
-rw-r--r--src/asset.h2
-rw-r--r--src/asset_writer.cc4
-rw-r--r--src/certificate_chain.cc12
-rw-r--r--src/certificate_chain.h2
-rw-r--r--src/certificates.cc18
-rw-r--r--src/certificates.h4
-rw-r--r--src/colour_conversion.cc4
-rw-r--r--src/colour_conversion.h6
-rw-r--r--src/colour_matrix.h2
-rw-r--r--src/cpl.cc12
-rw-r--r--src/cpl.h8
-rw-r--r--src/data.h6
-rw-r--r--src/dcp.h8
-rw-r--r--src/dcp_time.cc6
-rw-r--r--src/dcp_time.h2
-rw-r--r--src/decrypted_kdm.cc16
-rw-r--r--src/decrypted_kdm_key.h2
-rw-r--r--src/encrypted_kdm.cc68
-rw-r--r--src/encrypted_kdm.h6
-rw-r--r--src/exceptions.cc2
-rw-r--r--src/exceptions.h6
-rw-r--r--src/font_asset.h2
-rw-r--r--src/font_node.cc4
-rw-r--r--src/font_node.h4
-rw-r--r--src/interop_load_font_node.cc2
-rw-r--r--src/interop_load_font_node.h2
-rw-r--r--src/interop_subtitle_asset.cc6
-rw-r--r--src/interop_subtitle_asset.h4
-rw-r--r--src/key.cc4
-rw-r--r--src/load_font_node.h2
-rw-r--r--src/local_time.cc2
-rw-r--r--src/local_time.h2
-rw-r--r--src/metadata.h2
-rw-r--r--src/modified_gamma_transfer_function.h4
-rw-r--r--src/mono_picture_asset.cc16
-rw-r--r--src/mono_picture_asset.h6
-rw-r--r--src/mono_picture_asset_writer.h2
-rw-r--r--src/mxf.cc4
-rw-r--r--src/mxf.h4
-rw-r--r--src/object.h4
-rw-r--r--src/openjpeg_image.cc2
-rw-r--r--src/picture_asset.cc32
-rw-r--r--src/picture_asset.h4
-rw-r--r--src/picture_asset_writer.h4
-rw-r--r--src/picture_asset_writer_common.cc8
-rw-r--r--src/reel.cc16
-rw-r--r--src/reel.h8
-rw-r--r--src/reel_asset.h2
-rw-r--r--src/reel_mono_picture_asset.h2
-rw-r--r--src/reel_mxf.h2
-rw-r--r--src/reel_picture_asset.cc6
-rw-r--r--src/reel_picture_asset.h2
-rw-r--r--src/reel_sound_asset.h2
-rw-r--r--src/reel_stereo_picture_asset.h2
-rw-r--r--src/reel_subtitle_asset.h2
-rw-r--r--src/ref.h4
-rw-r--r--src/rgb_xyz.cc34
-rw-r--r--src/rgb_xyz.h12
-rw-r--r--src/signer.cc18
-rw-r--r--src/signer.h10
-rw-r--r--src/smpte_load_font_node.cc2
-rw-r--r--src/smpte_load_font_node.h4
-rw-r--r--src/smpte_subtitle_asset.cc30
-rw-r--r--src/smpte_subtitle_asset.h12
-rw-r--r--src/sound_asset.cc14
-rw-r--r--src/sound_asset.h6
-rw-r--r--src/sound_asset_writer.cc10
-rw-r--r--src/sound_asset_writer.h2
-rw-r--r--src/stereo_picture_asset.cc14
-rw-r--r--src/stereo_picture_asset.h6
-rw-r--r--src/stereo_picture_asset_writer.cc2
-rw-r--r--src/stereo_picture_asset_writer.h2
-rw-r--r--src/stereo_picture_frame.cc2
-rw-r--r--src/stereo_picture_frame.h4
-rw-r--r--src/subtitle_asset.cc14
-rw-r--r--src/subtitle_asset.h14
-rw-r--r--src/subtitle_node.cc4
-rw-r--r--src/subtitle_node.h2
-rw-r--r--src/subtitle_string.cc4
-rw-r--r--src/subtitle_string.h2
-rw-r--r--src/text_node.cc6
-rw-r--r--src/text_node.h2
-rw-r--r--src/transfer_function.cc2
-rw-r--r--src/types.cc4
-rw-r--r--src/types.h6
-rw-r--r--src/util.cc20
-rw-r--r--src/util.h4
-rw-r--r--src/version.h2
-rw-r--r--src/xml.h6
90 files changed, 328 insertions, 328 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<void (float)> 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<Certificate> 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<const TransferFunction> in,
YUVToRGB yuv_to_rgb,
@@ -87,7 +87,7 @@ public:
boost::optional<Chromaticity> adjusted_white () const {
return _adjusted_white;
}
-
+
boost::shared_ptr<const TransferFunction> out () const {
return _out;
}
@@ -123,7 +123,7 @@ public:
void unset_adjusted_white () {
_adjusted_white = boost::optional<Chromaticity> ();
}
-
+
void set_out (boost::shared_ptr<const TransferFunction> 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_ptr<cons
if (signer) {
root->set_namespace_declaration ("http://www.w3.org/2000/09/xmldsig#", "dsig");
}
-
+
root->add_child("Id")->add_child_text ("urn:uuid:" + _id);
root->add_child("AnnotationText")->add_child_text (_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<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
@@ -178,7 +178,7 @@ CPL::equals (shared_ptr<const Asset> 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<const Asset> 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<shared_ptr<Reel> >::const_iterator a = _reels.begin ();
list<shared_ptr<Reel> >::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 <list>
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 &lt;ContentTitleText&gt; 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 <boost/shared_array.hpp>
namespace dcp {
-
+
class Data
{
public:
Data () {}
-
+
Data (boost::shared_array<uint8_t> data_, boost::uintmax_t size_)
: data (data_)
, size (size_)
{}
-
+
boost::shared_array<uint8_t> 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<boost::shared_ptr<DCPReadError> > 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<const Signer> 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<int> (b[0]);
m = raw_convert<int> (b[1]);
s = raw_convert<int> (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<int> (**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<const Signer> 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<const Signer> 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<const Signer> 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<const cxml::Node> 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<const cxml::Node> 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<X509Data>::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<const cxml::Node> node)
{
list<shared_ptr<cxml::Node> > encrypted_key_nodes = node->node_children ("EncryptedKey");
@@ -208,7 +208,7 @@ public:
cipher_data->add_child("CipherValue", "enc")->add_child_text (*i);
}
}
-
+
list<string> encrypted_key;
};
@@ -216,7 +216,7 @@ class TypedKeyId
{
public:
TypedKeyId () {}
-
+
TypedKeyId (shared_ptr<const cxml::Node> 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<const cxml::Node> node)
{
list<shared_ptr<cxml::Node> > typed_key_id_nodes = node->node_children ("TypedKeyId");
@@ -266,7 +266,7 @@ class AuthorizedDeviceInfo
{
public:
AuthorizedDeviceInfo () {}
-
+
AuthorizedDeviceInfo (shared_ptr<const cxml::Node> 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<const cxml::Node> 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<const cxml::Node> 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<const cxml::Node> 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<string> content_authenticator;
@@ -384,7 +384,7 @@ class RequiredExtensions
{
public:
RequiredExtensions () {}
-
+
RequiredExtensions (shared_ptr<const cxml::Node> 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<const cxml::Node> 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<string, xmlpp::Attribute *>& 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<const cxml::Node> node)
: authenticated_public (node->node_child ("AuthenticatedPublic"))
, authenticated_private (node->node_child ("AuthenticatedPrivate"))
, signature (node->node_child ("Signature"))
{
-
+
}
shared_ptr<xmlpp::Document> 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<std::string> keys () const;
-
+
private:
friend class DecryptedKDM;
@@ -88,7 +88,7 @@ private:
std::list<std::pair<std::string, std::string> > key_ids,
std::list<std::string> 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<int64_t> ("Size").get_value_or (0);
aspect_adjust = node->optional_number_attribute<float> ("AspectAdjust");
@@ -61,7 +61,7 @@ FontNode::FontNode (cxml::ConstNodePtr node, int tcr)
BOOST_FOREACH (cxml::NodePtr& i, f) {
font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, tcr)));
}
-
+
list<cxml::NodePtr> t = node->node_children ("Text");
BOOST_FOREACH (cxml::NodePtr& i, t) {
text_nodes.push_back (shared_ptr<TextNode> (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<boost::shared_ptr<FontNode> > const & font_nodes);
@@ -51,7 +51,7 @@ public:
boost::optional<Colour> colour;
boost::optional<Effect> effect;
boost::optional<Colour> effect_colour;
-
+
std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes;
std::list<boost::shared_ptr<FontNode> > font_nodes;
std::list<boost::shared_ptr<TextNode> > 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 <boost/optional.hpp>
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<const Asset> other_asset, EqualityOptio
if (!SubtitleAsset::equals (other_asset, options, note)) {
return false;
}
-
+
shared_ptr<const InteropSubtitleAsset> other = dynamic_pointer_cast<const InteropSubtitleAsset> (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<boost::shared_ptr<LoadFontNode> > 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<boost::shared_ptr<Object> > 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<int> (_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<const TransferFunction>, 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<const MonoPictureFrame>
@@ -80,13 +80,13 @@ MonoPictureAsset::equals (shared_ptr<const Asset> 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<const Asset> 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<const Asset> 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<const MonoPictureFrame> frame_A = get_frame (i);
shared_ptr<const MonoPictureFrame> frame_B = other_picture->get_frame (i);
-
+
if (!frame_buffer_equals (
i, opt, note,
frame_A->j2k_data(), frame_A->j2k_size(),
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<const MonoPictureFrame> 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<ASDCPState> _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 <class P, class Q>
friend void start (PictureAssetWriter* writer, boost::shared_ptr<P> 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<OpenJPEGImage> image_A = decompress_j2k (const_cast<uint8_t*> (data_A), size_A, 0);
shared_ptr<OpenJPEGImage> image_B = decompress_j2k (const_cast<uint8_t*> (data_B), size_B, 0);
-
+
/* Compare them */
-
+
vector<int> abs_diffs (image_A->size().width * image_A->size().height * 3);
int d = 0;
int max_diff = 0;
-
+
for (int c = 0; c < 3; ++c) {
-
+
if (image_A->size() != image_B->size()) {
note (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<int>::iterator j = abs_diffs.begin(); j != abs_diffs.end(); ++j) {
total += *j;
}
-
+
double const mean = double (total) / abs_diffs.size ();
-
+
uint64_t total_squared_deviation = 0;
for (vector<int>::iterator j = abs_diffs.begin(); j != abs_diffs.end(); ++j) {
total_squared_deviation += pow (*j - mean, 2);
}
-
+
double const std_dev = sqrt (double (total_squared_deviation) / abs_diffs.size());
-
+
note (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 <class P, class Q>
void dcp::start (PictureAssetWriter* writer, shared_ptr<P> 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<P> 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<const cxml::Node> node)
if (main_picture) {
_main_picture.reset (new ReelMonoPictureAsset (main_picture));
}
-
+
shared_ptr<cxml::Node> main_stereoscopic_picture = asset_list->optional_node_child ("MainStereoscopicPicture");
if (main_stereoscopic_picture) {
_main_picture.reset (new ReelStereoPictureAsset (main_stereoscopic_picture));
}
-
+
shared_ptr<cxml::Node> main_sound = asset_list->optional_node_child ("MainSound");
if (main_sound) {
_main_sound.reset (new ReelSoundAsset (main_sound));
}
-
+
shared_ptr<cxml::Node> 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<ReelMonoPictureAsset> (_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<const Reel> other, EqualityOptions opt, NoteHandler note) const
{
@@ -102,7 +102,7 @@ Reel::equals (boost::shared_ptr<const Reel> 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<const Reel> 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<const Reel> 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<ReelPictureAsset> picture,
boost::shared_ptr<ReelSoundAsset> sound,
@@ -58,7 +58,7 @@ public:
{}
Reel (boost::shared_ptr<const cxml::Node>);
-
+
boost::shared_ptr<ReelPictureAsset> main_picture () const {
return _main_picture;
}
@@ -66,7 +66,7 @@ public:
boost::shared_ptr<ReelSoundAsset> main_sound () const {
return _main_sound;
}
-
+
boost::shared_ptr<ReelSubtitleAsset> 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>& 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<PictureAsset> asset, int64_t entr
, _frame_rate (asset->frame_rate ())
, _screen_aspect_ratio (asset->screen_aspect_ratio ())
{
-
+
}
ReelPictureAsset::ReelPictureAsset (shared_ptr<const cxml::Node> node)
@@ -77,7 +77,7 @@ ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
/* Find <MainPicture> */
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<const ReelAsset> other, EqualityOptions opt
if (!ReelAsset::equals (other, opt, note)) {
return false;
}
-
+
shared_ptr<const ReelPictureAsset> rpa = dynamic_pointer_cast<const ReelPictureAsset> (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<const SoundAsset> asset () const {
return boost::dynamic_pointer_cast<const SoundAsset> (_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<SubtitleAsset> (_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<double> 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<const OpenJPEGImage>,
ColourConversion const & conversion,
uint8_t* rgba
);
-
+
extern void xyz_to_rgb (
boost::shared_ptr<const OpenJPEGImage>,
ColourConversion const & conversion,
@@ -42,7 +42,7 @@ extern void xyz_to_rgb (
int stride,
boost::optional<NoteHandler> note = boost::optional<NoteHandler> ()
);
-
+
extern boost::shared_ptr<OpenJPEGImage> rgb_to_xyz (
uint8_t const * rgb,
dcp::Size size,
@@ -50,7 +50,7 @@ extern boost::shared_ptr<OpenJPEGImage> rgb_to_xyz (
ColourConversion const & conversion,
boost::optional<NoteHandler> note = boost::optional<NoteHandler> ()
);
-
+
extern boost::shared_ptr<OpenJPEGImage> 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
{
/* <Signer> */
-
+
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());
/* <Signature> */
-
+
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<const unsigned char *> (_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<const cxml::Node> 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<cxml::Document> 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<FontNode> (new FontNode (i, _time_code_rate)));
}
-
+
parse_subtitles (xml, font_nodes);
/* Read fonts */
@@ -148,8 +148,8 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
}
}
}
-
-
+
+
}
list<shared_ptr<LoadFontNode> >
@@ -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<const Asset> 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<const Asset> 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<const Asset> 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<const Asset> 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<boost::shared_ptr<LoadFontNode> > load_font_nodes () const;
Glib::ustring xml_as_string () const;
@@ -111,15 +111,15 @@ public:
boost::optional<Time> start_time () const {
return _start_time;
}
-
+
static bool valid_mxf (boost::filesystem::path);
protected:
-
+
std::string pkl_type (Standard) const {
return "application/mxf";
}
-
+
private:
std::string _content_title_text;
boost::optional<std::string> _language;
@@ -129,7 +129,7 @@ private:
Fraction _edit_rate;
int _time_code_rate;
boost::optional<Time> _start_time;
-
+
std::list<boost::shared_ptr<SMPTELoadFontNode> > _load_font_nodes;
};
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 3d23b426..f95b860f 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -103,7 +103,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
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 ||
@@ -116,28 +116,28 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
desc_A.ContainerDuration != desc_B.ContainerDuration
// desc_A.ChannelFormat != desc_B.ChannelFormat ||
) {
-
+
note (DCP_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 (DCP_ERROR, String::compose ("sizes of audio data for frame %1 differ", i));
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]);
diff --git a/src/sound_asset.h b/src/sound_asset.h
index 5a7dc214..968f7dde 100644
--- a/src/sound_asset.h
+++ b/src/sound_asset.h
@@ -44,7 +44,7 @@ public:
SoundAsset (Fraction edit_rate, int sampling_rate, int channels);
boost::shared_ptr<SoundAssetWriter> start_write (boost::filesystem::path file, Standard standard);
-
+
bool equals (
boost::shared_ptr<const Asset> other,
EqualityOptions opt,
@@ -70,10 +70,10 @@ public:
int64_t intrinsic_duration () const {
return _intrinsic_duration;
}
-
+
private:
friend class SoundAssetWriter;
-
+
std::string pkl_type (Standard standard) const;
Fraction _edit_rate;
diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc
index 8d302ed3..4a27639e 100644
--- a/src/sound_asset_writer.cc
+++ b/src/sound_asset_writer.cc
@@ -50,13 +50,13 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* asset, boost::filesystem::path f
_state->audio_desc.AvgBps = _sound_asset->sampling_rate() * _state->audio_desc.BlockAlign;
_state->audio_desc.LinkedTrackID = 0;
_state->audio_desc.ChannelFormat = ASDCP::PCM::CF_NONE;
-
+
_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());
-
+
_sound_asset->fill_writer_info (&_state->writer_info, _sound_asset->id(), standard);
-
+
Kumu::Result_t r = _state->mxf_writer.OpenWrite (file.string().c_str(), _state->writer_info, _state->audio_desc);
if (ASDCP_FAILURE (r)) {
boost::throw_exception (FileError ("could not open audio MXF for writing", file.string(), r));
@@ -69,7 +69,7 @@ void
SoundAssetWriter::write (float const * const * data, int frames)
{
DCP_ASSERT (!_finalized);
-
+
for (int i = 0; i < frames; ++i) {
byte_t* out = _state->frame_buffer.Data() + _frame_buffer_offset;
@@ -111,7 +111,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_writer.h b/src/sound_asset_writer.h
index 8c54b618..3516efcb 100644
--- a/src/sound_asset_writer.h
+++ b/src/sound_asset_writer.h
@@ -56,7 +56,7 @@ private:
/* do this with an opaque pointer so we don't have to include
ASDCP headers
*/
-
+
struct ASDCPState;
boost::shared_ptr<ASDCPState> _state;
diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc
index 452c3675..76c353f1 100644
--- a/src/stereo_picture_asset.cc
+++ b/src/stereo_picture_asset.cc
@@ -39,7 +39,7 @@ StereoPictureAsset::StereoPictureAsset (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"));
@@ -82,13 +82,13 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError ("could not open MXF file for reading", file().string(), r));
}
-
+
ASDCP::JP2K::MXFSReader 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", 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"));
@@ -97,11 +97,11 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
boost::throw_exception (DCPReadError ("could not read video MXF information"));
}
-
+
if (!descriptor_equals (desc_A, desc_B, note)) {
return false;
}
-
+
shared_ptr<const StereoPictureAsset> other_picture = dynamic_pointer_cast<const StereoPictureAsset> (other);
DCP_ASSERT (other_picture);
@@ -118,7 +118,7 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
note (DCP_ERROR, e.what ());
return false;
}
-
+
if (!frame_buffer_equals (
i, opt, note,
frame_A->left_j2k_data(), frame_A->left_j2k_size(),
@@ -126,7 +126,7 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt,
)) {
return false;
}
-
+
if (!frame_buffer_equals (
i, opt, note,
frame_A->right_j2k_data(), frame_A->right_j2k_size(),
diff --git a/src/stereo_picture_asset.h b/src/stereo_picture_asset.h
index 2fe893de..533be758 100644
--- a/src/stereo_picture_asset.h
+++ b/src/stereo_picture_asset.h
@@ -23,8 +23,8 @@
#include "picture_asset.h"
namespace dcp {
-
-/** A 3D (stereoscopic) picture asset */
+
+/** A 3D (stereoscopic) picture asset */
class StereoPictureAsset : public PictureAsset
{
public:
@@ -39,7 +39,7 @@ public:
EqualityOptions opt,
NoteHandler note
) const;
-
+
boost::shared_ptr<const StereoPictureFrame> get_frame (int n) const;
};
diff --git a/src/stereo_picture_asset_writer.cc b/src/stereo_picture_asset_writer.cc
index be265d1e..f17e3d2f 100644
--- a/src/stereo_picture_asset_writer.cc
+++ b/src/stereo_picture_asset_writer.cc
@@ -89,7 +89,7 @@ StereoPictureAssetWriter::write (uint8_t* data, int size)
if (_next_eye == EYE_LEFT) {
++_frames_written;
}
-
+
return FrameInfo (before_offset, _state->mxf_writer.Tell() - before_offset, hash);
}
diff --git a/src/stereo_picture_asset_writer.h b/src/stereo_picture_asset_writer.h
index bd41b45e..f45aac3c 100644
--- a/src/stereo_picture_asset_writer.h
+++ b/src/stereo_picture_asset_writer.h
@@ -57,7 +57,7 @@ private:
/* do this with an opaque pointer so we don't have to include
ASDCP headers
*/
-
+
struct ASDCPState;
boost::shared_ptr<ASDCPState> _state;
diff --git a/src/stereo_picture_frame.cc b/src/stereo_picture_frame.cc
index 70e802d1..dd173613 100644
--- a/src/stereo_picture_frame.cc
+++ b/src/stereo_picture_frame.cc
@@ -77,7 +77,7 @@ StereoPictureFrame::xyz_image (Eye eye, int reduce) const
case RIGHT:
return decompress_j2k (const_cast<uint8_t*> (_buffer->Right.RoData()), _buffer->Right.Size(), reduce);
}
-
+
return shared_ptr<OpenJPEGImage> ();
}
diff --git a/src/stereo_picture_frame.h b/src/stereo_picture_frame.h
index e10167aa..5be764fe 100644
--- a/src/stereo_picture_frame.h
+++ b/src/stereo_picture_frame.h
@@ -34,7 +34,7 @@ namespace dcp {
class OpenJPEGImage;
-/** A single frame of a 3D (stereoscopic) picture asset */
+/** A single frame of a 3D (stereoscopic) picture asset */
class StereoPictureFrame : public boost::noncopyable
{
public:
@@ -47,7 +47,7 @@ public:
uint8_t const * left_j2k_data () const;
uint8_t* left_j2k_data ();
int left_j2k_size () const;
-
+
uint8_t const * right_j2k_data () const;
uint8_t* right_j2k_data ();
int right_j2k_size () const;
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 92da00bf..8d492727 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -83,10 +83,10 @@ SubtitleAsset::examine_font_nodes (
examine_font_nodes (xml, (*j)->font_nodes, parse_state);
parse_state.subtitle_nodes.pop_back ();
}
-
+
examine_font_nodes (xml, (*i)->font_nodes, parse_state);
examine_text_nodes (xml, (*i)->text_nodes, parse_state);
-
+
parse_state.font_nodes.pop_back ();
}
}
@@ -112,14 +112,14 @@ SubtitleAsset::maybe_add_subtitle (string text, ParseState const & parse_state)
if (empty_or_white_space (text)) {
return;
}
-
+
if (parse_state.text_nodes.empty() || parse_state.subtitle_nodes.empty ()) {
return;
}
DCP_ASSERT (!parse_state.text_nodes.empty ());
DCP_ASSERT (!parse_state.subtitle_nodes.empty ());
-
+
dcp::FontNode effective_font (parse_state.font_nodes);
dcp::TextNode effective_text (*parse_state.text_nodes.back ());
dcp::SubtitleNode effective_subtitle (*parse_state.subtitle_nodes.back ());
@@ -184,7 +184,7 @@ SubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptions opti
if (!Asset::equals (other_asset, options, note)) {
return false;
}
-
+
shared_ptr<const SubtitleAsset> other = dynamic_pointer_cast<const SubtitleAsset> (other_asset);
if (!other) {
return false;
@@ -302,7 +302,7 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* root, int time_code_rate, strin
if (i->h_position() > ALIGN_EPSILON) {
text->set_attribute ("HPosition", raw_convert<string> (i->h_position() * 100, 6));
}
- text->set_attribute ("VAlign", valign_to_string (i->v_align()));
+ text->set_attribute ("VAlign", valign_to_string (i->v_align()));
text->set_attribute ("VPosition", raw_convert<string> (i->v_position() * 100, 6));
text->add_child_text (i->text());
}
@@ -320,7 +320,7 @@ SubtitleAsset::add_font_data (string id, boost::filesystem::path file)
shared_array<uint8_t> data (new uint8_t[size]);
size_t const read = fread (data.get(), 1, size, f);
fclose (f);
-
+
if (read != size) {
throw FileError ("could not read font file", file, -1);
}
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index c28f6446..cc27f958 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -37,7 +37,7 @@ struct smpte_dcp_font_test;
namespace dcp
{
-class SubtitleString;
+class SubtitleString;
class FontNode;
class TextNode;
class SubtitleNode;
@@ -82,7 +82,7 @@ public:
protected:
friend struct ::interop_dcp_font_test;
friend struct ::smpte_dcp_font_test;
-
+
void parse_subtitles (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes);
void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, std::string xmlns) const;
void add_font_data (std::string id, boost::filesystem::path file);
@@ -93,11 +93,11 @@ protected:
class FileData : public Data {
public:
FileData () {}
-
+
FileData (boost::shared_array<uint8_t> data_, boost::uintmax_t size_)
: Data (data_, size_)
{}
-
+
/** .ttf file that this data was last written to */
mutable boost::optional<boost::filesystem::path> file;
};
@@ -107,7 +107,7 @@ protected:
* For SMPTE, the string is the font's URN from the subtitle file.
*/
std::map<std::string, FileData> _fonts;
-
+
private:
/** @struct ParseState
* @brief A struct to hold state when parsing a subtitle XML file.
@@ -119,13 +119,13 @@ private:
};
void maybe_add_subtitle (std::string text, ParseState const & parse_state);
-
+
void examine_font_nodes (
boost::shared_ptr<const cxml::Node> xml,
std::list<boost::shared_ptr<FontNode> > const & font_nodes,
ParseState& parse_state
);
-
+
void examine_text_nodes (
boost::shared_ptr<const cxml::Node> xml,
std::list<boost::shared_ptr<TextNode> > const & text_nodes,
diff --git a/src/subtitle_node.cc b/src/subtitle_node.cc
index 57476330..f53878b6 100644
--- a/src/subtitle_node.cc
+++ b/src/subtitle_node.cc
@@ -45,7 +45,7 @@ SubtitleNode::SubtitleNode (boost::shared_ptr<const cxml::Node> node, int tcr)
for (list<cxml::NodePtr>::iterator i = t.begin(); i != t.end(); ++i) {
text_nodes.push_back (shared_ptr<TextNode> (new TextNode (*i, tcr)));
}
-
+
fade_up_time = fade_time (node, "FadeUpTime", tcr);
fade_down_time = fade_time (node, "FadeDownTime", tcr);
}
@@ -55,7 +55,7 @@ SubtitleNode::fade_time (shared_ptr<const cxml::Node> node, string name, int tcr
{
string const u = node->optional_string_attribute (name).get_value_or ("");
Time t;
-
+
if (u.empty ()) {
t = Time (0, 0, 0, 20, 250);
} else if (u.find (":") != string::npos) {
diff --git a/src/subtitle_node.h b/src/subtitle_node.h
index d615557a..40189704 100644
--- a/src/subtitle_node.h
+++ b/src/subtitle_node.h
@@ -31,7 +31,7 @@ namespace cxml {
namespace dcp {
-class FontNode;
+class FontNode;
class TextNode;
class SubtitleNode
diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc
index cf0ddf41..d565d453 100644
--- a/src/subtitle_string.cc
+++ b/src/subtitle_string.cc
@@ -72,7 +72,7 @@ SubtitleString::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);
}
@@ -111,7 +111,7 @@ dcp::operator<< (ostream& s, SubtitleString const & sub)
} else {
s << "non-italic";
}
-
+
s << ", size " << sub.size() << ", aspect " << sub.aspect_adjust() << ", colour " << sub.colour()
<< ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align())
<< ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align())
diff --git a/src/subtitle_string.h b/src/subtitle_string.h
index 20cc1fe3..2dfdbe0a 100644
--- a/src/subtitle_string.h
+++ b/src/subtitle_string.h
@@ -158,7 +158,7 @@ private:
Colour _colour;
/** 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;
float _aspect_adjust;
Time _in;
diff --git a/src/text_node.cc b/src/text_node.cc
index 6332e1f5..666e5846 100644
--- a/src/text_node.cc
+++ b/src/text_node.cc
@@ -52,7 +52,7 @@ TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
if (hp) {
h_position = hp.get () / 100;
}
-
+
optional<string> ha = node->optional_string_attribute ("HAlign");
if (!ha) {
ha = node->optional_string_attribute ("Halign");
@@ -60,7 +60,7 @@ TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
if (ha) {
h_align = string_to_halign (ha.get ());
}
-
+
optional<float> vp = node->optional_number_attribute<float> ("VPosition");
if (!vp) {
vp = node->optional_number_attribute<float> ("Vposition");
@@ -68,7 +68,7 @@ TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
if (vp) {
v_position = vp.get () / 100;
}
-
+
optional<string> va = node->optional_string_attribute ("VAlign");
if (!va) {
va = node->optional_string_attribute ("Valign");
diff --git a/src/text_node.h b/src/text_node.h
index 7cd73bb9..1affd83f 100644
--- a/src/text_node.h
+++ b/src/text_node.h
@@ -47,7 +47,7 @@ public:
, v_position (0)
, v_align (VALIGN_TOP)
{}
-
+
TextNode (boost::shared_ptr<const cxml::Node> node, int tcr);
float h_position;
diff --git a/src/transfer_function.cc b/src/transfer_function.cc
index bf9b0f2b..bdd7ae9f 100644
--- a/src/transfer_function.cc
+++ b/src/transfer_function.cc
@@ -42,7 +42,7 @@ double const *
TransferFunction::lut (int bit_depth, bool inverse) const
{
boost::mutex::scoped_lock lm (_mutex);
-
+
map<pair<int, bool>, double*>::const_iterator i = _luts.find (make_pair (bit_depth, inverse));
if (i != _luts.end ()) {
return i->second;
diff --git a/src/types.cc b/src/types.cc
index f32d90bd..687e90f8 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -200,7 +200,7 @@ dcp::string_to_halign (string s)
} else if (s == "right") {
return HALIGN_RIGHT;
}
-
+
boost::throw_exception (DCPReadError ("unknown subtitle halign type"));
}
@@ -229,6 +229,6 @@ dcp::string_to_valign (string s)
} else if (s == "bottom") {
return VALIGN_BOTTOM;
}
-
+
boost::throw_exception (DCPReadError ("unknown subtitle valign type"));
}
diff --git a/src/types.h b/src/types.h
index bfcc5a3f..1cd116c9 100644
--- a/src/types.h
+++ b/src/types.h
@@ -49,7 +49,7 @@ struct Size
float ratio () const {
return float (width) / height;
}
-
+
int width;
int height;
};
@@ -147,7 +147,7 @@ public:
extern bool operator== (Fraction const & a, Fraction const & b);
extern bool operator!= (Fraction const & a, Fraction const & b);
-extern std::ostream& operator<< (std::ostream& s, Fraction const & f);
+extern std::ostream& operator<< (std::ostream& s, Fraction const & f);
/** @struct EqualityOptions
* @brief A class to describe what "equality" means for a particular test.
@@ -158,7 +158,7 @@ extern std::ostream& operator<< (std::ostream& s, Fraction const & f);
struct EqualityOptions
{
/** Construct an EqualityOptions where nothing at all can differ */
- EqualityOptions ()
+ EqualityOptions ()
: max_mean_pixel_error (0)
, max_std_dev_pixel_error (0)
, max_audio_sample_error (0)
diff --git a/src/util.cc b/src/util.cc
index cfaeafbe..139118ca 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -89,7 +89,7 @@ dcp::make_digest (boost::filesystem::path filename, function<void (float)> progr
if (ASDCP_FAILURE (r)) {
boost::throw_exception (FileError ("could not open file to compute digest", filename, r));
}
-
+
SHA_CTX sha;
SHA1_Init (&sha);
@@ -101,13 +101,13 @@ dcp::make_digest (boost::filesystem::path filename, function<void (float)> progr
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) {
@@ -166,7 +166,7 @@ dcp::ContentKind
dcp::content_kind_from_string (string kind)
{
transform (kind.begin(), kind.end(), kind.begin(), ::tolower);
-
+
if (kind == "feature") {
return FEATURE;
} else if (kind == "short") {
@@ -214,12 +214,12 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
0x20,
0x20
};
-
+
OPJ_CODEC_FORMAT format = CODEC_J2K;
if (size >= int (sizeof (jp2_magic)) && memcmp (data, jp2_magic, sizeof (jp2_magic)) == 0) {
format = CODEC_JP2;
}
-
+
opj_dinfo_t* decoder = opj_create_decompress (format);
if (!decoder) {
boost::throw_exception (DCPReadError ("could not create JPEG2000 decompresser"));
@@ -280,7 +280,7 @@ dcp::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");
@@ -332,7 +332,7 @@ dcp::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);
@@ -401,9 +401,9 @@ dcp::file_to_string (boost::filesystem::path p, uintmax_t max_length)
if (len > max_length) {
throw MiscError ("Unexpectedly long file");
}
-
+
char* c = new char[len + 1];
-
+
FILE* f = fopen_boost (p, "r");
if (!f) {
return "";
diff --git a/src/util.h b/src/util.h
index 52a5dcde..97ef2c55 100644
--- a/src/util.h
+++ b/src/util.h
@@ -44,7 +44,7 @@ class ARGBImage;
class CertificateChain;
class GammaLUT;
class OpenJPEGImage;
-
+
extern bool operator== (Size const & a, Size const & b);
extern bool operator!= (Size const & a, Size const & b);
extern std::ostream& operator<< (std::ostream& s, Size const & a);
@@ -84,7 +84,7 @@ list_of_type (std::list<boost::shared_ptr<F> > const & from)
return out;
}
-
+
}
#endif
diff --git a/src/version.h b/src/version.h
index 9b6dc65f..bd501382 100644
--- a/src/version.h
+++ b/src/version.h
@@ -4,5 +4,5 @@ namespace dcp {
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 b89d8ccd..f21edb4c 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -44,7 +44,7 @@ template <class T>
boost::shared_ptr<T> type_child (boost::shared_ptr<const cxml::Node> node, std::string name) {
return boost::shared_ptr<T> (new T (node->node_child (name)));
}
-
+
template <class T>
boost::shared_ptr<T>
optional_type_child (boost::shared_ptr<const cxml::Node> node, std::string name)
@@ -70,7 +70,7 @@ type_children (boost::shared_ptr<const cxml::Node> node, std::string name)
{
return type_children<T> (*node.get(), name);
}
-
+
template <class T>
std::list<boost::shared_ptr<T> >
type_grand_children (cxml::Node const & node, std::string name, std::string sub)
@@ -85,7 +85,7 @@ type_grand_children (boost::shared_ptr<const cxml::Node> node, std::string name,
{
return type_grand_children<T> (*node.get(), name, sub);
}
-
+
}
#endif