X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fmxf.cc;h=1154b80df6fedad1001a5d704dbe89d168a2f976;hb=dce3761b0f82a9273aca8a0d39743aee6740c8e4;hp=b6c11bb8f64db087b635694ff8422e04d21614b5;hpb=d39880eef211a296fa8ef4712cdef5945d08527c;p=libdcp.git diff --git a/src/mxf.cc b/src/mxf.cc index b6c11bb8..1154b80d 100644 --- a/src/mxf.cc +++ b/src/mxf.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of libdcp. @@ -31,10 +31,12 @@ files in the program, then also delete it here. */ -/** @file src/asset.cc - * @brief Parent class for assets of DCPs made up of MXF files. + +/** @file src/mxf.cc + * @brief MXF class */ + #include "raw_convert.h" #include "mxf.h" #include "util.h" @@ -49,6 +51,7 @@ #include #include + using std::string; using std::cout; using std::list; @@ -57,6 +60,7 @@ using std::shared_ptr; using std::dynamic_pointer_cast; using namespace dcp; + MXF::MXF () : _context_id (make_uuid ()) { @@ -65,6 +69,7 @@ MXF::MXF () */ } + MXF::MXF (Standard standard) : _context_id (make_uuid ()) , _standard (standard) @@ -72,6 +77,7 @@ MXF::MXF (Standard standard) } + void MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id) const { @@ -80,7 +86,7 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id) const writer_info->ProductName = _metadata.product_name; DCP_ASSERT (_standard); - if (_standard == INTEROP) { + if (_standard == Standard::INTEROP) { writer_info->LabelSetType = ASDCP::LS_MXF_INTEROP; } else { writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE; @@ -101,11 +107,7 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id) const } } -/** Set the (private) key that will be used to encrypt or decrypt this MXF's content. - * This is the top-secret key that is distributed (itself encrypted) to cinemas - * via Key Delivery Messages (KDMs). - * @param key Key to use. - */ + void MXF::set_key (Key key) { @@ -117,6 +119,7 @@ MXF::set_key (Key key) } } + string MXF::read_writer_info (ASDCP::WriterInfo const & info) { @@ -129,10 +132,10 @@ MXF::read_writer_info (ASDCP::WriterInfo const & info) switch (info.LabelSetType) { case ASDCP::LS_MXF_INTEROP: - _standard = INTEROP; + _standard = Standard::INTEROP; break; case ASDCP::LS_MXF_SMPTE: - _standard = SMPTE; + _standard = Standard::SMPTE; break; default: throw ReadError ("Unrecognised label set type in MXF");