diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-04 22:32:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-05 14:35:31 +0100 |
| commit | b7f478b7c5d2e53205dd77dee6955f6d7ac1ce5c (patch) | |
| tree | 55a2eb14998135c1d0bc93761dc66dc57fad2722 /src | |
| parent | 29844b3efd68ee102686e0ae6a04a926c1dbbbd8 (diff) | |
Make read_writer_info do more stuff, and return id.
Diffstat (limited to 'src')
| -rw-r--r-- | src/metadata.cc | 8 | ||||
| -rw-r--r-- | src/metadata.h | 6 | ||||
| -rw-r--r-- | src/mono_picture_mxf.cc | 2 | ||||
| -rw-r--r-- | src/mxf.cc | 10 | ||||
| -rw-r--r-- | src/mxf.h | 2 | ||||
| -rw-r--r-- | src/sound_mxf.cc | 3 | ||||
| -rw-r--r-- | src/stereo_picture_mxf.cc | 2 |
7 files changed, 26 insertions, 7 deletions
diff --git a/src/metadata.cc b/src/metadata.cc index e2e19f3c..a77878bb 100644 --- a/src/metadata.cc +++ b/src/metadata.cc @@ -24,6 +24,7 @@ #include "metadata.h" #include "util.h" #include "local_time.h" +#include "AS_DCP.h" #include <sstream> #include <iomanip> #include <time.h> @@ -39,6 +40,13 @@ MXFMetadata::MXFMetadata () } +void +MXFMetadata::read (ASDCP::WriterInfo const & info) +{ + company_name = info.CompanyName; + product_name = info.ProductName; + product_version = info.ProductVersion; +} XMLMetadata::XMLMetadata () : issuer ("libdcp" LIBDCP_VERSION) diff --git a/src/metadata.h b/src/metadata.h index b1fcdd8e..734e58b9 100644 --- a/src/metadata.h +++ b/src/metadata.h @@ -28,6 +28,10 @@ class utc_offset_to_string_test; +namespace ASDCP { + class WriterInfo; +} + namespace dcp { @@ -39,6 +43,8 @@ class MXFMetadata public: MXFMetadata (); + void read (ASDCP::WriterInfo const & info); + std::string company_name; std::string product_name; std::string product_version; diff --git a/src/mono_picture_mxf.cc b/src/mono_picture_mxf.cc index 09311a01..2a1e0066 100644 --- a/src/mono_picture_mxf.cc +++ b/src/mono_picture_mxf.cc @@ -53,7 +53,7 @@ MonoPictureMXF::MonoPictureMXF (boost::filesystem::path file) boost::throw_exception (DCPReadError ("could not read video MXF information")); } - read_writer_info (info); + _id = read_writer_info (info); } MonoPictureMXF::MonoPictureMXF (Fraction edit_rate) @@ -131,10 +131,16 @@ MXF::set_key (Key key) } } -void +string MXF::read_writer_info (ASDCP::WriterInfo const & info) { char buffer[64]; + + Kumu::bin2UUIDhex (info.CryptographicKeyID, ASDCP::UUIDlen, buffer, sizeof (buffer)); + _key_id = buffer; + + _metadata.read (info); + Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer)); - _id = buffer; + return buffer; } @@ -98,7 +98,7 @@ protected: template <class P, class Q> friend void start (PictureMXFWriter* writer, boost::shared_ptr<P> state, Standard standard, Q* mxf, uint8_t* data, int size); - void read_writer_info (ASDCP::WriterInfo const &); + std::string read_writer_info (ASDCP::WriterInfo const &); /** Fill in a ADSCP::WriteInfo struct. * @param w struct to fill in. * @param standard INTEROP or SMPTE. diff --git a/src/sound_mxf.cc b/src/sound_mxf.cc index 5008da46..adeeddcf 100644 --- a/src/sound_mxf.cc +++ b/src/sound_mxf.cc @@ -71,8 +71,7 @@ SoundMXF::SoundMXF (boost::filesystem::path file) boost::throw_exception (DCPReadError ("could not read audio MXF information")); } - read_writer_info (info); - + _id = read_writer_info (info); } SoundMXF::SoundMXF (Fraction edit_rate, int sampling_rate, int channels) diff --git a/src/stereo_picture_mxf.cc b/src/stereo_picture_mxf.cc index 2ca00762..ce30d0be 100644 --- a/src/stereo_picture_mxf.cc +++ b/src/stereo_picture_mxf.cc @@ -52,7 +52,7 @@ StereoPictureMXF::StereoPictureMXF (boost::filesystem::path file) boost::throw_exception (DCPReadError ("could not read video MXF information")); } - read_writer_info (info); + _id = read_writer_info (info); } StereoPictureMXF::StereoPictureMXF (Fraction edit_rate) |
