Try to fix build on OS X.
[libdcp.git] / src / picture_asset_writer.cc
index 3ce721fd1f8df3942c0eda8c055cc1f3e372b22c..3bb6a59782f617a717f6fd9206a022370cbb9317 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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);
 }