A class to create or read a DCP.
More...
#include <dcp.h>
|
| DCP (boost::filesystem::path directory) |
|
| DCP (DCP const &)=delete |
|
DCP & | operator= (DCP const &)=delete |
|
void | read (std::vector< VerificationNote > *notes=nullptr, bool ignore_incorrect_picture_mxf_type=false) |
|
bool | equals (DCP const &other, EqualityOptions options, NoteHandler note) const |
|
void | add (std::shared_ptr< CPL > cpl) |
|
std::vector< std::shared_ptr< CPL > > | cpls () const |
|
std::vector< std::shared_ptr< Asset > > | assets (bool ignore_unresolved=false) const |
|
bool | any_encrypted () const |
|
bool | all_encrypted () const |
|
void | add (DecryptedKDM const &) |
|
void | write_xml (std::string issuer=String::compose("libdcp %1", dcp::version), std::string creator=String::compose("libdcp %1", dcp::version), std::string issue_date=LocalTime().as_string(), std::string annotation_text=String::compose("Created by libdcp %1", dcp::version), std::shared_ptr< const CertificateChain > signer=std::shared_ptr< const CertificateChain >(), NameFormat name_format=NameFormat("%t")) |
|
void | resolve_refs (std::vector< std::shared_ptr< Asset >> assets) |
|
boost::optional< Standard > | standard () const |
|
boost::filesystem::path | directory () const |
|
std::vector< std::shared_ptr< PKL > > | pkls () const |
|
boost::optional< boost::filesystem::path > | asset_map_path () |
|
|
static std::vector< boost::filesystem::path > | directories_from_files (std::vector< boost::filesystem::path > files) |
|
|
void | write_volindex (Standard standard) const |
|
void | write_assetmap (Standard standard, std::string pkl_uuid, boost::filesystem::path pkl_path, std::string issuer, std::string creator, std::string issue_date, std::string annotation_text) const |
|
A class to create or read a DCP.
Definition at line 82 of file dcp.h.
◆ DCP()
DCP::DCP |
( |
boost::filesystem::path |
directory | ) |
|
|
explicit |
Construct a DCP. You can pass an existing DCP's directory as the parameter; alternatively, directory will be created if it does not exist. Note that if you pass an existing DCP into this constructor it will not be read until you call ::read().
- Parameters
-
directory | Directory containing the DCP's files. |
Definition at line 100 of file dcp.cc.
◆ add()
Add a KDM to decrypt this DCP. This method must be called after DCP::read() or the KDM you specify will be ignored.
- Parameters
-
Definition at line 364 of file dcp.cc.
◆ assets()
vector< shared_ptr< Asset > > DCP::assets |
( |
bool |
ignore_unresolved = false | ) |
const |
- Parameters
-
ignore_unresolved | true to silently ignore unresolved assets, otherwise an exception is thrown if they are found. |
- Returns
- All assets (including CPLs).
Definition at line 549 of file dcp.cc.
◆ directories_from_files()
vector< boost::filesystem::path > DCP::directories_from_files |
( |
std::vector< boost::filesystem::path > |
files | ) |
|
|
static |
Given a list of files that make up 1 or more DCPs, return the DCP directories
Definition at line 585 of file dcp.cc.
◆ equals()
Compare this DCP with another, according to various options.
- Parameters
-
other | DCP to compare this one to. |
options | Options to define what "equality" means. |
note | Functor to handle notes made by the equality operation. |
- Returns
- true if the DCPs are equal according to EqualityOptions, otherwise false.
Definition at line 303 of file dcp.cc.
◆ pkls()
std::vector<std::shared_ptr<PKL> > dcp::DCP::pkls |
( |
| ) |
const |
|
inline |
- Returns
- PKLs if this DCP was read from an existing one, or if write_xml() has been called on it. If neither is true, this method returns an empty vector.
Definition at line 176 of file dcp.h.
◆ read()
void DCP::read |
( |
std::vector< VerificationNote > * |
notes = nullptr , |
|
|
bool |
ignore_incorrect_picture_mxf_type = false |
|
) |
| |
Read a DCP. This method does not do any deep checking of the DCP's validity, but if it comes across any bad things it will do one of two things.
Errors that are so serious that they prevent the method from working will result in an exception being thrown. For example, a missing ASSETMAP means that the DCP can't be read without a lot of guesswork, so this will throw.
Errors that are not fatal will be added to notes, if it's non-null. For example, if the DCP contains a mixture of Interop and SMPTE elements this will result in a note being added to the vector.
For more thorough checking of a DCP's contents, see dcp::verify().
- Parameters
-
notes | List of notes that will be added to if non-0. |
ignore_incorrect_picture_mxf_type | true to try loading MXF files marked as monoscopic as stereoscopic if the monoscopic load fails; fixes problems some 3D DCPs that (I think) have an incorrect descriptor in their MXF. |
Definition at line 112 of file dcp.cc.
◆ standard()
boost::optional<Standard> dcp::DCP::standard |
( |
| ) |
const |
|
inline |
- Returns
- Standard of a DCP that was read in
Definition at line 165 of file dcp.h.
◆ write_assetmap()
void DCP::write_assetmap |
( |
Standard |
standard, |
|
|
std::string |
pkl_uuid, |
|
|
boost::filesystem::path |
pkl_path, |
|
|
std::string |
issuer, |
|
|
std::string |
creator, |
|
|
std::string |
issue_date, |
|
|
std::string |
annotation_text |
|
) |
| const |
|
private |
Write the ASSETMAP file.
- Parameters
-
pkl_uuid | UUID of our PKL. |
pkl_path | Pathname of our PKL file. |
Definition at line 416 of file dcp.cc.
◆ write_volindex()
void DCP::write_volindex |
( |
Standard |
standard | ) |
const |
|
private |
Write the VOLINDEX file.
- Parameters
-
standard | DCP standard to use (INTEROP or SMPTE) |
Definition at line 382 of file dcp.cc.
◆ write_xml()
void DCP::write_xml |
( |
std::string |
issuer = String::compose("libdcp %1", dcp::version) , |
|
|
std::string |
creator = String::compose("libdcp %1", dcp::version) , |
|
|
std::string |
issue_date = LocalTime().as_string() , |
|
|
std::string |
annotation_text = String::compose("Created by libdcp %1", dcp::version) , |
|
|
std::shared_ptr< const CertificateChain > |
signer = std::shared_ptr<const CertificateChain>() , |
|
|
NameFormat |
name_format = NameFormat("%t") |
|
) |
| |
Write all the XML files for this DCP
- Parameters
-
standand | INTEROP or SMPTE |
issuer | Value for the PKL and AssetMap <Issuer> tags |
creator | Value for the PKL and AssetMap <Creator> tags |
issue_date | Value for the CPL <IssueDate> tags |
annotation_text | Value for the CPL <AnnotationText> tags |
signer | Signer to use |
name_format | Name format to use for the CPL and PKL filenames |
Definition at line 490 of file dcp.cc.
◆ _asset_map
boost::optional<boost::filesystem::path> dcp::DCP::_asset_map |
|
mutableprivate |
File that the ASSETMAP was read from or last written to
Definition at line 206 of file dcp.h.
◆ _cpls
std::vector<std::shared_ptr<CPL> > dcp::DCP::_cpls |
|
private |
The CPLs that make up this DCP
Definition at line 202 of file dcp.h.
◆ _directory
boost::filesystem::path dcp::DCP::_directory |
|
private |
The directory that we are writing to
Definition at line 200 of file dcp.h.
◆ _pkls
std::vector<std::shared_ptr<PKL> > dcp::DCP::_pkls |
|
private |
The PKLs that make up this DCP
Definition at line 204 of file dcp.h.
◆ _standard
boost::optional<Standard> dcp::DCP::_standard |
|
private |
Standard of DCP that was read in
Definition at line 209 of file dcp.h.
The documentation for this class was generated from the following files: