*/
+#ifndef LIBDCP_PICTURE_ASSET_H
+#define LIBDCP_PICTURE_ASSET_H
+
/** @file src/picture_asset.h
* @brief An asset made up of JPEG2000 files
*/
class MonoPictureAsset;
+struct FrameInfo
+{
+ FrameInfo (uint64_t o, uint64_t s, std::string h)
+ : offset (o)
+ , size (s)
+ , hash (h)
+ {}
+
+ FrameInfo (std::istream& s);
+
+ void write (std::ostream& s);
+
+ uint64_t offset;
+ uint64_t size;
+ std::string hash;
+};
+
/** A helper class for writing to MonoPictureAssets progressively (i.e. writing frame-by-frame,
* rather than giving libdcp all the frames in one go).
*
public:
~MonoPictureAssetWriter ();
- void write (uint8_t* data, int size);
+ FrameInfo write (uint8_t* data, int size);
+ void fake_write (int size);
void finalize ();
private:
friend class MonoPictureAsset;
- MonoPictureAssetWriter (MonoPictureAsset *);
+ MonoPictureAssetWriter (MonoPictureAsset *, bool);
+ void start (uint8_t *, int);
/* no copy construction */
MonoPictureAssetWriter (MonoPictureAssetWriter const &);
MonoPictureAsset* _asset;
/** Number of picture frames written to the asset so far */
int _frames_written;
+ bool _started;
/** true if finalize() has been called */
bool _finalized;
+ bool _overwrite;
};
/** A 2D (monoscopic) picture asset */
MonoPictureAsset (std::string directory, std::string mxf_name, int fps, Size size);
/** Start a progressive write to a MonoPictureAsset */
- boost::shared_ptr<MonoPictureAssetWriter> start_write ();
+ boost::shared_ptr<MonoPictureAssetWriter> start_write (bool);
boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;
}
+
+#endif