X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_kdm.cc;h=da856d3589af6246df58ee6f96c1eb70517c3548;hp=dd45401cb70c050c79c602c1d7a1e0a182daa680;hb=0a1d944d74308ccb940194bcb627652c72128650;hpb=0ab8cf5b312f36a14f66d4564c6f4b1694ddaae0 diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index dd45401cb..da856d358 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -317,17 +317,24 @@ private: continue; } + dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + DecryptedECinemaKDM kdm ( decrypted.id(), decrypted.name(), decrypted.key(), - dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), - dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()) + begin, + end ); dcp::NameFormat::Map name_values; name_values['c'] = i->cinema->name; name_values['s'] = i->name; + name_values['f'] = title; + name_values['b'] = begin.date() + " " + begin.time_of_day(true, false); + name_values['e'] = end.date() + " " + end.time_of_day(true, false); + name_values['i'] = kdm.id(); /* Encrypt */ kdms.push_back ( @@ -358,10 +365,13 @@ private: continue; } + dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()); + /* Make an empty KDM */ dcp::DecryptedKDM kdm ( - dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), - dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()), + begin, + end, decrypted.annotation_text().get_value_or (""), decrypted.content_title_text(), dcp::LocalTime().as_string() @@ -372,21 +382,23 @@ private: kdm.add_key (j); } + dcp::EncryptedKDM const encrypted = kdm.encrypt( + signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(), + !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional() : 0 + ); + dcp::NameFormat::Map name_values; name_values['c'] = i->cinema->name; name_values['s'] = i->name; + name_values['f'] = title; + name_values['b'] = begin.date() + " " + begin.time_of_day(true, false); + name_values['e'] = end.date() + " " + end.time_of_day(true, false); + name_values['i'] = encrypted.cpl_id (); /* Encrypt */ kdms.push_back ( KDMWithMetadataPtr( - new DCPKDMWithMetadata( - name_values, - i->cinema, - kdm.encrypt( - signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(), - !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional() : 0 - ) - ) + new DCPKDMWithMetadata(name_values, i->cinema, encrypted) ) ); } @@ -397,7 +409,7 @@ private: } pair, int> result = _output->make ( - kdms, title, _timing, bind (&DOMFrame::confirm_overwrite, this, _1) + kdms, title, bind (&DOMFrame::confirm_overwrite, this, _1) ); if (result.first) {