}
/** Write this data to a J2K file.
- * @param opt Options.
- * @param frame DCP Frame index.
+ * @param Film Film.
+ * @param frame DCP frame index.
*/
void
EncodedData::write (shared_ptr<const Film> film, int frame) const
/* Rename the file from foo.j2c.tmp to foo.j2c now that it is complete */
boost::filesystem::rename (tmp_j2k, real_j2k);
+}
- /* Write a file containing the hash */
+void
+EncodedData::write_hash (shared_ptr<const Film> film, int frame) const
+{
string const hash = film->hash_out_path (frame, false);
ofstream h (hash.c_str());
h << md5_digest (_data, _size) << "\n";
- h.close ();
}
/** Send this data to a socket.
void send (boost::shared_ptr<Socket> socket);
void write (boost::shared_ptr<const Film>, int) const;
+ void write_hash (boost::shared_ptr<const Film>, int) const;
/** @return data */
uint8_t* data () const {
_film->log()->log (String::compose ("Writer writes %1 to MXF", encoded.second));
if (encoded.first) {
_picture_asset_writer->write (encoded.first->data(), encoded.first->size());
+ encoded.first->write_hash (_film, encoded.second);
_last_written = encoded.first;
} else {
_picture_asset_writer->write (_last_written->data(), _last_written->size());
+ _last_written->write_hash (_film, encoded.second);
}
lock.lock ();