/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+ 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
*/
-#include <inttypes.h>
-#include <stdint.h>
-#include "AS_DCP.h"
#include "KM_fileio.h"
#include "picture_asset_writer.h"
#include "exceptions.h"
#include "picture_asset.h"
+#include "AS_DCP.h"
+#include <inttypes.h>
+#include <stdint.h>
using std::istream;
using std::ostream;
using std::string;
using boost::shared_ptr;
-using namespace libdcp;
-
-FrameInfo::FrameInfo (istream& s)
- : offset (0)
- , size (0)
-{
- s >> offset >> size;
+using namespace dcp;
- if (!s.good ()) {
- /* Make sure we zero these if something bad happened, otherwise
- the caller might try to alloc lots of RAM.
- */
- offset = size = 0;
- }
-
- s >> hash;
-}
-
-void
-FrameInfo::write (ostream& s) const
-{
- s << offset << " " << size << " " << hash;
-}
-
-void
-FrameInfo::write (FILE* f) const
-{
- fprintf (f, "%" PRId64 " %" PRId64 " %s", offset, size, hash.c_str ());
-}
-
-
-PictureAssetWriter::PictureAssetWriter (PictureAsset* asset, bool overwrite)
- : _asset (asset)
- , _frames_written (0)
- , _started (false)
- , _finalized (false)
+PictureAssetWriter::PictureAssetWriter (PictureAsset* asset, boost::filesystem::path file, Standard standard, bool overwrite)
+ : AssetWriter (asset, file)
+ , _picture_asset (asset)
+ , _standard (standard)
, _overwrite (overwrite)
{
-
+ asset->set_file (file);
}