libdcp
Classes | Macros | 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 "filesystem.h"
#include "interop_text_asset.h"
#include "mono_j2k_picture_asset.h"
#include "mono_j2k_picture_frame.h"
#include "raw_convert.h"
#include "reel.h"
#include "reel_interop_text_asset.h"
#include "reel_markers_asset.h"
#include "reel_picture_asset.h"
#include "reel_sound_asset.h"
#include "reel_smpte_text_asset.h"
#include "reel_text_asset.h"
#include "smpte_text_asset.h"
#include "stereo_j2k_picture_asset.h"
#include "stereo_j2k_picture_frame.h"
#include "verify.h"
#include "verify_internal.h"
#include "verify_j2k.h"
#include <libxml/parserInternals.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 <numeric>
#include <regex>
#include <set>
#include <vector>

Go to the source code of this file.

Classes

class  XMLValidationError
 
class  DCPErrorHandler
 
class  StringToXMLCh
 
class  LocalFileResolver
 

Macros

#define compose(format, ...)   String::compose(process_string(format), __VA_ARGS__)
 

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 (Context &context, T xml)
 
static VerifyAssetResult verify_asset (Context &context, shared_ptr< const ReelFileAsset > reel_file_asset, string *reference_hash, string *calculated_hash)
 
static void verify_language_tag (Context &context, string tag)
 
static void verify_picture_asset (Context &context, shared_ptr< const ReelFileAsset > reel_file_asset, boost::filesystem::path file, int64_t start_frame)
 
static void verify_main_picture_asset (Context &context, shared_ptr< const ReelPictureAsset > reel_asset, int64_t start_frame)
 
static void verify_main_sound_asset (Context &context, shared_ptr< const ReelSoundAsset > reel_asset)
 
static void verify_main_subtitle_reel (Context &context, shared_ptr< const ReelTextAsset > reel_asset)
 
static void verify_closed_caption_reel (Context &context, shared_ptr< const ReelTextAsset > reel_asset)
 
void verify_smpte_timed_text_asset (Context &context, shared_ptr< const SMPTETextAsset > asset, optional< int64_t > reel_asset_duration)
 
void verify_interop_text_asset (Context &context, shared_ptr< const InteropTextAsset > asset)
 
void verify_smpte_subtitle_asset (Context &context, shared_ptr< const SMPTETextAsset > asset)
 
static void verify_subtitle_asset (Context &context, shared_ptr< const TextAsset > asset, optional< int64_t > reel_asset_duration)
 
static void verify_closed_caption_asset (Context &context, shared_ptr< const TextAsset > asset, optional< int64_t > reel_asset_duration)
 
static void verify_text_details (Context &context, vector< shared_ptr< Reel >> reels, int edit_rate, std::function< bool(shared_ptr< Reel >)> check, std::function< optional< string >(shared_ptr< Reel >)> xml, std::function< int64_t(shared_ptr< Reel >)> duration, std::function< std::string(shared_ptr< Reel >)> id)
 
static void verify_closed_caption_details (Context &context, vector< shared_ptr< Reel >> reels)
 
static void verify_text_details (Context &context, vector< shared_ptr< Reel >> reels)
 
bool pkl_has_encrypted_assets (shared_ptr< const DCP > dcp, shared_ptr< const PKL > pkl)
 
static void verify_reel (Context &context, shared_ptr< const Reel > reel, int64_t start_frame, optional< dcp::Size > main_picture_active_area, bool *have_main_subtitle, bool *have_no_main_subtitle, size_t *most_closed_captions, size_t *fewest_closed_captions, map< Marker, Time > *markers_seen)
 
static void verify_cpl (Context &context, shared_ptr< const CPL > cpl)
 
static void verify_pkl (Context &context, shared_ptr< const PKL > pkl)
 
static void verify_assetmap (Context &context, shared_ptr< const DCP > dcp)
 

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 ( Context context,
shared_ptr< const TextAsset asset,
optional< int64_t >  reel_asset_duration 
)
static

Verify all closed caption stuff

Definition at line 829 of file verify.cc.

◆ verify_interop_text_asset()

void verify_interop_text_asset ( Context context,
shared_ptr< const InteropTextAsset asset 
)

Verify Interop subtitle / CCAP stuff

Definition at line 731 of file verify.cc.

◆ verify_smpte_subtitle_asset()

void verify_smpte_subtitle_asset ( Context context,
shared_ptr< const SMPTETextAsset asset 
)

Verify SMPTE subtitle-only stuff

Definition at line 745 of file verify.cc.

◆ verify_smpte_timed_text_asset()

void verify_smpte_timed_text_asset ( Context context,
shared_ptr< const SMPTETextAsset asset,
optional< int64_t >  reel_asset_duration 
)

Verify stuff that is common to both subtitles and closed captions

Definition at line 684 of file verify.cc.

◆ verify_subtitle_asset()

static void verify_subtitle_asset ( Context context,
shared_ptr< const TextAsset asset,
optional< int64_t >  reel_asset_duration 
)
static

Verify all subtitle stuff

Definition at line 784 of file verify.cc.

◆ verify_text_details()

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

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

Definition at line 864 of file verify.cc.