From 22c2111406075c98a2bf5feeaa92fa16293bc15a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 17 Jul 2012 17:53:08 +0100 Subject: Some comments. --- TODO | 1 + src/picture_asset.cc | 14 +++++++- src/picture_asset.h | 3 ++ src/sound_asset.cc | 12 +++++++ src/sound_asset.h | 1 + src/tags.cc | 2 ++ src/tags.h | 7 +++- .../9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml | 39 ++++++++++++++++++++++ .../df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml | 30 +++++++++++++++++ 9 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 TODO create mode 100644 test/ref/DCP/9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml create mode 100644 test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml diff --git a/TODO b/TODO new file mode 100644 index 00000000..b30aa698 --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +Rounding of FPS ...? \ No newline at end of file diff --git a/src/picture_asset.cc b/src/picture_asset.cc index bdf8ce41..1f131234 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -30,6 +30,16 @@ using namespace std; using namespace boost; using namespace libdcp; +/** Construct a PictureAsset, generating the MXF from the JPEG2000 files. + * This may take some time; progress is indicated by emission of the Progress signal. + * @param files Pathnames of JPEG2000 files, in frame order. + * @param p Pathname of MXF file to create. + * @param fps Frames per second. + * @param len Length in frames. + * @param w Width of images in pixels. + * @param h Height of images in pixels. + */ + PictureAsset::PictureAsset (list const & files, string p, int fps, int len, int w, int h) : Asset (p, fps, len) , _width (w) @@ -43,7 +53,6 @@ PictureAsset::PictureAsset (list const & files, string p, int fps, int l ASDCP::JP2K::PictureDescriptor picture_desc; j2k_parser.FillPictureDescriptor (picture_desc); - /* XXX: we round for DCP: not sure if this is right */ picture_desc.EditRate = ASDCP::Rational (_fps, 1); ASDCP::WriterInfo writer_info; @@ -76,6 +85,9 @@ PictureAsset::PictureAsset (list const & files, string p, int fps, int l _digest = make_digest (_mxf_path); } +/** Write details of this asset to a CPL stream. + * @param s Stream. + */ void PictureAsset::write_to_cpl (ostream& s) const { diff --git a/src/picture_asset.h b/src/picture_asset.h index cef5367b..8883e538 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -22,6 +22,7 @@ namespace libdcp { +/** An asset made up of JPEG2000 files */ class PictureAsset : public Asset { public: @@ -30,7 +31,9 @@ public: void write_to_cpl (std::ostream &) const; private: + /** picture width in pixels */ int _width; + /** picture height in pixels */ int _height; }; diff --git a/src/sound_asset.cc b/src/sound_asset.cc index 0b22b4f5..9dba4ed6 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -28,6 +28,14 @@ using namespace std; using namespace boost; using namespace libdcp; +/** Construct a SoundAsset, generating the MXF from the WAV files. + * This may take some time; progress is indicated by emission of the Progress signal. + * @param files Pathnames of sound files, in the order Left, Right, Centre, Lfe (sub), Left surround, Right surround. + * @param p Pathname of MXF file to create. + * @param fps Frames per second. + * @param len Length in frames. + */ + SoundAsset::SoundAsset (list const & files, string p, int fps, int len) : Asset (p, fps, len) { @@ -116,6 +124,10 @@ SoundAsset::SoundAsset (list const & files, string p, int fps, int len) _digest = make_digest (_mxf_path); } +/** Write details of this asset to a CPL stream. + * @param s Stream. + */ + void SoundAsset::write_to_cpl (ostream& s) const { diff --git a/src/sound_asset.h b/src/sound_asset.h index 8c63b530..0327adf4 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -22,6 +22,7 @@ namespace libdcp { +/** An asset made up of WAV files */ class SoundAsset : public Asset { public: diff --git a/src/tags.cc b/src/tags.cc index 584d3623..0adc63c8 100644 --- a/src/tags.cc +++ b/src/tags.cc @@ -24,6 +24,7 @@ using namespace libdcp; Tags* Tags::_instance = 0; +/** Construct a Tags object with some default values */ Tags::Tags () : company_name ("libdcp") , product_name ("libdcp") @@ -39,6 +40,7 @@ Tags::Tags () issue_date = string (buffer); } +/** @return Singleton Tags instance */ Tags * Tags::instance () { diff --git a/src/tags.h b/src/tags.h index 511558f0..b82fef61 100644 --- a/src/tags.h +++ b/src/tags.h @@ -22,6 +22,10 @@ namespace libdcp { +/** A class to hold various metadata that will be written + * to the DCP. The values are initialised, and can be modified + * if desired. + */ class Tags { public: @@ -36,7 +40,8 @@ public: private: Tags (); - + + /** Singleton instance of Tags */ static Tags* _instance; }; diff --git a/test/ref/DCP/9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml b/test/ref/DCP/9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml new file mode 100644 index 00000000..1cd273fc --- /dev/null +++ b/test/ref/DCP/9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml @@ -0,0 +1,39 @@ + + + urn:uuid:9892e944-5046-4dbb-af7c-f50742f62fc2 + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + A Test DCP + feature + + urn:uri:9892e944-5046-4dbb-af7c-f50742f62fc2_2012-07-17T04:45:18+00:00 + 9892e944-5046-4dbb-af7c-f50742f62fc2_2012-07-17T04:45:18+00:00 + + + + + urn:uuid:379fa64c-ad71-46cf-bef7-b45624006610 + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + video.mxf + 24 1 + 24 + 0 + 24 + 24 1 + 32 32 + + + urn:uuid:67b9341e-cadd-4dac-9d5c-f5a1d59f2d06 + audio.mxf + 24 1 + 24 + 0 + 24 + + + + + diff --git a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml new file mode 100644 index 00000000..98e3db81 --- /dev/null +++ b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml @@ -0,0 +1,30 @@ + + + urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb + A Test DCP + 2012-07-17T04:45:18+00:00 + OpenDCP 0.0.25 + OpenDCP 0.0.25 + + + urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b + video.mxf + VB9LCTmiD9OLlw4SvrEWUm5d67Q= + 26080 + application/mxf + + + urn:uuid:67b9341e-cadd-4dac-9d5c-f5a1d59f2d06 + audio.mxf + HapNpn7MjiJLa1OHRI61Rx8N/is= + 305326 + application/mxf + + + urn:uuid:9892e944-5046-4dbb-af7c-f50742f62fc2 + PbXuvpUOKccTLMxg/lEbaXvNCT4= + 1526 + text/xml + + + -- cgit v1.2.3