Basic support for trusted device lists in KDMs (#750).
[dcpomatic.git] / src / lib / film.cc
index 3cf46220ecde40a0d7b259351edfddf29964636d..6c0b4d5a541a2deb32fabd851f85fcf8fc60d0f7 100644 (file)
@@ -1113,7 +1113,8 @@ Film::frame_size () const
 
 dcp::EncryptedKDM
 Film::make_kdm (
-       dcp::Certificate target,
+       dcp::Certificate recipient,
+       vector<dcp::Certificate> trusted_devices,
        boost::filesystem::path cpl_file,
        dcp::LocalTime from,
        dcp::LocalTime until,
@@ -1128,7 +1129,7 @@ Film::make_kdm (
 
        return dcp::DecryptedKDM (
                cpl, key(), from, until, "DCP-o-matic", cpl->content_title_text(), dcp::LocalTime().as_string()
-               ).encrypt (signer, target, formulation);
+               ).encrypt (signer, recipient, trusted_devices, formulation);
 }
 
 list<ScreenKDM>
@@ -1143,8 +1144,8 @@ Film::make_kdms (
        list<ScreenKDM> kdms;
 
        BOOST_FOREACH (shared_ptr<Screen> i, screens) {
-               if (i->certificate) {
-                       kdms.push_back (ScreenKDM (i, make_kdm (i->certificate.get(), dcp, from, until, formulation)));
+               if (i->recipient) {
+                       kdms.push_back (ScreenKDM (i, make_kdm (i->recipient.get(), i->trusted_devices, dcp, from, until, formulation)));
                }
        }
 
@@ -1253,6 +1254,8 @@ Film::audio_output_names () const
                return audio_processor()->input_names ();
        }
 
+       DCPOMATIC_ASSERT (MAX_DCP_AUDIO_CHANNELS == 16);
+
        vector<string> n;
        n.push_back (_("L"));
        n.push_back (_("R"));
@@ -1266,6 +1269,10 @@ Film::audio_output_names () const
        n.push_back (_("Rc"));
        n.push_back (_("BsL"));
        n.push_back (_("BsR"));
+       n.push_back (_("DBP"));
+       n.push_back (_("DBS"));
+       n.push_back (_("NC"));
+       n.push_back (_("NC"));
 
        return vector<string> (n.begin(), n.begin() + audio_channels ());
 }