diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-02-05 13:39:10 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-02-05 13:39:10 +0000 |
| commit | 5cb09148a9d3456727459b7d41b8c36b0ca277b9 (patch) | |
| tree | f896e01194135fe6dd19d1bb04c786d5fc846623 | |
| parent | 5d2236bf466ea8592344791e926b075be339c3dc (diff) | |
Comment / tidy.
| -rw-r--r-- | src/dcp.h | 5 | ||||
| -rw-r--r-- | src/mxf.cc | 2 | ||||
| -rw-r--r-- | src/mxf.h | 22 | ||||
| -rw-r--r-- | test/dcp_test.cc | 2 | ||||
| -rw-r--r-- | test/encryption_test.cc | 1 |
5 files changed, 15 insertions, 17 deletions
@@ -97,11 +97,6 @@ public: boost::shared_ptr<const Signer> signer = boost::shared_ptr<const Signer> () ); - /** Emitted with a parameter between 0 and 1 to indicate progress - * for long jobs. - */ - boost::signals2::signal<void (float)> Progress; - private: /** Write the PKL file. @@ -43,7 +43,6 @@ using namespace dcp; MXF::MXF (Fraction edit_rate) : Content (edit_rate) - , _progress (0) , _encryption_context (0) , _decryption_context (0) { @@ -52,7 +51,6 @@ MXF::MXF (Fraction edit_rate) MXF::MXF (boost::filesystem::path file) : Content (file) - , _progress (0) , _encryption_context (0) , _decryption_context (0) { @@ -45,6 +45,7 @@ public: MXF (boost::filesystem::path file); ~MXF (); + /** @return the 4-character key type for this MXF (MDIK, MDAK, etc.) */ virtual std::string key_type () const = 0; bool equals ( @@ -59,36 +60,43 @@ public: */ void fill_writer_info (ASDCP::WriterInfo* w, Standard standard); - void set_progress (boost::signals2::signal<void (float)>* progress) { - _progress = progress; - } - + /** @return true if the data is encrypted */ bool encrypted () const { return !_key_id.empty (); } + /** Set the ID of the key that is used for encryption/decryption. + * @param i key ID. + */ void set_key_id (std::string i) { _key_id = i; } + /** @return the ID of the key used for encryption/decryption, or an empty string */ std::string key_id () const { return _key_id; } - + void set_key (Key); + /** @return encryption/decryption key, if one has been set */ boost::optional<Key> key () const { return _key; } + /** @return encryption context, set up with any key that has been passed to set_key() */ ASDCP::AESEncContext* encryption_context () const { return _encryption_context; } + /** Set the metadata that is written to the MXF file. + * @param m Metadata. + */ void set_metadata (MXFMetadata m) { _metadata = m; } + /** @return metadata from the MXF file */ MXFMetadata metadata () const { return _metadata; } @@ -100,11 +108,11 @@ protected: void read_writer_info (ASDCP::WriterInfo const &); - /** Signal to emit to report progress, or 0 */ - boost::signals2::signal<void (float)>* _progress; ASDCP::AESEncContext* _encryption_context; ASDCP::AESDecContext* _decryption_context; + /** ID of the key used for encryption/decryption, or an empty string */ std::string _key_id; + /** Key used for encryption/decryption, if there is one */ boost::optional<Key> _key; MXFMetadata _metadata; }; diff --git a/test/dcp_test.cc b/test/dcp_test.cc index af5a79f5..07defce0 100644 --- a/test/dcp_test.cc +++ b/test/dcp_test.cc @@ -60,7 +60,6 @@ BOOST_AUTO_TEST_CASE (dcp_test) cpl->set_content_version_label_text ("81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); shared_ptr<dcp::MonoPictureMXF> mp (new dcp::MonoPictureMXF (dcp::Fraction (24, 1))); - mp->set_progress (&d.Progress); mp->set_metadata (mxf_meta); shared_ptr<dcp::PictureMXFWriter> picture_writer = mp->start_write ("build/test/foo/video.mxf", dcp::SMPTE, false); dcp::File j2c ("test/data/32x32_red_square.j2c"); @@ -70,7 +69,6 @@ BOOST_AUTO_TEST_CASE (dcp_test) picture_writer->finalize (); shared_ptr<dcp::SoundMXF> ms (new dcp::SoundMXF (dcp::Fraction (24, 1), 48000, 1)); - ms->set_progress (&d.Progress); ms->set_metadata (mxf_meta); shared_ptr<dcp::SoundMXFWriter> sound_writer = ms->start_write ("build/test/foo/audio.mxf", dcp::SMPTE); diff --git a/test/encryption_test.cc b/test/encryption_test.cc index a4e8688b..a0633b07 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -81,7 +81,6 @@ BOOST_AUTO_TEST_CASE (encryption_test) dcp::Key key; shared_ptr<dcp::MonoPictureMXF> mp (new dcp::MonoPictureMXF (dcp::Fraction (24, 1))); - mp->set_progress (&d.Progress); mp->set_metadata (mxf_metadata); mp->set_key (key); |
