Add OK note when content version label text is valid.
[libdcp.git] / src / verify.h
index 2adb47d218bb23eddb78ec21928488c14d7b252e..081007c98525df1f5b66f3e0f973cd57885da8e6 100644 (file)
@@ -58,6 +58,9 @@
 namespace dcp {
 
 
+class DCP;
+
+
 class VerificationNote
 {
 public:
@@ -99,6 +102,7 @@ public:
                 *  note contains (probably technical) details
                 */
                FAILED_READ,
+               MATCHING_CPL_HASHES,
                /** The hash of the CPL in the PKL does not agree with the CPL file
                 *  note contains CPL ID
                 *  file contains CPL filename
@@ -110,6 +114,7 @@ public:
                 *  note contains the invalid frame rate as "<numerator>/<denominator>"
                 */
                INVALID_PICTURE_FRAME_RATE,
+               CORRECT_PICTURE_HASH,
                /** The hash of a main picture asset does not agree with the PKL file
                 *  file contains the picture asset filename
                 *  calculated_hash contains the current hash of the picture MXF
@@ -154,6 +159,7 @@ public:
                 *  note contains asset ID
                 */
                INVALID_DURATION,
+               VALID_PICTURE_FRAME_SIZES_IN_BYTES,
                /** The JPEG2000 data in at least one picture frame is larger than the equivalent of 250Mbit/s
                 *  file contains the picture asset filename
                 */
@@ -176,6 +182,7 @@ public:
                 *  note contains the invalid language
                 */
                INVALID_LANGUAGE,
+               VALID_RELEASE_TERRITORY,
                /** A picture asset does not have one of the required Bv2.1 sizes (in pixels) [Bv2.1_7.1]
                 *  note contains the incorrect size as "<width>x<height>"
                 *  file contains the asset filename
@@ -258,6 +265,7 @@ public:
                 *  file contains the CPL filename
                 */
                MISMATCHED_CPL_ANNOTATION_TEXT,
+               VALID_CPL_ANNOTATION_TEXT,
                /** At least one asset in a reel does not have the same duration as the others */
                MISMATCHED_ASSET_DURATION,
                /** If one reel has a _MainSubtitle_, all must have them */
@@ -335,6 +343,11 @@ public:
                 *  file contains the PKL filename
                 */
                MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL,
+               MATCHING_PKL_ANNOTATION_TEXT_WITH_CPL,
+               /** All content is encrypted */
+               ALL_ENCRYPTED,
+               /** No content is encrypted */
+               NONE_ENCRYPTED,
                /** Some, but not all content, is encrypted */
                PARTIALLY_ENCRYPTED,
                /** General error during JPEG2000 codestream verification
@@ -407,11 +420,13 @@ public:
                UNEXPECTED_DURATION,
                /** A <ContentKind> has been specified with either no scope or the SMPTE 429-7 scope, but which is not one of those allowed */
                INVALID_CONTENT_KIND,
+               VALID_CONTENT_KIND,
                /** Either the width or height of a <MainPictureActiveArea> in a CPL is either not an even number, or bigger than the corresponding asset dimension.
                 *  note contains details of what is wrong
                 *  file contains the CPL filename
                 */
                INVALID_MAIN_PICTURE_ACTIVE_AREA,
+               VALID_MAIN_PICTURE_ACTIVE_AREA,
                /** A PKL has more than one asset with the same ID
                 *  note contains the PKL ID
                 *  file contains the PKL filename
@@ -476,6 +491,7 @@ public:
                 *  file contains the CPL filename
                 */
                EMPTY_CONTENT_VERSION_LABEL_TEXT,
+               VALID_CONTENT_VERSION_LABEL_TEXT,
        };
 
        VerificationNote (Type type, Code code)
@@ -659,11 +675,18 @@ struct VerificationOptions
 };
 
 
-std::vector<VerificationNote> verify (
+struct VerifyResult
+{
+       std::vector<VerificationNote> notes;
+       std::vector<std::shared_ptr<dcp::DCP>> dcps;
+};
+
+
+VerifyResult verify(
        std::vector<boost::filesystem::path> directories,
        std::vector<dcp::DecryptedKDM> kdms,
-       boost::function<void (std::string, boost::optional<boost::filesystem::path>)> stage,
-       boost::function<void (float)> progress,
+       std::function<void (std::string, boost::optional<boost::filesystem::path>)> stage,
+       std::function<void (float)> progress,
        VerificationOptions options = {},
        boost::optional<boost::filesystem::path> xsd_dtd_directory = boost::optional<boost::filesystem::path>()
        );