#include "openjpeg_image.h"
#include "colour_conversion.h"
#include "rgb_xyz.h"
+/* This DISABLE/ENABLE pair is just to ignore some warnings from Magick++.h; they
+ * can be removed.
+ */
+LIBDCP_DISABLE_WARNINGS
#include <Magick++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/scoped_array.hpp>
/** @file examples/read_dcp.cc
virtual ~ArrayData () {}
- uint8_t const * data () const {
+ uint8_t const * data () const override {
return _data.get();
}
- uint8_t * data () {
+ uint8_t * data () override {
return _data.get();
}
/** @return size of the data in _data, or whatever was last
* passed to a set_size() call
*/
- int size () const {
+ int size () const override {
return _size;
}
*/
-#include "raw_convert.h"
#include "asset.h"
-#include "util.h"
-#include "exceptions.h"
-#include "dcp_assert.h"
#include "compose.hpp"
+#include "dcp_assert.h"
+#include "exceptions.h"
#include "pkl.h"
+#include "raw_convert.h"
+#include "util.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/algorithm/string.hpp>
*/
+#include <boost/filesystem.hpp>
+#include <memory>
+
+
namespace dcp {
+class Asset;
+
+
std::shared_ptr<Asset> asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_mxf_type);
std::shared_ptr<AtmosAssetReader> start_read () const;
static std::string static_pkl_type (Standard);
- std::string pkl_type (Standard s) const {
+ std::string pkl_type (Standard s) const override {
return static_pkl_type (s);
}
public:
void write (std::shared_ptr<const AtmosFrame> frame);
void write (uint8_t const * data, int size);
- bool finalize ();
+ bool finalize () override;
private:
friend class AtmosAsset;
#include "certificate_chain.h"
+#include "compose.hpp"
+#include "dcp_assert.h"
#include "exceptions.h"
#include "util.h"
-#include "dcp_assert.h"
-#include "compose.hpp"
+#include "warnings.h"
#include <asdcp/KM_util.h>
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <xmlsec/xmldsig.h>
#include <xmlsec/dl.h>
#include <xmlsec/app.h>
*/
+#include "certificate_chain.h"
+#include "compose.hpp"
#include "cpl.h"
-#include "util.h"
-#include "reel.h"
+#include "dcp_assert.h"
+#include "local_time.h"
#include "metadata.h"
-#include "certificate_chain.h"
-#include "xml.h"
+#include "raw_convert.h"
+#include "reel.h"
+#include "reel_atmos_asset.h"
+#include "reel_closed_caption_asset.h"
#include "reel_picture_asset.h"
#include "reel_sound_asset.h"
#include "reel_subtitle_asset.h"
-#include "reel_closed_caption_asset.h"
-#include "reel_atmos_asset.h"
-#include "local_time.h"
-#include "dcp_assert.h"
-#include "compose.hpp"
-#include "raw_convert.h"
+#include "util.h"
+#include "warnings.h"
+#include "xml.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/Metadata.h>
+LIBDCP_ENABLE_WARNINGS
#include <libxml/parser.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/algorithm/string.hpp>
std::shared_ptr<const Asset> other,
EqualityOptions options,
NoteHandler note
- ) const;
+ ) const override;
/** Add a reel to this CPL
* @param reel Reel to add
protected:
/** @return type string for PKLs for this asset */
- std::string pkl_type (Standard standard) const;
+ std::string pkl_type (Standard standard) const override;
private:
friend struct ::verify_invalid_language3;
*/
-#include "raw_convert.h"
-#include "dcp.h"
-#include "sound_asset.h"
+#include "asset_factory.h"
#include "atmos_asset.h"
-#include "picture_asset.h"
-#include "interop_subtitle_asset.h"
-#include "smpte_subtitle_asset.h"
-#include "mono_picture_asset.h"
-#include "stereo_picture_asset.h"
-#include "reel_subtitle_asset.h"
-#include "util.h"
-#include "metadata.h"
-#include "exceptions.h"
-#include "cpl.h"
#include "certificate_chain.h"
#include "compose.hpp"
+#include "cpl.h"
+#include "dcp.h"
+#include "dcp_assert.h"
#include "decrypted_kdm.h"
#include "decrypted_kdm_key.h"
-#include "dcp_assert.h"
-#include "reel_asset.h"
+#include "exceptions.h"
#include "font_asset.h"
+#include "interop_subtitle_asset.h"
+#include "metadata.h"
+#include "mono_picture_asset.h"
+#include "picture_asset.h"
#include "pkl.h"
-#include "asset_factory.h"
+#include "raw_convert.h"
+#include "reel_asset.h"
+#include "reel_subtitle_asset.h"
+#include "smpte_subtitle_asset.h"
+#include "sound_asset.h"
+#include "stereo_picture_asset.h"
+#include "util.h"
#include "verify.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
+LIBDCP_ENABLE_WARNINGS
#include <xmlsec/xmldsig.h>
#include <xmlsec/app.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <numeric>
static std::string static_pkl_type (Standard standard);
private:
- std::string pkl_type (Standard standard) const {
+ std::string pkl_type (Standard standard) const override {
return static_pkl_type (standard);
}
};
return _gamma;
}
- bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const;
+ bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- double * make_lut (int bit_depth, bool inverse) const;
+ double * make_lut (int bit_depth, bool inverse) const override;
private:
double _gamma;
class IdentityTransferFunction : public TransferFunction
{
public:
- bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const;
+ bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- double * make_lut (int bit_depth, bool inverse) const;
+ double * make_lut (int bit_depth, bool inverse) const override;
};
*/
-#include "interop_subtitle_asset.h"
+#include "compose.hpp"
+#include "dcp_assert.h"
+#include "font_asset.h"
#include "interop_load_font_node.h"
-#include "subtitle_asset_internal.h"
-#include "xml.h"
+#include "interop_subtitle_asset.h"
#include "raw_convert.h"
-#include "util.h"
-#include "font_asset.h"
-#include "dcp_assert.h"
-#include "compose.hpp"
+#include "subtitle_asset_internal.h"
#include "subtitle_image.h"
+#include "util.h"
+#include "warnings.h"
+#include "xml.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/weak_ptr.hpp>
#include <cmath>
#include <cstdio>
#define LIBDCP_KEY_H
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
+LIBDCP_ENABLE_WARNINGS
#include <stdint.h>
#include <string>
LanguageSubtag (char const* subtag)
: Subtag(subtag, SubtagType::LANGUAGE) {}
- SubtagType type () const {
+ SubtagType type () const override {
return SubtagType::LANGUAGE;
}
};
ScriptSubtag (char const* subtag)
: Subtag(subtag, SubtagType::SCRIPT) {}
- SubtagType type () const {
+ SubtagType type () const override {
return SubtagType::SCRIPT;
}
};
RegionSubtag (char const* subtag)
: Subtag(subtag, SubtagType::REGION) {}
- SubtagType type () const {
+ SubtagType type () const override {
return SubtagType::REGION;
}
};
VariantSubtag (char const* subtag)
: Subtag(subtag, SubtagType::VARIANT) {}
- SubtagType type () const {
+ SubtagType type () const override {
return SubtagType::VARIANT;
}
ExtlangSubtag (char const* subtag)
: Subtag(subtag, SubtagType::EXTLANG) {}
- SubtagType type () const {
+ SubtagType type () const override {
return SubtagType::EXTLANG;
}
return _B;
}
- bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const;
+ bool about_equal (std::shared_ptr<const TransferFunction>, double epsilon) const override;
protected:
- double * make_lut (int bit_depth, bool inverse) const;
+ double * make_lut (int bit_depth, bool inverse) const override;
private:
double _power;
*/
-#include "mono_picture_asset_writer.h"
+#include "crypto_context.h"
+#include "dcp_assert.h"
#include "exceptions.h"
+#include "mono_picture_asset_writer.h"
#include "picture_asset.h"
-#include "dcp_assert.h"
-#include "crypto_context.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
#include <asdcp/KM_fileio.h>
+LIBDCP_ENABLE_WARNINGS
#include "picture_asset_writer_common.cc"
class MonoPictureAssetWriter : public PictureAssetWriter
{
public:
- FrameInfo write (uint8_t const *, int);
- void fake_write (int size);
- bool finalize ();
+ FrameInfo write (uint8_t const *, int) override;
+ void fake_write (int size) override;
+ bool finalize () override;
private:
friend class MonoPictureAsset;
std::shared_ptr<OpenJPEGImage> xyz_image (int reduce = 0) const;
/** @return Pointer to JPEG2000 data */
- uint8_t const * data () const;
+ uint8_t const * data () const override;
/** @return Pointer to JPEG2000 data */
- uint8_t* data ();
+ uint8_t* data () override;
/** @return Size of JPEG2000 data in bytes */
- int size () const;
+ int size () const override;
private:
/* XXX: this is a bit of a shame, but I tried friend MonoPictureAssetReader and it's
Fraction _screen_aspect_ratio;
private:
- std::string pkl_type (Standard standard) const;
+ std::string pkl_type (Standard standard) const override;
};
*/
-#include "pkl.h"
+#include "dcp_assert.h"
#include "exceptions.h"
-#include "util.h"
+#include "pkl.h"
#include "raw_convert.h"
-#include "dcp_assert.h"
+#include "util.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <iostream>
*/
-#include "raw_convert.h"
-#include "reel_asset.h"
#include "asset.h"
#include "compose.hpp"
#include "dcp_assert.h"
+#include "raw_convert.h"
+#include "reel_asset.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::pair;
#include "atmos_asset.h"
#include "reel_atmos_asset.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::string;
*/
-#include "subtitle_asset.h"
+#include "dcp_assert.h"
#include "reel_closed_caption_asset.h"
#include "smpte_subtitle_asset.h"
-#include "dcp_assert.h"
+#include "subtitle_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::string;
#include "asset.h"
#include "reel_file_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::shared_ptr;
#include "reel_interop_closed_caption_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::make_pair;
xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override;
private:
- std::string cpl_node_name (Standard) const;
+ std::string cpl_node_name (Standard) const override;
std::pair<std::string, std::string> cpl_node_namespace () const override;
};
#include "reel_interop_subtitle_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::shared_ptr;
*/
-#include "reel_markers_asset.h"
-#include "raw_convert.h"
#include "dcp_assert.h"
+#include "raw_convert.h"
+#include "reel_markers_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::string;
ReelMarkersAsset (Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
explicit ReelMarkersAsset (std::shared_ptr<const cxml::Node>);
- xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override;
bool equals (std::shared_ptr<const ReelMarkersAsset>, EqualityOptions, NoteHandler) const;
void set (Marker, Time);
}
protected:
- std::string cpl_node_name (Standard) const;
+ std::string cpl_node_name (Standard) const override;
private:
std::map<Marker, Time> _markers;
}
private:
- std::string cpl_node_name (Standard standard) const;
+ std::string cpl_node_name (Standard standard) const override;
};
*/
-#include "reel_picture_asset.h"
-#include "picture_asset.h"
+#include "compose.hpp"
#include "dcp_assert.h"
+#include "picture_asset.h"
#include "raw_convert.h"
-#include "compose.hpp"
+#include "reel_picture_asset.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <iomanip>
#include <cmath>
#include "reel_smpte_closed_caption_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::make_pair;
#include "reel_smpte_subtitle_asset.h"
#include "smpte_subtitle_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::shared_ptr;
*/
-#include "reel_sound_asset.h"
#include "dcp_assert.h"
+#include "reel_sound_asset.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::string;
bool equals (std::shared_ptr<const ReelSoundAsset>, EqualityOptions, NoteHandler) const;
private:
- boost::optional<std::string> key_type () const;
- std::string cpl_node_name (Standard standard) const;
+ boost::optional<std::string> key_type () const override;
+ std::string cpl_node_name (Standard standard) const override;
};
}
private:
- std::string cpl_node_name (Standard standard) const;
- std::pair<std::string, std::string> cpl_node_attribute (Standard standard) const;
+ std::string cpl_node_name (Standard standard) const override;
+ std::pair<std::string, std::string> cpl_node_attribute (Standard standard) const override;
};
#include "language_tag.h"
-#include "subtitle_asset.h"
#include "reel_subtitle_asset.h"
#include "smpte_subtitle_asset.h"
+#include "subtitle_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
using std::string;
class SGamut3TransferFunction : public TransferFunction
{
public:
- bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const;
+ bool about_equal (std::shared_ptr<const TransferFunction> other, double epsilon) const override;
protected:
- double * make_lut (int bit_depth, bool inverse) const;
+ double * make_lut (int bit_depth, bool inverse) const override;
};
*/
-#include "smpte_subtitle_asset.h"
-#include "smpte_load_font_node.h"
-#include "exceptions.h"
-#include "xml.h"
-#include "raw_convert.h"
-#include "dcp_assert.h"
-#include "util.h"
#include "compose.hpp"
#include "crypto_context.h"
+#include "dcp_assert.h"
+#include "exceptions.h"
+#include "raw_convert.h"
+#include "smpte_load_font_node.h"
+#include "smpte_subtitle_asset.h"
#include "subtitle_image.h"
+#include "util.h"
+#include "warnings.h"
+#include "xml.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
#include <asdcp/KM_util.h>
#include <asdcp/KM_log.h>
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/algorithm/string.hpp>
std::shared_ptr<const Asset>,
EqualityOptions,
NoteHandler note
- ) const;
+ ) const override;
- std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes () const;
+ std::vector<std::shared_ptr<LoadFontNode>> load_font_nodes () const override;
- std::string xml_as_string () const;
+ std::string xml_as_string () const override;
/** Write this content to a MXF file */
- void write (boost::filesystem::path path) const;
+ void write (boost::filesystem::path path) const override;
- void add (std::shared_ptr<Subtitle>);
- void add_font (std::string id, dcp::ArrayData data);
- void set_key (Key key);
+ void add (std::shared_ptr<Subtitle>) override;
+ void add_font (std::string id, dcp::ArrayData data) override;
+ void set_key (Key key) override;
void set_content_title_text (std::string t) {
_content_title_text = t;
* e.g. a time_code_rate of 250 means that a subtitle time of 0:0:0:001
* represents 4ms.
*/
- int time_code_rate () const {
+ int time_code_rate () const override {
return _time_code_rate;
}
protected:
- std::string pkl_type (Standard s) const {
+ std::string pkl_type (Standard s) const override {
return static_pkl_type (s);
}
*/
-#include "sound_asset.h"
-#include "util.h"
-#include "exceptions.h"
-#include "sound_frame.h"
-#include "sound_asset_writer.h"
-#include "sound_asset_reader.h"
#include "compose.hpp"
#include "dcp_assert.h"
+#include "exceptions.h"
+#include "sound_asset.h"
+#include "sound_asset_reader.h"
+#include "sound_asset_writer.h"
+#include "sound_frame.h"
+#include "util.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
#include <asdcp/KM_fileio.h>
#include <asdcp/Metadata.h>
+LIBDCP_ENABLE_WARNINGS
#include <libxml++/nodes/element.h>
#include <boost/filesystem.hpp>
#include <stdexcept>
std::shared_ptr<const Asset> other,
EqualityOptions opt,
NoteHandler note
- ) const;
+ ) const override;
/** @return number of channels */
int channels () const {
boost::filesystem::path path, std::string suffix, dcp::MXFMetadata mxf_meta, std::string language, int frames, int sample_rate
);
- std::string pkl_type (Standard standard) const {
+ std::string pkl_type (Standard standard) const override {
return static_pkl_type (standard);
}
#include "bitstream.h"
-#include "sound_asset_writer.h"
-#include "sound_asset.h"
-#include "exceptions.h"
-#include "dcp_assert.h"
#include "compose.hpp"
#include "crypto_context.h"
+#include "dcp_assert.h"
+#include "exceptions.h"
+#include "sound_asset.h"
+#include "sound_asset_writer.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/AS_DCP.h>
#include <asdcp/Metadata.h>
+LIBDCP_ENABLE_WARNINGS
#include <iostream>
if (field == MCASoundField::SEVEN_POINT_ONE) {
soundfield->MCATagSymbol = "sg71";
soundfield->MCATagName = "7.1DS";
+LIBDCP_DISABLE_WARNINGS
soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_71);
+LIBDCP_ENABLE_WARNINGS
} else {
soundfield->MCATagSymbol = "sg51";
soundfield->MCATagName = "5.1";
+LIBDCP_DISABLE_WARNINGS
soundfield->MCALabelDictionaryID = asdcp_smpte_dict->ul(ASDCP::MDD_DCAudioSoundfield_51);
+LIBDCP_ENABLE_WARNINGS
}
_state->mxf_writer.OP1aHeader().AddChildObject(soundfield);
if (auto lang = _asset->language()) {
channel->RFC5646SpokenLanguage = *lang;
}
+LIBDCP_DISABLE_WARNINGS
channel->MCALabelDictionaryID = channel_to_mca_universal_label(dcp_channel, field, asdcp_smpte_dict);
+LIBDCP_ENABLE_WARNINGS
_state->mxf_writer.OP1aHeader().AddChildObject(channel);
essence_descriptor->SubDescriptors.push_back(channel->InstanceUID);
}
*/
void write (float const * const *, int);
- bool finalize ();
+ bool finalize () override;
private:
friend class SoundAsset;
* @param data JPEG2000 data.
* @param size Size of data.
*/
- FrameInfo write (uint8_t const * data, int size);
- void fake_write (int size);
- bool finalize ();
+ FrameInfo write (uint8_t const * data, int size) override;
+ void fake_write (int size) override;
+ bool finalize () override;
private:
friend class StereoPictureAsset;
public:
Part (std::shared_ptr<ASDCP::JP2K::SFrameBuffer> buffer, Eye eye);
- uint8_t const * data () const;
- uint8_t * data ();
- int size () const;
+ uint8_t const * data () const override;
+ uint8_t * data () override;
+ int size () const override;
private:
friend class StereoPictureFrame;
std::shared_ptr<const Asset>,
EqualityOptions,
NoteHandler note
- ) const;
+ ) const override;
std::vector<std::shared_ptr<const Subtitle>> subtitles_during (Time from, Time to, bool starting) const;
std::vector<std::shared_ptr<const Subtitle>> subtitles_in_reel(std::shared_ptr<const dcp::ReelAsset> asset) const;
#include "array_data.h"
+#include "dcp_time.h"
#include "raw_convert.h"
#include "types.h"
-#include "dcp_time.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
struct take_intersection_test;
, text (text_)
{}
- virtual xmlpp::Element* as_xml (xmlpp::Element* parent, Context &) const;
+ virtual xmlpp::Element* as_xml (xmlpp::Element* parent, Context &) const override;
std::string text;
};
, _direction (direction)
{}
- xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const;
+ xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override;
private:
HAlign _h_align;
, _fade_down (fade_down)
{}
- xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const;
+ xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override;
private:
Time _in;
, _v_position (v_position)
{}
- xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const;
+ xmlpp::Element* as_xml (xmlpp::Element* parent, Context& context) const override;
private:
ArrayData _png_data;
*/
-#include "raw_convert.h"
-#include "types.h"
-#include "exceptions.h"
#include "compose.hpp"
#include "dcp_assert.h"
+#include "exceptions.h"
+#include "raw_convert.h"
+#include "types.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/algorithm/string.hpp>
#include <string>
#include <vector>
#define LIBDCP_TYPES_H
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/KLV.h>
+LIBDCP_ENABLE_WARNINGS
#include <memory>
#include <boost/function.hpp>
#include <string>
#include "array_data.h"
-#include "types.h"
#include "local_time.h"
+#include "types.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/KM_log.h>
-#include <memory>
-#include <boost/function.hpp>
+LIBDCP_ENABLE_WARNINGS
#include <boost/filesystem.hpp>
+#include <boost/function.hpp>
#include <boost/optional.hpp>
+#include <memory>
#include <string>
#include <stdint.h>
class DCPErrorHandler : public ErrorHandler
{
public:
- void warning(const SAXParseException& e)
+ void warning(const SAXParseException& e) override
{
maybe_add (XMLValidationError(e));
}
- void error(const SAXParseException& e)
+ void error(const SAXParseException& e) override
{
maybe_add (XMLValidationError(e));
}
- void fatalError(const SAXParseException& e)
+ void fatalError(const SAXParseException& e) override
{
maybe_add (XMLValidationError(e));
}
- void resetErrors() {
+ void resetErrors() override {
_errors.clear ();
}
add("http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL", "SMPTE-429-10-2008.xsd");
}
- InputSource* resolveEntity(XMLCh const *, XMLCh const * system_id)
+ InputSource* resolveEntity(XMLCh const *, XMLCh const * system_id) override
{
if (!system_id) {
return 0;
#include <boost/bind.hpp>
#include <boost/test/unit_test.hpp>
+
using std::string;
using std::shared_ptr;
+using std::make_shared;
+
class DummyAsset : public dcp::Asset
{
protected:
- std::string pkl_type (dcp::Standard) const {
+ std::string pkl_type (dcp::Standard) const override {
return "none";
}
};
-static void
-note_handler (dcp::NoteType, string)
-{
-
-}
/** Test a few dusty corners of Asset */
BOOST_AUTO_TEST_CASE (asset_test)
{
- shared_ptr<DummyAsset> a (new DummyAsset);
+ auto a = make_shared<DummyAsset>();
a->_hash = "abc";
- shared_ptr<DummyAsset> b (new DummyAsset);
+ auto b = make_shared<DummyAsset>();
b->_hash = "def";
- BOOST_CHECK (!a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2)));
+ auto ignore = [](dcp::NoteType, string) {};
+
+ BOOST_CHECK (!a->equals(b, dcp::EqualityOptions(), ignore));
b->_hash = "abc";
- BOOST_CHECK (a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2)));
+ BOOST_CHECK (a->equals(b, dcp::EqualityOptions(), ignore));
b->_file = "foo/bar/baz";
- BOOST_CHECK (a->equals (b, dcp::EqualityOptions (), boost::bind (¬e_handler, _1, _2)));
+ BOOST_CHECK (a->equals(b, dcp::EqualityOptions(), ignore));
}
files in the program, then also delete it here.
*/
+
#include "cpl.h"
-#include "reel_mono_picture_asset.h"
#include "mono_picture_asset.h"
+#include "reel_mono_picture_asset.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
+
using std::string;
using std::shared_ptr;
using std::make_shared;
{
pa->set_screen_aspect_ratio (far);
xmlpp::Document doc;
- xmlpp::Element* el = doc.create_root_node ("Test");
+ auto el = doc.create_root_node ("Test");
pa->write_to_cpl (el, dcp::Standard::INTEROP);
cxml::Node node (el);
BOOST_CHECK_EQUAL (node.node_child("MainPicture")->string_child ("ScreenAspectRatio"), sar);
}
+
/** Test for a reported bug where <ScreenAspectRatio> in Interop files uses
* excessive decimal places and (sometimes) the wrong decimal point character.
* Also check that we correctly use one of the allowed <ScreenAspectRatio>
);
/* Easy ones */
- check (pa, dcp::Fraction (1998, 1080), "1.85");
- check (pa, dcp::Fraction (2048, 858), "2.39");
+ check (pa, dcp::Fraction(1998, 1080), "1.85");
+ check (pa, dcp::Fraction(2048, 858), "2.39");
/* Check the use of the allowed values */
/* Just less then, equal to and just more than 1.33 */
- check (pa, dcp::Fraction (1200, 1000), "1.33");
- check (pa, dcp::Fraction (1330, 1000), "1.33");
- check (pa, dcp::Fraction (1430, 1000), "1.33");
+ check (pa, dcp::Fraction(1200, 1000), "1.33");
+ check (pa, dcp::Fraction(1330, 1000), "1.33");
+ check (pa, dcp::Fraction(1430, 1000), "1.33");
/* Same for 1.66 */
- check (pa, dcp::Fraction (1600, 1000), "1.66");
- check (pa, dcp::Fraction (1660, 1000), "1.66");
- check (pa, dcp::Fraction (1670, 1000), "1.66");
+ check (pa, dcp::Fraction(1600, 1000), "1.66");
+ check (pa, dcp::Fraction(1660, 1000), "1.66");
+ check (pa, dcp::Fraction(1670, 1000), "1.66");
/* 1.77 */
- check (pa, dcp::Fraction (1750, 1000), "1.77");
- check (pa, dcp::Fraction (1770, 1000), "1.77");
- check (pa, dcp::Fraction (1800, 1000), "1.77");
+ check (pa, dcp::Fraction(1750, 1000), "1.77");
+ check (pa, dcp::Fraction(1770, 1000), "1.77");
+ check (pa, dcp::Fraction(1800, 1000), "1.77");
/* 1.85 */
- check (pa, dcp::Fraction (1820, 1000), "1.85");
- check (pa, dcp::Fraction (1850, 1000), "1.85");
- check (pa, dcp::Fraction (1910, 1000), "1.85");
+ check (pa, dcp::Fraction(1820, 1000), "1.85");
+ check (pa, dcp::Fraction(1850, 1000), "1.85");
+ check (pa, dcp::Fraction(1910, 1000), "1.85");
/* 2.00 */
- check (pa, dcp::Fraction (1999, 1000), "2.00");
- check (pa, dcp::Fraction (2000, 1000), "2.00");
- check (pa, dcp::Fraction (2001, 1000), "2.00");
+ check (pa, dcp::Fraction(1999, 1000), "2.00");
+ check (pa, dcp::Fraction(2000, 1000), "2.00");
+ check (pa, dcp::Fraction(2001, 1000), "2.00");
/* 2.39 */
- check (pa, dcp::Fraction (2350, 1000), "2.39");
- check (pa, dcp::Fraction (2390, 1000), "2.39");
- check (pa, dcp::Fraction (2500, 1000), "2.39");
+ check (pa, dcp::Fraction(2350, 1000), "2.39");
+ check (pa, dcp::Fraction(2390, 1000), "2.39");
+ check (pa, dcp::Fraction(2500, 1000), "2.39");
}
files in the program, then also delete it here.
*/
+
#include "interop_load_font_node.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
+
+using std::make_shared;
+
+
/** Test dcp::InteropLoadFont's simple constructor */
BOOST_AUTO_TEST_CASE (interop_load_font_test1)
{
text->set_attribute("Id", "my-great-id");
text->set_attribute("URI", "my-great-uri");
- dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ dcp::InteropLoadFontNode lf (make_shared<cxml::Node>(text));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
}
text->set_attribute("ID", "my-great-id");
text->set_attribute("URI", "my-great-uri");
- dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ dcp::InteropLoadFontNode lf (make_shared<cxml::Node>(text));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
}
files in the program, then also delete it here.
*/
-#include "encrypted_kdm.h"
-#include "decrypted_kdm.h"
+
#include "certificate_chain.h"
-#include "util.h"
-#include "test.h"
#include "cpl.h"
+#include "decrypted_kdm.h"
+#include "encrypted_kdm.h"
#include "mono_picture_asset.h"
-#include "reel_mono_picture_asset.h"
+#include "picture_asset_writer.h"
#include "reel.h"
+#include "reel_mono_picture_asset.h"
+#include "test.h"
#include "types.h"
-#include "picture_asset_writer.h"
+#include "util.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
+
using std::list;
using std::string;
using std::vector;
using std::shared_ptr;
using boost::optional;
+
/** Check reading and decryption of a KDM */
BOOST_AUTO_TEST_CASE (kdm_test)
{
BOOST_CHECK_EQUAL (keys.back().key().hex(), "5327fb7ec2e807bd57059615bf8a169d");
}
+
/** Check that we can read in a KDM and then write it back out again the same */
BOOST_AUTO_TEST_CASE (kdm_passthrough_test)
{
);
}
+
/** Test some of the utility methods of DecryptedKDM */
BOOST_AUTO_TEST_CASE (decrypted_kdm_test)
{
delete[] data;
}
+
/** Check that <KeyType> tags have the scope attribute.
* Wolfgang Woehl believes this is compulsory and I am more-or-less inclined to agree.
*/
}
}
+
static cxml::ConstNodePtr
kdm_forensic_test (cxml::Document& doc, bool picture, optional<int> audio)
{
optional_node_child("ForensicMarkFlagList");
}
+
/** Check ForensicMarkFlagList handling: disable picture and all audio */
BOOST_AUTO_TEST_CASE (kdm_forensic_test1)
{
BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable");
}
+
/** Check ForensicMarkFlagList handling: disable picture but not audio */
BOOST_AUTO_TEST_CASE (kdm_forensic_test2)
{
BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-picture-disable");
}
+
/** Check ForensicMarkFlagList handling: disable audio but not picture */
BOOST_AUTO_TEST_CASE (kdm_forensic_test3)
{
BOOST_CHECK_EQUAL (flags.front()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable");
}
+
/** Check ForensicMarkFlagList handling: disable picture and audio above channel 3 */
BOOST_AUTO_TEST_CASE (kdm_forensic_test4)
{
BOOST_CHECK_EQUAL (flags.back()->content(), "http://www.smpte-ra.org/430-1/2006/KDM#mrkflg-audio-disable-above-channel-3");
}
+
/** Check ForensicMarkFlagList handling: disable neither */
BOOST_AUTO_TEST_CASE (kdm_forensic_test5)
{
BOOST_CHECK (!forensic);
}
+
/** Check that KDM validity periods are checked for being within the certificate validity */
BOOST_AUTO_TEST_CASE (validity_period_test1)
{
#include "sound_asset.h"
#include "sound_asset_writer.h"
#include "test.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
files in the program, then also delete it here.
*/
+
#include "smpte_load_font_node.h"
+#include "warnings.h"
#include <libcxml/cxml.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
+
+using std::make_shared;
+
+
/** Test dcp::SMPTELoadFontNode */
BOOST_AUTO_TEST_CASE (smpte_load_font_test1)
{
xmlpp::Document doc;
- xmlpp::Element* text = doc.create_root_node("Font");
+ auto text = doc.create_root_node("Font");
text->set_attribute ("ID", "my-great-id");
text->add_child_text ("urn:uuid:my-great-urn");
- dcp::SMPTELoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ dcp::SMPTELoadFontNode lf (make_shared<cxml::Node>(text));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
BOOST_CHECK_EQUAL (lf.urn, "my-great-urn");
#include "sound_asset_writer.h"
#include "test.h"
#include "util.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
#include <asdcp/KM_util.h>
#include <asdcp/KM_prng.h>
+LIBDCP_ENABLE_WARNINGS
#include <sndfile.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
#include <cstdio>
#include <iostream>
files in the program, then also delete it here.
*/
-#include "dcp.h"
+
+#include "asset_factory.h"
#include "cpl.h"
+#include "dcp.h"
#include "exceptions.h"
-#include "asset_factory.h"
#include "reel_asset.h"
+#include "warnings.h"
#include <getopt.h>
+LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/filesystem.hpp>
#include <iostream>
+
using std::cerr;
using std::cout;
-using std::string;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
using std::vector;
using boost::optional;
+
static void
help (string n)
{
<< " -o, --output output DCP directory\n";
}
+
void progress (float f)
{
cout << (f * 100) << "% \r";
}
+
int
main (int argc, char* argv[])
{
/* Look for a CPL */
shared_ptr<dcp::CPL> cpl;
- for (boost::filesystem::directory_iterator i(dcp_dir); i != boost::filesystem::directory_iterator(); ++i) {
- if (i->path().extension() == ".xml") {
+ for (auto i: boost::filesystem::directory_iterator(dcp_dir)) {
+ if (i.path().extension() == ".xml") {
try {
- cpl.reset(new dcp::CPL(i->path()));
+ cpl = make_shared<dcp::CPL>(i.path());
} catch (dcp::ReadError& e) {
cout << "Error: " << e.what() << "\n";
} catch (xmlpp::parse_error& e) {
/* Read all MXF assets */
vector<shared_ptr<dcp::Asset>> assets;
- for (boost::filesystem::directory_iterator i(dcp_dir); i != boost::filesystem::directory_iterator(); ++i) {
- if (i->path().extension() == ".mxf") {
+ for (auto i: boost::filesystem::directory_iterator(dcp_dir)) {
+ if (i.path().extension() == ".mxf") {
try {
- shared_ptr<dcp::Asset> asset = dcp::asset_factory(i->path(), true);
- asset->set_file (*output / i->path().filename());
- cout << "Hashing " << i->path().filename() << "\n";
+ auto asset = dcp::asset_factory(i.path(), true);
+ asset->set_file (*output / i.path().filename());
+ cout << "Hashing " << i.path().filename() << "\n";
asset->hash (&progress);
cout << "100% \n";
assets.push_back (asset);
def configure(conf):
conf.load('compiler_cxx')
conf.load('clang_compilation_database', tooldir=['waf-tools'])
- conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS', '-std=c++11'])
+ conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-Wsuggest-override', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS', '-std=c++11'])
gcc = conf.env['CC_VERSION']
if int(gcc[0]) >= 4 and int(gcc[1]) > 1:
conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])