summaryrefslogtreecommitdiff
path: root/src/picture_asset_writer.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-05 00:05:32 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-05 14:36:27 +0100
commitfe99eae4b95c5fcf2f3730efad4a18d0cb5c29bc (patch)
tree265ca14896f63eeff210d602c5f11ed19d800ebf /src/picture_asset_writer.h
parent7b717db244554300ebed8eade8421ee3faa28d33 (diff)
MXF -> Asset in lots of places.
Diffstat (limited to 'src/picture_asset_writer.h')
-rw-r--r--src/picture_asset_writer.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/picture_asset_writer.h b/src/picture_asset_writer.h
new file mode 100644
index 00000000..48832e43
--- /dev/null
+++ b/src/picture_asset_writer.h
@@ -0,0 +1,84 @@
+/*
+ Copyright (C) 2012-2014 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.
+
+*/
+
+/** @file src/picture_asset_writer.h
+ * @brief PictureAssetWriter and FrameInfo classes.
+ */
+
+#ifndef LIBDCP_PICTURE_ASSET_WRITER_H
+#define LIBDCP_PICTURE_ASSET_WRITER_H
+
+#include "metadata.h"
+#include "types.h"
+#include "asset_writer.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
+#include <stdint.h>
+#include <string>
+#include <fstream>
+
+namespace dcp {
+
+class PictureAsset;
+
+/** @class FrameInfo
+ * @brief Information about a single frame (either a monoscopic frame or a left *or* right eye stereoscopic frame)
+ */
+struct FrameInfo
+{
+ FrameInfo ()
+ : offset (0)
+ , size (0)
+ {}
+
+ FrameInfo (uint64_t o, uint64_t s, std::string h)
+ : offset (o)
+ , size (s)
+ , hash (h)
+ {}
+
+ uint64_t offset;
+ uint64_t size;
+ std::string hash;
+};
+
+/** @class PictureAssetWriter
+ * @brief Parent class for classes which write picture assets.
+ */
+class PictureAssetWriter : public AssetWriter
+{
+public:
+ virtual FrameInfo write (uint8_t *, int) = 0;
+ virtual void fake_write (int) = 0;
+
+protected:
+ template <class P, class Q>
+ friend void start (PictureAssetWriter *, boost::shared_ptr<P>, Standard, Q *, uint8_t *, int);
+
+ PictureAssetWriter (PictureAsset *, boost::filesystem::path, Standard standard, bool);
+
+ PictureAsset* _picture_asset;
+ bool _started;
+ Standard _standard;
+ bool _overwrite;
+};
+
+}
+
+#endif