using std::cout;
using std::list;
using std::pair;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::dynamic_pointer_cast;
using namespace dcp;
+MXF::MXF ()
+ : _context_id (make_uuid ())
+{
+ /* Subclasses can create MXFs with unspecified _standard but are expected to fill
+ _standard in once the MXF is read.
+ */
+}
+
+MXF::MXF (Standard standard)
+ : _context_id (make_uuid ())
+ , _standard (standard)
+{
+
+}
+
void
-MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id, Standard standard) const
+MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id) const
{
writer_info->ProductVersion = _metadata.product_version;
writer_info->CompanyName = _metadata.company_name;
- writer_info->ProductName = _metadata.product_name.c_str();
+ writer_info->ProductName = _metadata.product_name;
- if (standard == INTEROP) {
+ DCP_ASSERT (_standard);
+ if (_standard == INTEROP) {
writer_info->LabelSetType = ASDCP::LS_MXF_INTEROP;
} else {
writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE;
writer_info->UsesHMAC = true;
if (_key_id) {
- Kumu::GenRandomUUID (writer_info->ContextID);
+ Kumu::hex2bin (_context_id.c_str(), writer_info->ContextID, Kumu::UUID_Length, &c);
writer_info->EncryptedEssence = true;
unsigned int c;
_key_id = buffer;
}
+ switch (info.LabelSetType) {
+ case ASDCP::LS_MXF_INTEROP:
+ _standard = INTEROP;
+ break;
+ case ASDCP::LS_MXF_SMPTE:
+ _standard = SMPTE;
+ break;
+ default:
+ throw ReadError ("Unrecognised label set type in MXF");
+ }
+
_metadata.read (info);
Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer));