summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-03-17 00:26:04 +0000
committerCarl Hetherington <cth@carlh.net>2014-03-17 00:26:04 +0000
commitbfb33feb40c5b014e9eae3958b1ecb8161f1d090 (patch)
treeb191a383b22233c395aabe03f7d8f745a99821fc
parentac265d3d008328b9bdaf00c39ebcd86f263605c7 (diff)
parent6e72e1d36f23a4236c4677f22792a6a4590943a3 (diff)
Merge master.
-rw-r--r--src/mxf.h4
-rw-r--r--src/picture_asset.h107
-rw-r--r--src/signer.cc5
-rw-r--r--src/stereo_picture_frame.h2
-rw-r--r--wscript2
5 files changed, 116 insertions, 4 deletions
diff --git a/src/mxf.h b/src/mxf.h
index 48a1f64e..c5ecd1b7 100644
--- a/src/mxf.h
+++ b/src/mxf.h
@@ -30,6 +30,10 @@ namespace ASDCP {
class AESDecContext;
}
+/* Undefine some stuff that the OS X 10.5 SDK defines */
+#undef Key
+#undef set_key
+
namespace dcp
{
diff --git a/src/picture_asset.h b/src/picture_asset.h
new file mode 100644
index 00000000..b404abd2
--- /dev/null
+++ b/src/picture_asset.h
@@ -0,0 +1,107 @@
+/*
+ Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef LIBDCP_PICTURE_ASSET_H
+#define LIBDCP_PICTURE_ASSET_H
+
+/** @file src/picture_asset.h
+ * @brief An asset made up of JPEG2000 data
+ */
+
+#include <openjpeg.h>
+#include "mxf_asset.h"
+#include "util.h"
+#include "metadata.h"
+
+namespace ASDCP {
+ namespace JP2K {
+ struct PictureDescriptor;
+ }
+}
+
+namespace libdcp
+{
+
+class MonoPictureFrame;
+class StereoPictureFrame;
+class PictureAssetWriter;
+
+/** @brief An asset made up of JPEG2000 data */
+class PictureAsset : public MXFAsset
+{
+public:
+ /** Construct a PictureAsset.
+ *
+ * @param directory Directory where MXF file is.
+ * @param mxf_name Name of MXF file.
+ */
+ PictureAsset (boost::filesystem::path directory, boost::filesystem::path mxf_name);
+
+ /** Start a progressive write to this asset.
+ * The following parameters must be set up (if required) before calling this:
+ * Interop mode (set_interop)
+ * Edit rate (set_edit_rate)
+ * MXF Metadata (set_metadata)
+ *
+ * @param overwrite true to overwrite an existing MXF file; in this mode, writing can be resumed to a partially-written MXF; false if the
+ * MXF file does not exist.
+ */
+ virtual boost::shared_ptr<PictureAssetWriter> start_write (bool overwrite) = 0;
+
+ virtual void read () = 0;
+ virtual void create (std::vector<boost::filesystem::path> const &) {}
+ virtual void create (boost::function<boost::filesystem::path (int)>) {}
+
+ Size size () const {
+ return _size;
+ }
+
+ void set_size (Size s) {
+ _size = s;
+ }
+
+ void write_to_cpl (xmlpp::Element *) const;
+
+protected:
+
+ std::string asdcp_kind () const {
+ return "Picture";
+ }
+
+ bool frame_buffer_equals (
+ int frame, EqualityOptions opt, boost::function<void (NoteType, std::string)> note,
+ uint8_t const * data_A, unsigned int size_A, uint8_t const * data_B, unsigned int size_B
+ ) const;
+
+ bool descriptor_equals (
+ ASDCP::JP2K::PictureDescriptor const & a, ASDCP::JP2K::PictureDescriptor const & b, boost::function<void (NoteType, std::string)>
+ ) const;
+
+ /** picture size in pixels */
+ Size _size;
+
+private:
+ std::string key_type () const;
+ virtual int edit_rate_factor () const = 0;
+};
+
+
+}
+
+#endif
diff --git a/src/signer.cc b/src/signer.cc
index a280cb07..8b3cf31d 100644
--- a/src/signer.cc
+++ b/src/signer.cc
@@ -123,8 +123,9 @@ Signer::add_signature_value (xmlpp::Node* parent, string ns) const
throw MiscError ("could not set key name");
}
- if (xmlSecDSigCtxSign (signature_context, parent->cobj ()) < 0) {
- throw MiscError ("could not sign");
+ int const r = xmlSecDSigCtxSign (signature_context, parent->cobj ());
+ if (r < 0) {
+ throw MiscError (String::compose ("could not sign (%1)", r));
}
xmlSecDSigCtxDestroy (signature_context);
diff --git a/src/stereo_picture_frame.h b/src/stereo_picture_frame.h
index 1fd05453..fe363da5 100644
--- a/src/stereo_picture_frame.h
+++ b/src/stereo_picture_frame.h
@@ -26,7 +26,7 @@
namespace ASDCP {
namespace JP2K {
- class SFrameBuffer;
+ struct SFrameBuffer;
}
class AESDecContext;
}
diff --git a/wscript b/wscript
index a26e357d..a647c62c 100644
--- a/wscript
+++ b/wscript
@@ -29,7 +29,7 @@ def configure(conf):
conf.env.append_value('CXXFLAGS', '-DLIBDCP_POSIX')
if not conf.options.target_osx:
- conf.env.append_value('CXXFLAGS', ['-Wno-unused-result'])
+ conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter'])
conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True)
conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='LIBXML++', mandatory=True)