This is also unavailable if the asset is encrypted.
root->set_namespace_declaration (subtitle_smpte_ns, "dcst");
root->set_namespace_declaration ("http://www.w3.org/2001/XMLSchema", "xs");
- root->add_child("Id", "dcst")->add_child_text ("urn:uuid:" + _xml_id);
+ DCP_ASSERT (_xml_id);
+ root->add_child("Id", "dcst")->add_child_text ("urn:uuid:" + *_xml_id);
root->add_child("ContentTitleText", "dcst")->add_child_text (_content_title_text);
if (_annotation_text) {
root->add_child("AnnotationText", "dcst")->add_child_text (_annotation_text.get ());
descriptor.NamespaceName = subtitle_smpte_ns;
unsigned int c;
- Kumu::hex2bin (_xml_id.c_str(), descriptor.AssetID, ASDCP::UUIDlen, &c);
+ DCP_ASSERT (_xml_id);
+ Kumu::hex2bin (_xml_id->c_str(), descriptor.AssetID, ASDCP::UUIDlen, &c);
DCP_ASSERT (c == Kumu::UUID_Length);
descriptor.ContainerDuration = _intrinsic_duration;
return _start_time;
}
- std::string xml_id () const {
+ /** @return ID from XML's <Id> tag, or the <Id> that will be used when writing the XML,
+ * or boost::none if this content is encrypted and no key is available.
+ */
+ boost::optional<std::string> xml_id () const {
return _xml_id;
}
std::vector<std::shared_ptr<SMPTELoadFontNode>> _load_font_nodes;
/** UUID for the XML inside the MXF, which should be the same as the ResourceID in the MXF (our _resource_id)
* but different to the AssetUUID in the MXF (our _id) according to SMPTE Bv2.1 and Doremi's 2.8.18 release notes.
+ * May be boost::none if this object has been made from an encrypted object without a key.
*/
- std::string _xml_id;
+ boost::optional<std::string> _xml_id;
/** ResourceID read from the MXF, if there was one */
boost::optional<std::string> _resource_id;
}
DCP_ASSERT (asset->resource_id());
- if (asset->resource_id().get() != asset->xml_id()) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::MISMATCHED_TIMED_TEXT_RESOURCE_ID });
- }
+ auto xml_id = asset->xml_id();
+ if (xml_id) {
+ if (asset->resource_id().get() != xml_id) {
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::MISMATCHED_TIMED_TEXT_RESOURCE_ID });
+ }
- if (asset->id() == asset->resource_id().get() || asset->id() == asset->xml_id()) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_TIMED_TEXT_ASSET_ID });
+ if (asset->id() == asset->resource_id().get() || asset->id() == xml_id) {
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_TIMED_TEXT_ASSET_ID });
+ }
+ } else {
+ notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED});
}
}