libdcp
Classes | Enumerations | Functions
verify.cc File Reference

dcp::verify() method and associated code More...

#include "compose.hpp"
#include "cpl.h"
#include "dcp.h"
#include "exceptions.h"
#include "interop_subtitle_asset.h"
#include "mono_picture_asset.h"
#include "mono_picture_frame.h"
#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"
#include "stereo_picture_frame.h"
#include "verify.h"
#include "verify_j2k.h"
#include <xercesc/dom/DOMAttr.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMError.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>
#include <xercesc/dom/DOMException.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
#include <xercesc/dom/DOMLSParser.hpp>
#include <xercesc/dom/DOMLocator.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
#include <xercesc/dom/DOMNodeList.hpp>
#include <xercesc/framework/LocalFileInputSource.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/parsers/AbstractDOMParser.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <map>
#include <vector>

Go to the source code of this file.

Classes

class  XMLValidationError
 
class  DCPErrorHandler
 
class  StringToXMLCh
 
class  LocalFileResolver
 
struct  State
 
struct  LinesCharactersResult
 

Enumerations

enum class  VerifyAssetResult { GOOD , CPL_PKL_DIFFER , BAD }
 

Functions

static string xml_ch_to_string (XMLCh const *a)
 
static void parse (XercesDOMParser &parser, boost::filesystem::path xml)
 
static void parse (XercesDOMParser &parser, string xml)
 
template<class T >
void validate_xml (T xml, boost::filesystem::path xsd_dtd_directory, vector< VerificationNote > &notes)
 
static VerifyAssetResult verify_asset (shared_ptr< const DCP > dcp, shared_ptr< const ReelFileAsset > reel_file_asset, function< void(float)> progress)
 
void verify_language_tag (string tag, vector< VerificationNote > &notes)
 
static void verify_picture_asset (shared_ptr< const ReelFileAsset > reel_file_asset, boost::filesystem::path file, vector< VerificationNote > &notes, function< void(float)> progress)
 
static void verify_main_picture_asset (shared_ptr< const DCP > dcp, shared_ptr< const ReelPictureAsset > reel_asset, function< void(string, optional< boost::filesystem::path >)> stage, function< void(float)> progress, vector< VerificationNote > &notes)
 
static void verify_main_sound_asset (shared_ptr< const DCP > dcp, shared_ptr< const ReelSoundAsset > reel_asset, function< void(string, optional< boost::filesystem::path >)> stage, function< void(float)> progress, vector< VerificationNote > &notes)
 
static void verify_main_subtitle_reel (shared_ptr< const ReelSubtitleAsset > reel_asset, vector< VerificationNote > &notes)
 
static void verify_closed_caption_reel (shared_ptr< const ReelClosedCaptionAsset > reel_asset, vector< VerificationNote > &notes)
 
void verify_smpte_timed_text_asset (shared_ptr< const SMPTESubtitleAsset > asset, optional< int64_t > reel_asset_duration, vector< VerificationNote > &notes)
 
void verify_smpte_subtitle_asset (shared_ptr< const SMPTESubtitleAsset > asset, vector< VerificationNote > &notes, State &state)
 
static void verify_subtitle_asset (shared_ptr< const SubtitleAsset > asset, optional< int64_t > reel_asset_duration, function< void(string, optional< boost::filesystem::path >)> stage, boost::filesystem::path xsd_dtd_directory, vector< VerificationNote > &notes, State &state)
 
static void verify_closed_caption_asset (shared_ptr< const SubtitleAsset > asset, optional< int64_t > reel_asset_duration, function< void(string, optional< boost::filesystem::path >)> stage, boost::filesystem::path xsd_dtd_directory, vector< VerificationNote > &notes)
 
static void verify_text_details (vector< shared_ptr< Reel >> reels, int edit_rate, vector< VerificationNote > &notes, std::function< bool(shared_ptr< Reel >)> check, std::function< optional< string >(shared_ptr< Reel >)> xml, std::function< int64_t(shared_ptr< Reel >)> duration)
 
static void verify_closed_caption_details (vector< shared_ptr< Reel >> reels, vector< VerificationNote > &notes)
 
static void verify_text_lines_and_characters (shared_ptr< SubtitleAsset > asset, int warning_length, int error_length, LinesCharactersResult *result)
 
static void verify_text_details (vector< shared_ptr< Reel >> reels, vector< VerificationNote > &notes)
 
void verify_extension_metadata (shared_ptr< CPL > cpl, vector< VerificationNote > &notes)
 
bool pkl_has_encrypted_assets (shared_ptr< DCP > dcp, shared_ptr< PKL > pkl)
 

Detailed Description

dcp::verify() method and associated code

Definition in file verify.cc.

Function Documentation

◆ verify_closed_caption_asset()

static void verify_closed_caption_asset ( shared_ptr< const SubtitleAsset asset,
optional< int64_t >  reel_asset_duration,
function< void(string, optional< boost::filesystem::path >)>  stage,
boost::filesystem::path  xsd_dtd_directory,
vector< VerificationNote > &  notes 
)
static

Verify all closed caption stuff

Definition at line 751 of file verify.cc.

◆ verify_smpte_subtitle_asset()

void verify_smpte_subtitle_asset ( shared_ptr< const SMPTESubtitleAsset asset,
vector< VerificationNote > &  notes,
State state 
)

Verify SMPTE subtitle-only stuff

Definition at line 690 of file verify.cc.

◆ verify_smpte_timed_text_asset()

void verify_smpte_timed_text_asset ( shared_ptr< const SMPTESubtitleAsset asset,
optional< int64_t >  reel_asset_duration,
vector< VerificationNote > &  notes 
)

Verify stuff that is common to both subtitles and closed captions

Definition at line 639 of file verify.cc.

◆ verify_subtitle_asset()

static void verify_subtitle_asset ( shared_ptr< const SubtitleAsset asset,
optional< int64_t >  reel_asset_duration,
function< void(string, optional< boost::filesystem::path >)>  stage,
boost::filesystem::path  xsd_dtd_directory,
vector< VerificationNote > &  notes,
State state 
)
static

Verify all subtitle stuff

Definition at line 722 of file verify.cc.

◆ verify_text_details()

static void verify_text_details ( vector< shared_ptr< Reel >>  reels,
int  edit_rate,
vector< VerificationNote > &  notes,
std::function< bool(shared_ptr< Reel >)>  check,
std::function< optional< string >(shared_ptr< Reel >)>  xml,
std::function< int64_t(shared_ptr< Reel >)>  duration 
)
static

Check the timing of the individual subtitles and make sure there are no empty <Text> nodes

Definition at line 783 of file verify.cc.