InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file)
: SubtitleAsset (file)
{
+ _raw_xml = dcp::file_to_string (file);
+
shared_ptr<cxml::Document> xml (new cxml::Document ("DCSubtitle"));
xml->read_file (file);
_id = xml->string_child ("SubtitleID");
_id = read_writer_info (info);
if (!_key_id) {
/* Not encrypted; read it in now */
- string s;
- reader->ReadTimedTextResource (s);
- xml->read_string (s);
+ reader->ReadTimedTextResource (_raw_xml);
+ xml->read_string (_raw_xml);
parse_xml (xml);
read_mxf_descriptor (reader, shared_ptr<DecryptionContext> (new DecryptionContext (optional<Key>(), SMPTE)));
}
} else {
/* Plain XML */
try {
+ _raw_xml = dcp::file_to_string (file);
xml.reset (new cxml::Document ("SubtitleReel"));
xml->read_file (file);
parse_xml (xml);
);
}
- string s;
shared_ptr<DecryptionContext> dec (new DecryptionContext (key, SMPTE));
- reader->ReadTimedTextResource (s, dec->context(), dec->hmac());
+ reader->ReadTimedTextResource (_raw_xml, dec->context(), dec->hmac());
shared_ptr<cxml::Document> xml (new cxml::Document ("SubtitleReel"));
- xml->read_string (s);
+ xml->read_string (_raw_xml);
parse_xml (xml);
read_mxf_descriptor (reader, dec);
}
virtual std::list<boost::shared_ptr<LoadFontNode> > load_font_nodes () const = 0;
+ std::string raw_xml () const {
+ return _raw_xml;
+ }
+
protected:
friend struct ::interop_dcp_font_test;
friend struct ::smpte_dcp_font_test;
/** TTF font data that we need */
std::list<Font> _fonts;
+ /** The raw XML data that we read from our asset; useful for validation */
+ std::string _raw_xml;
+
private:
friend struct ::pull_fonts_test1;
friend struct ::pull_fonts_test2;