summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-17 17:53:08 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-17 17:53:08 +0100
commit22c2111406075c98a2bf5feeaa92fa16293bc15a (patch)
treea8770a0449205e4023d66aef91b674ccbf123343
parentb6718fb437f242fd5127194d4c94e39d71c5e1ad (diff)
Some comments.
-rw-r--r--TODO1
-rw-r--r--src/picture_asset.cc14
-rw-r--r--src/picture_asset.h3
-rw-r--r--src/sound_asset.cc12
-rw-r--r--src/sound_asset.h1
-rw-r--r--src/tags.cc2
-rw-r--r--src/tags.h7
-rw-r--r--test/ref/DCP/9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml39
-rw-r--r--test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml30
9 files changed, 107 insertions, 2 deletions
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<string> 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<string> 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<string> 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<string> const & files, string p, int fps, int len)
: Asset (p, fps, len)
{
@@ -116,6 +124,10 @@ SoundAsset::SoundAsset (list<string> 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL">
+ <Id>urn:uuid:9892e944-5046-4dbb-af7c-f50742f62fc2</Id>
+ <AnnotationText>A Test DCP</AnnotationText>
+ <IssueDate>2012-07-17T04:45:18+00:00</IssueDate>
+ <Creator>OpenDCP 0.0.25</Creator>
+ <ContentTitleText>A Test DCP</ContentTitleText>
+ <ContentKind>feature</ContentKind>
+ <ContentVersion>
+ <Id>urn:uri:9892e944-5046-4dbb-af7c-f50742f62fc2_2012-07-17T04:45:18+00:00</Id>
+ <LabelText>9892e944-5046-4dbb-af7c-f50742f62fc2_2012-07-17T04:45:18+00:00</LabelText>
+ </ContentVersion>
+ <RatingList/>
+ <ReelList>
+ <Reel>
+ <Id>urn:uuid:379fa64c-ad71-46cf-bef7-b45624006610</Id>
+ <AssetList>
+ <MainPicture>
+ <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
+ <AnnotationText>video.mxf</AnnotationText>
+ <EditRate>24 1</EditRate>
+ <IntrinsicDuration>24</IntrinsicDuration>
+ <EntryPoint>0</EntryPoint>
+ <Duration>24</Duration>
+ <FrameRate>24 1</FrameRate>
+ <ScreenAspectRatio>32 32</ScreenAspectRatio>
+ </MainPicture>
+ <MainSound>
+ <Id>urn:uuid:67b9341e-cadd-4dac-9d5c-f5a1d59f2d06</Id>
+ <AnnotationText>audio.mxf</AnnotationText>
+ <EditRate>24 1</EditRate>
+ <IntrinsicDuration>24</IntrinsicDuration>
+ <EntryPoint>0</EntryPoint>
+ <Duration>24</Duration>
+ </MainSound>
+ </AssetList>
+ </Reel>
+ </ReelList>
+</CompositionPlaylist>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL">
+ <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id>
+ <AnnotationText>A Test DCP</AnnotationText>
+ <IssueDate>2012-07-17T04:45:18+00:00</IssueDate>
+ <Issuer>OpenDCP 0.0.25</Issuer>
+ <Creator>OpenDCP 0.0.25</Creator>
+ <AssetList>
+ <Asset>
+ <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
+ <AnnotationText>video.mxf</AnnotationText>
+ <Hash>VB9LCTmiD9OLlw4SvrEWUm5d67Q=</Hash>
+ <Size>26080</Size>
+ <Type>application/mxf</Type>
+ </Asset>
+ <Asset>
+ <Id>urn:uuid:67b9341e-cadd-4dac-9d5c-f5a1d59f2d06</Id>
+ <AnnotationText>audio.mxf</AnnotationText>
+ <Hash>HapNpn7MjiJLa1OHRI61Rx8N/is=</Hash>
+ <Size>305326</Size>
+ <Type>application/mxf</Type>
+ </Asset>
+ <Asset>
+ <Id>urn:uuid:9892e944-5046-4dbb-af7c-f50742f62fc2</Id>
+ <Hash>PbXuvpUOKccTLMxg/lEbaXvNCT4=</Hash>
+ <Size>1526</Size>
+ <Type>text/xml</Type>
+ </Asset>
+ </AssetList>
+</PackingList>