40 #ifndef LIBDCP_VERIFY_H
41 #define LIBDCP_VERIFY_H
45 #include <boost/any.hpp>
46 #include <boost/filesystem.hpp>
47 #include <boost/function.hpp>
48 #include <boost/optional.hpp>
531 VerificationNote (
Type type,
Code code, std::string note)
538 VerificationNote (
Type type,
Code code, boost::filesystem::path file)
545 VerificationNote (
Type type,
Code code, std::string note, boost::filesystem::path file)
553 VerificationNote (
Type type,
Code code, std::string note, boost::filesystem::path file, uint64_t line)
587 boost::optional<T> data(
Data key)
const
589 auto iter = _data.find(key);
590 if (iter == _data.end()) {
593 return boost::any_cast<T>(iter->second);
597 boost::optional<std::string> note ()
const {
601 boost::optional<boost::filesystem::path> file ()
const {
602 return data<boost::filesystem::path>(
Data::FILE);
605 boost::optional<uint64_t> line ()
const {
609 VerificationNote& set_frame(
int frame) {
610 _data[Data::FRAME] = frame;
614 boost::optional<int> frame()
const {
615 return data<int>(Data::FRAME);
618 VerificationNote& set_component(
int component) {
619 _data[Data::COMPONENT] = component;
623 boost::optional<int> component()
const {
624 return data<int>(Data::COMPONENT);
627 VerificationNote& set_size(
int size) {
628 _data[Data::SIZE] = size;
632 boost::optional<int> size()
const {
633 return data<int>(Data::SIZE);
636 VerificationNote& set_id(std::string
id) {
637 _data[Data::ID] = id;
641 boost::optional<std::string> id()
const {
642 return data<std::string>(Data::ID);
645 VerificationNote& set_other_id(std::string other_id) {
646 _data[Data::OTHER_ID] = other_id;
650 boost::optional<std::string> other_id()
const {
651 return data<std::string>(Data::OTHER_ID);
654 VerificationNote& set_frame_rate(
int frame_rate) {
655 _data[Data::FRAME_RATE] = frame_rate;
659 boost::optional<int> frame_rate()
const {
660 return data<int>(Data::FRAME_RATE);
663 VerificationNote& set_calculated_hash(std::string hash) {
664 _data[Data::CALCULATED_HASH] = hash;
668 boost::optional<std::string> calculated_hash()
const {
669 return data<std::string>(Data::CALCULATED_HASH);
672 VerificationNote& set_reference_hash(std::string hash) {
673 _data[Data::REFERENCE_HASH] = hash;
677 boost::optional<std::string> reference_hash()
const {
678 return data<std::string>(Data::REFERENCE_HASH);
681 VerificationNote& set_cpl_id(std::string
id) {
682 _data[Data::CPL_ID] = id;
686 boost::optional<std::string> cpl_id()
const {
687 return data<std::string>(Data::CPL_ID);
693 std::map<Data, boost::any> _data;
703 bool check_asset_hashes =
true;
709 std::vector<VerificationNote> notes;
710 std::vector<std::shared_ptr<dcp::DCP>> dcps;
715 std::vector<boost::filesystem::path> directories,
716 std::vector<dcp::DecryptedKDM> kdms,
717 std::function<
void (std::string, boost::optional<boost::filesystem::path>)> stage,
718 std::function<
void (
float)> progress,
720 boost::optional<boost::filesystem::path> xsd_dtd_directory = boost::optional<boost::filesystem::path>()
723 std::string note_to_string(
725 std::function<std::string (std::string)> process_string = [](std::string s) {
return s; },
726 std::function<std::string (std::string)> process_filename = [](std::string s) {
return s; }
@ INVALID_INTRINSIC_DURATION
@ INVALID_CLOSED_CAPTION_LINE_COUNT
@ INVALID_PICTURE_FRAME_RATE_FOR_4K
@ MISMATCHED_CPL_ANNOTATION_TEXT
@ MISSING_EXTENSION_METADATA
@ MISMATCHED_ASSET_MAP_ID
@ INVALID_SUBTITLE_FIRST_TEXT_TIME
@ MISSING_JPEG200_TLM_MARKER
@ INVALID_MAIN_PICTURE_ACTIVE_AREA
@ MISMATCHED_SUBTITLE_LANGUAGES
@ MISMATCHED_SOUND_CHANNEL_COUNTS
@ VALID_MAIN_PICTURE_ACTIVE_AREA
@ VALID_RELEASE_TERRITORY
@ MISSING_CPL_CONTENT_VERSION
@ DUPLICATE_ASSET_ID_IN_ASSETMAP
@ INVALID_JPEG2000_TILE_PARTS_FOR_2K
@ INVALID_JPEG2000_CODE_BLOCK_HEIGHT
@ INVALID_TIMED_TEXT_SIZE_IN_BYTES
@ INVALID_JPEG2000_CODESTREAM
@ NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES
@ INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES
@ INCORRECT_JPEG2000_POC_MARKER
@ INVALID_SUBTITLE_LINE_COUNT
@ UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT
@ MATCHING_PKL_ANNOTATION_TEXT_WITH_CPL
@ INVALID_JPEG2000_GUARD_BITS_FOR_2K
@ THREED_ASSET_MARKED_AS_TWOD
@ INVALID_SUBTITLE_ISSUE_DATE
@ INCORRECT_SUBTITLE_ENTRY_POINT
@ MISSING_FFMC_IN_FEATURE
@ EMPTY_CONTENT_VERSION_LABEL_TEXT
@ INVALID_SUBTITLE_SPACING
@ MISSED_CHECK_OF_ENCRYPTED
@ MISMATCHED_CLOSED_CAPTION_VALIGN
@ MISSING_SUBTITLE_START_TIME
@ INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D
@ INVALID_SOUND_FRAME_RATE
@ MISMATCHED_ASSET_DURATION
@ MISSING_CPL_ANNOTATION_TEXT
@ MISSING_SUBTITLE_ENTRY_POINT
@ INVALID_EXTENSION_METADATA
@ MISMATCHED_CLOSED_CAPTION_ASSET_COUNTS
@ INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_2K
@ INVALID_SOUND_BIT_DEPTH
@ INCORRECT_CLOSED_CAPTION_ORDERING
@ MISMATCHED_TIMED_TEXT_RESOURCE_ID
@ INVALID_PICTURE_FRAME_RATE_FOR_2K
@ INVALID_SUBTITLE_DURATION
@ MISSING_LOAD_FONT_FOR_FONT
@ INVALID_CLOSED_CAPTION_LINE_LENGTH
@ MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL
@ SUBTITLE_OVERLAPS_REEL_BOUNDARY
@ MISMATCHED_TIMED_TEXT_DURATION
@ VALID_CONTENT_VERSION_LABEL_TEXT
@ INVALID_SUBTITLE_START_TIME
@ MISMATCHED_SOUND_HASHES
@ MISSING_FFEC_IN_FEATURE
@ INVALID_JPEG2000_TILE_SIZE
@ INVALID_JPEG2000_TILE_PART_SIZE
@ INVALID_MAIN_SOUND_CONFIGURATION
@ INVALID_JPEG2000_POC_MARKER_LOCATION
@ DUPLICATE_ASSET_ID_IN_PKL
@ MISMATCHED_PICTURE_HASHES
@ MISSING_SUBTITLE_LANGUAGE
@ INCORRECT_TIMED_TEXT_ASSET_ID
@ VALID_PICTURE_FRAME_SIZES_IN_BYTES
@ MISSING_CPL_METADATA_VERSION_NUMBER
@ INCORRECT_SUBTITLE_NAMESPACE_COUNT
@ INVALID_PICTURE_SIZE_IN_PIXELS
@ MISSING_CLOSED_CAPTION_ENTRY_POINT
@ INCORRECT_CLOSED_CAPTION_ENTRY_POINT
@ INVALID_JPEG2000_TILE_PARTS_FOR_4K
@ INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_4K
@ INVALID_PICTURE_FRAME_RATE
@ UNSIGNED_CPL_WITH_ENCRYPTED_CONTENT
@ INVALID_JPEG2000_CODE_BLOCK_WIDTH
@ INVALID_SUBTITLE_LINE_LENGTH
@ VALID_CPL_ANNOTATION_TEXT
@ INVALID_JPEG2000_GUARD_BITS_FOR_4K
@ MISSING_MAIN_SUBTITLE_FROM_SOME_REELS
@ INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES
@ INVALID_PICTURE_FRAME_SIZE_IN_BYTES
@ NEARLY_INVALID_SUBTITLE_LINE_LENGTH
@ NOTE
further information about the error
@ LINE
error line number within the FILE
@ FILE
path of file containing the error
@ BV21_ERROR
may not always be considered an error, but violates a "shall" requirement of Bv2.1
Namespace for everything in libdcp.
boost::optional< boost::uintmax_t > maximum_asset_size_for_hash_check
< If set, any assets larger than this number of bytes will not have their hashes checked