X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fpicture_asset_writer.cc;h=3bb6a59782f617a717f6fd9206a022370cbb9317;hb=273fd9a4f1b43ae0de0071e5efd3b6347b166ff1;hp=3ce721fd1f8df3942c0eda8c055cc1f3e372b22c;hpb=4b9ef52067dc34489f9f3a424337f706ed11a00b;p=libdcp.git diff --git a/src/picture_asset_writer.cc b/src/picture_asset_writer.cc index 3ce721fd..3bb6a597 100644 --- a/src/picture_asset_writer.cc +++ b/src/picture_asset_writer.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2013 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington 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 @@ -17,55 +17,25 @@ */ -#include -#include -#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 +#include 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); }