#include "raw_convert.h"
#include "reel.h"
#include "reel_closed_caption_asset.h"
+#include "reel_interop_subtitle_asset.h"
#include "reel_markers_asset.h"
#include "reel_picture_asset.h"
#include "reel_sound_asset.h"
+#include "reel_smpte_subtitle_asset.h"
#include "reel_subtitle_asset.h"
#include "smpte_subtitle_asset.h"
#include "stereo_picture_asset.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;
return static_cast<bool>(reel->main_subtitle());
},
[](shared_ptr<Reel> reel) {
- return reel->main_subtitle()->asset()->raw_xml();
+ auto interop = dynamic_pointer_cast<ReelInteropSubtitleAsset>(reel->main_subtitle());
+ if (interop) {
+ return interop->asset()->raw_xml();
+ }
+ auto smpte = dynamic_pointer_cast<ReelSMPTESubtitleAsset>(reel->main_subtitle());
+ DCP_ASSERT (smpte);
+ return smpte->asset()->raw_xml();
},
[](shared_ptr<Reel> reel) {
return reel->main_subtitle()->actual_duration();
for (auto i: dcp->cpls()) {
for (auto j: i->reel_file_assets()) {
if (j->asset_ref().resolved()) {
- /* It's a bit surprising / broken but Interop subtitle assets are represented
- * in reels by ReelSubtitleAsset which inherits ReelFileAsset, so it's possible for
- * ReelFileAssets to have assets which are not MXFs.
- */
- if (auto asset = dynamic_pointer_cast<MXF>(j->asset_ref().asset())) {
- if (asset->encrypted()) {
- encrypted.push_back(j->asset_ref().id());
- }
+ auto mxf = dynamic_pointer_cast<MXF>(j->asset_ref().asset());
+ if (mxf && mxf->encrypted()) {
+ encrypted.push_back(j->asset_ref().id());
}
}
}
notes.push_back ({VerificationNote::Type::ERROR, VerificationNote::Code::INVALID_INTRINSIC_DURATION, i->id()});
}
auto file_asset = dynamic_pointer_cast<ReelFileAsset>(i);
- if (file_asset && !file_asset->hash()) {
+ if (i->encryptable() && !file_asset->hash()) {
notes.push_back ({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::MISSING_HASH, i->id()});
}
}