43 LIBDCP_DISABLE_WARNINGS
44 #include <libxml++/libxml++.h>
45 LIBDCP_ENABLE_WARNINGS
48 using std::shared_ptr;
50 using boost::optional;
54 ReelFileAsset::ReelFileAsset (shared_ptr<Asset> asset, optional<string> key_id, std::string
id,
Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
55 :
ReelAsset (id, edit_rate, intrinsic_duration, entry_point)
57 , _hash (asset->hash())
64 ReelFileAsset::ReelFileAsset (shared_ptr<const cxml::Node> node)
66 , _asset_ref (remove_urn_uuid(node->string_child(
"Id")))
67 , _hash (node->optional_string_child(
"Hash"))
68 , _key_id (node->optional_string_child(
"KeyId"))
71 _key_id = remove_urn_uuid (*_key_id);
77 ReelFileAsset::file_asset_equals (shared_ptr<const ReelFileAsset> other,
EqualityOptions opt, NoteHandler note)
const
79 if (
_hash != other->_hash) {
81 note (NoteType::ERROR,
"Reel: hashes differ");
84 note (NoteType::NOTE,
"Reel: hashes differ");
89 return _asset_ref->equals (other->_asset_ref.asset(), opt, note);
97 ReelFileAsset::write_to_cpl (xmlpp::Node* node, Standard standard)
const
99 auto asset = ReelAsset::write_to_cpl (node, standard);
101 asset->add_child(
"KeyId")->add_child_text(
"urn:uuid:" + *
_key_id);
104 asset->add_child(
"Hash")->add_child_text(*
_hash);
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
Namespace for everything in libdcp.
A class to describe what "equality" means for a particular test.
bool reel_hashes_can_differ