44 LIBDCP_DISABLE_WARNINGS
45 #include <libxml++/libxml++.h>
46 LIBDCP_ENABLE_WARNINGS
49 using std::shared_ptr;
51 using boost::optional;
55 ReelFileAsset::ReelFileAsset (shared_ptr<Asset> asset, optional<string> key_id, std::string
id,
Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
56 :
ReelAsset (id, edit_rate, intrinsic_duration, entry_point)
58 , _hash (asset->hash())
65 ReelFileAsset::ReelFileAsset (shared_ptr<const cxml::Node> node)
67 , _asset_ref (remove_urn_uuid(node->string_child(
"Id")))
68 , _hash (node->optional_string_child(
"Hash"))
69 , _key_id (node->optional_string_child(
"KeyId"))
72 _key_id = remove_urn_uuid (*_key_id);
78 ReelFileAsset::file_asset_equals(shared_ptr<const ReelFileAsset> other,
EqualityOptions const& opt, NoteHandler note)
const
80 if (
_hash != other->_hash) {
82 note (NoteType::ERROR,
"Reel: hashes differ");
85 note (NoteType::NOTE,
"Reel: hashes differ");
90 return _asset_ref->equals (other->_asset_ref.asset(), opt, note);
98 ReelFileAsset::write_to_cpl(xmlpp::Element* node, Standard standard)
const
100 auto asset = ReelAsset::write_to_cpl(node, standard);
102 cxml::add_text_child(asset,
"KeyId",
"urn:uuid:" + *
_key_id);
105 cxml::add_text_child(asset,
"Hash", *
_hash);
A class to describe what "equality" means for a particular test.
bool reel_hashes_can_differ
A fraction (i.e. a thing with an integer numerator and an integer denominator).
An entry in a <Reel> which refers to a use of a piece of content.
boost::optional< std::string > _key_id
The <KeyId> from the reel's entry for this asset, if there is one.
boost::optional< std::string > _hash
Class to describe what equality means when calling Asset::equals().
Namespace for everything in libdcp.