2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "compose.hpp"
25 #include "dcp_video.h"
26 #include "dcp_content_type.h"
27 #include "audio_mapping.h"
31 #include "audio_buffers.h"
32 #include "md5_digester.h"
37 #include <dcp/mono_picture_asset.h>
38 #include <dcp/stereo_picture_asset.h>
39 #include <dcp/sound_asset.h>
40 #include <dcp/sound_asset_writer.h>
42 #include <dcp/reel_mono_picture_asset.h>
43 #include <dcp/reel_stereo_picture_asset.h>
44 #include <dcp/reel_sound_asset.h>
45 #include <dcp/reel_subtitle_asset.h>
48 #include <dcp/certificate_chain.h>
49 #include <dcp/interop_subtitle_asset.h>
50 #include <dcp/smpte_subtitle_asset.h>
51 #include <boost/foreach.hpp>
58 #define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
59 #define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
60 #define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_DEBUG_ENCODE);
61 #define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING);
62 #define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING);
63 #define LOG_WARNING(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_WARNING);
64 #define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR);
66 /* OS X strikes again */
74 using boost::shared_ptr;
75 using boost::weak_ptr;
76 using boost::dynamic_pointer_cast;
78 int const Writer::_info_size = 48;
80 Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
83 , _first_nonexistant_frame (0)
86 , _queued_full_in_memory (0)
87 , _last_written_frame (-1)
88 , _last_written_eyes (EYES_RIGHT)
89 , _maximum_frames_in_memory (0)
95 /* Remove any old DCP */
96 boost::filesystem::remove_all (_film->dir (_film->dcp_name ()));
98 shared_ptr<Job> job = _job.lock ();
99 DCPOMATIC_ASSERT (job);
101 /* Create our picture asset in a subdirectory, named according to those
102 film's parameters which affect the video output. We will hard-link
103 it into the DCP later.
106 if (_film->three_d ()) {
107 _picture_asset.reset (new dcp::StereoPictureAsset (dcp::Fraction (_film->video_frame_rate (), 1)));
109 _picture_asset.reset (new dcp::MonoPictureAsset (dcp::Fraction (_film->video_frame_rate (), 1)));
112 _picture_asset->set_size (_film->frame_size ());
114 if (_film->encrypted ()) {
115 _picture_asset->set_key (_film->key ());
118 _picture_asset->set_file (
119 _film->internal_video_asset_dir() / _film->internal_video_asset_filename()
122 job->sub (_("Checking existing image data"));
123 check_existing_picture_asset ();
125 _picture_asset_writer = _picture_asset->start_write (
126 _film->internal_video_asset_dir() / _film->internal_video_asset_filename(),
127 _film->interop() ? dcp::INTEROP : dcp::SMPTE,
128 _first_nonexistant_frame > 0
131 if (_film->audio_channels ()) {
133 new dcp::SoundAsset (dcp::Fraction (_film->video_frame_rate(), 1), _film->audio_frame_rate (), _film->audio_channels ())
136 if (_film->encrypted ()) {
137 _sound_asset->set_key (_film->key ());
140 /* Write the sound asset into the film directory so that we leave the creation
141 of the DCP directory until the last minute.
143 _sound_asset_writer = _sound_asset->start_write (
144 _film->directory() / audio_asset_filename (_sound_asset),
145 _film->interop() ? dcp::INTEROP : dcp::SMPTE
149 /* Check that the signer is OK if we need one */
150 if (_film->is_signed() && !Config::instance()->signer_chain()->valid ()) {
151 throw InvalidSignerError ();
154 job->sub (_("Encoding image data"));
160 _thread = new boost::thread (boost::bind (&Writer::thread, this));
165 terminate_thread (false);
169 Writer::write (Data encoded, int frame, Eyes eyes)
171 boost::mutex::scoped_lock lock (_state_mutex);
173 while (_queued_full_in_memory > _maximum_frames_in_memory) {
174 /* The queue is too big; wait until that is sorted out */
175 _full_condition.wait (lock);
179 qi.type = QueueItem::FULL;
180 qi.encoded = encoded;
183 if (_film->three_d() && eyes == EYES_BOTH) {
184 /* 2D material in a 3D DCP; fake the 3D */
186 _queue.push_back (qi);
187 ++_queued_full_in_memory;
188 qi.eyes = EYES_RIGHT;
189 _queue.push_back (qi);
190 ++_queued_full_in_memory;
193 _queue.push_back (qi);
194 ++_queued_full_in_memory;
197 /* Now there's something to do: wake anything wait()ing on _empty_condition */
198 _empty_condition.notify_all ();
202 Writer::repeat (int frame, Eyes eyes)
204 boost::mutex::scoped_lock lock (_state_mutex);
206 while (_queued_full_in_memory > _maximum_frames_in_memory) {
207 /* The queue is too big; wait until that is sorted out */
208 _full_condition.wait (lock);
212 qi.type = QueueItem::REPEAT;
214 if (_film->three_d() && eyes == EYES_BOTH) {
216 _queue.push_back (qi);
217 qi.eyes = EYES_RIGHT;
218 _queue.push_back (qi);
221 _queue.push_back (qi);
224 /* Now there's something to do: wake anything wait()ing on _empty_condition */
225 _empty_condition.notify_all ();
229 Writer::fake_write (int frame, Eyes eyes)
231 boost::mutex::scoped_lock lock (_state_mutex);
233 while (_queued_full_in_memory > _maximum_frames_in_memory) {
234 /* The queue is too big; wait until that is sorted out */
235 _full_condition.wait (lock);
238 FILE* file = fopen_boost (_film->info_file (), "rb");
240 throw ReadFileError (_film->info_file ());
242 dcp::FrameInfo info = read_frame_info (file, frame, eyes);
246 qi.type = QueueItem::FAKE;
249 if (_film->three_d() && eyes == EYES_BOTH) {
251 _queue.push_back (qi);
252 qi.eyes = EYES_RIGHT;
253 _queue.push_back (qi);
256 _queue.push_back (qi);
259 /* Now there's something to do: wake anything wait()ing on _empty_condition */
260 _empty_condition.notify_all ();
263 /** This method is not thread safe */
265 Writer::write (shared_ptr<const AudioBuffers> audio)
267 if (_sound_asset_writer) {
268 _sound_asset_writer->write (audio->data(), audio->frames());
272 /** This must be called from Writer::thread() with an appropriate lock held */
274 Writer::have_sequenced_image_at_queue_head ()
276 if (_queue.empty ()) {
282 /* The queue should contain only EYES_LEFT/EYES_RIGHT pairs or EYES_BOTH */
284 if (_queue.front().eyes == EYES_BOTH) {
286 return _queue.front().frame == (_last_written_frame + 1);
291 if (_last_written_eyes == EYES_LEFT && _queue.front().frame == _last_written_frame && _queue.front().eyes == EYES_RIGHT) {
295 if (_last_written_eyes == EYES_RIGHT && _queue.front().frame == (_last_written_frame + 1) && _queue.front().eyes == EYES_LEFT) {
303 Writer::write_frame_info (int frame, Eyes eyes, dcp::FrameInfo info) const
306 if (boost::filesystem::exists (_film->info_file ())) {
307 file = fopen_boost (_film->info_file(), "r+b");
309 file = fopen_boost (_film->info_file(), "wb");
312 throw OpenFileError (_film->info_file ());
314 dcpomatic_fseek (file, frame_info_position (frame, eyes), SEEK_SET);
315 fwrite (&info.offset, sizeof (info.offset), 1, file);
316 fwrite (&info.size, sizeof (info.size), 1, file);
317 fwrite (info.hash.c_str(), 1, info.hash.size(), file);
327 boost::mutex::scoped_lock lock (_state_mutex);
331 if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) {
332 /* We've got something to do: go and do it */
336 /* Nothing to do: wait until something happens which may indicate that we do */
337 LOG_TIMING (N_("writer-sleep queue=%1"), _queue.size());
338 _empty_condition.wait (lock);
339 LOG_TIMING (N_("writer-wake queue=%1"), _queue.size());
342 if (_finish && _queue.empty()) {
346 /* We stop here if we have been asked to finish, and if either the queue
347 is empty or we do not have a sequenced image at its head (if this is the
348 case we will never terminate as no new frames will be sent once
351 if (_finish && (!have_sequenced_image_at_queue_head() || _queue.empty())) {
352 /* (Hopefully temporarily) log anything that was not written */
353 if (!_queue.empty() && !have_sequenced_image_at_queue_head()) {
354 LOG_WARNING (N_("Finishing writer with a left-over queue of %1:"), _queue.size());
355 for (list<QueueItem>::const_iterator i = _queue.begin(); i != _queue.end(); ++i) {
356 if (i->type == QueueItem::FULL) {
357 LOG_WARNING (N_("- type FULL, frame %1, eyes %2"), i->frame, i->eyes);
359 LOG_WARNING (N_("- type FAKE, size %1, frame %2, eyes %3"), i->size, i->frame, i->eyes);
362 LOG_WARNING (N_("Last written frame %1, last written eyes %2"), _last_written_frame, _last_written_eyes);
366 /* Write any frames that we can write; i.e. those that are in sequence. */
367 while (have_sequenced_image_at_queue_head ()) {
368 QueueItem qi = _queue.front ();
370 if (qi.type == QueueItem::FULL && qi.encoded) {
371 --_queued_full_in_memory;
376 case QueueItem::FULL:
378 LOG_DEBUG_ENCODE (N_("Writer FULL-writes %1 (%2)"), qi.frame, qi.eyes);
380 qi.encoded = Data (_film->j2c_path (qi.frame, qi.eyes, false));
383 dcp::FrameInfo fin = _picture_asset_writer->write (qi.encoded->data().get (), qi.encoded->size());
384 write_frame_info (qi.frame, qi.eyes, fin);
385 _last_written[qi.eyes] = qi.encoded;
389 case QueueItem::FAKE:
390 LOG_DEBUG_ENCODE (N_("Writer FAKE-writes %1"), qi.frame);
391 _picture_asset_writer->fake_write (qi.size);
392 _last_written[qi.eyes].reset ();
395 case QueueItem::REPEAT:
396 LOG_DEBUG_ENCODE (N_("Writer REPEAT-writes %1"), qi.frame);
397 dcp::FrameInfo fin = _picture_asset_writer->write (
398 _last_written[qi.eyes]->data().get(),
399 _last_written[qi.eyes]->size()
401 write_frame_info (qi.frame, qi.eyes, fin);
407 _last_written_frame = qi.frame;
408 _last_written_eyes = qi.eyes;
410 shared_ptr<Job> job = _job.lock ();
411 DCPOMATIC_ASSERT (job);
412 int64_t total = _film->length().frames_round (_film->video_frame_rate ());
413 if (_film->three_d ()) {
414 /* _full_written and so on are incremented for each eye, so we need to double the total
415 frames to get the correct progress.
420 job->set_progress (float (_full_written + _fake_written + _repeat_written) / total);
424 while (_queued_full_in_memory > _maximum_frames_in_memory) {
425 /* Too many frames in memory which can't yet be written to the stream.
426 Write some FULL frames to disk.
429 /* Find one from the back of the queue */
431 list<QueueItem>::reverse_iterator i = _queue.rbegin ();
432 while (i != _queue.rend() && (i->type != QueueItem::FULL || !i->encoded)) {
436 DCPOMATIC_ASSERT (i != _queue.rend());
440 /* i is valid here, even though we don't hold a lock on the mutex,
441 since list iterators are unaffected by insertion and only this
442 thread could erase the last item in the list.
446 "Writer full (awaiting %1 [last eye was %2]); pushes %3 to disk",
447 _last_written_frame + 1,
448 _last_written_eyes, i->frame
451 i->encoded->write_via_temp (_film->j2c_path (i->frame, i->eyes, true), _film->j2c_path (i->frame, i->eyes, false));
455 --_queued_full_in_memory;
458 /* The queue has probably just gone down a bit; notify anything wait()ing on _full_condition */
459 _full_condition.notify_all ();
468 Writer::terminate_thread (bool can_throw)
470 boost::mutex::scoped_lock lock (_state_mutex);
476 _empty_condition.notify_all ();
477 _full_condition.notify_all ();
480 DCPOMATIC_ASSERT (_thread->joinable ());
497 terminate_thread (true);
499 if (!_picture_asset_writer->finalize ()) {
500 /* Nothing was written to the picture asset */
501 _picture_asset.reset ();
504 if (_sound_asset_writer) {
505 if (!_sound_asset_writer->finalize ()) {
506 /* Nothing was written to the sound asset */
507 _sound_asset.reset ();
511 /* Hard-link any video asset file into the DCP */
512 if (_picture_asset) {
513 boost::filesystem::path video_from = _picture_asset->file ();
514 boost::filesystem::path video_to;
515 video_to /= _film->dir (_film->dcp_name());
516 video_to /= video_asset_filename (_picture_asset);
518 boost::system::error_code ec;
519 boost::filesystem::create_hard_link (video_from, video_to, ec);
521 LOG_WARNING_NC ("Hard-link failed; copying instead");
522 boost::filesystem::copy_file (video_from, video_to, ec);
524 LOG_ERROR ("Failed to copy video file from %1 to %2 (%3)", video_from.string(), video_to.string(), ec.message ());
525 throw FileError (ec.message(), video_from);
529 _picture_asset->set_file (video_to);
532 /* Move the audio asset into the DCP */
534 boost::filesystem::path audio_to;
535 audio_to /= _film->dir (_film->dcp_name ());
536 audio_to /= audio_asset_filename (_sound_asset);
538 boost::system::error_code ec;
539 boost::filesystem::rename (_film->file (audio_asset_filename (_sound_asset)), audio_to, ec);
542 String::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), audio_asset_filename (_sound_asset)
546 _sound_asset->set_file (audio_to);
549 dcp::DCP dcp (_film->dir (_film->dcp_name()));
551 shared_ptr<dcp::CPL> cpl (
554 _film->dcp_content_type()->libdcp_kind ()
560 shared_ptr<dcp::Reel> reel (new dcp::Reel ());
562 shared_ptr<dcp::ReelPictureAsset> reel_picture_asset;
564 if (_picture_asset) {
565 /* We have made a picture asset of our own. Put it into the reel */
566 shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (_picture_asset);
568 reel_picture_asset.reset (new dcp::ReelMonoPictureAsset (mono, 0));
571 shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (_picture_asset);
572 if (stereo && boost::filesystem::exists (stereo->file ())) {
573 reel_picture_asset.reset (new dcp::ReelStereoPictureAsset (stereo, 0));
576 /* We don't have a picture asset of our own; maybe we need to reference one */
577 /* XXX: this is all a hack */
578 BOOST_FOREACH (shared_ptr<dcp::ReelAsset> i, _reel_assets) {
579 shared_ptr<dcp::ReelPictureAsset> j = dynamic_pointer_cast<dcp::ReelPictureAsset> (i);
581 reel_picture_asset = j;
586 reel->add (reel_picture_asset);
589 /* We have made a sound asset of our own. Put it into the reel */
590 reel->add (shared_ptr<dcp::ReelSoundAsset> (new dcp::ReelSoundAsset (_sound_asset, 0)));
592 /* We don't have a sound asset of our own; maybe we need to reference one */
593 /* XXX: this is all a hack */
594 BOOST_FOREACH (shared_ptr<dcp::ReelAsset> i, _reel_assets) {
595 if (dynamic_pointer_cast<dcp::ReelSoundAsset> (i)) {
601 if (_subtitle_asset) {
602 boost::filesystem::path liberation;
604 liberation = shared_path () / "LiberationSans-Regular.ttf";
605 } catch (boost::filesystem::filesystem_error& e) {
606 /* Hack: try the debian/ubuntu location if getting the shared path failed */
607 liberation = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
610 /* Add all the fonts to the subtitle content */
611 BOOST_FOREACH (shared_ptr<Font> i, _fonts) {
612 _subtitle_asset->add_font (i->id(), i->file().get_value_or (liberation));
615 if (dynamic_pointer_cast<dcp::InteropSubtitleAsset> (_subtitle_asset)) {
616 boost::filesystem::path directory = _film->dir (_film->dcp_name ()) / _subtitle_asset->id ();
617 boost::filesystem::create_directories (directory);
618 _subtitle_asset->write (directory / ("sub_" + _subtitle_asset->id() + ".xml"));
620 /* All our assets should be the same length; use the picture asset length here
621 as a reference to set the subtitle one.
623 dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(_subtitle_asset)->set_intrinsic_duration (
624 reel_picture_asset->intrinsic_duration ()
627 _subtitle_asset->write (
628 _film->dir (_film->dcp_name ()) / ("sub_" + _subtitle_asset->id() + ".mxf")
632 reel->add (shared_ptr<dcp::ReelSubtitleAsset> (
633 new dcp::ReelSubtitleAsset (
635 dcp::Fraction (_film->video_frame_rate(), 1),
636 reel_picture_asset->intrinsic_duration (),
641 /* We don't have a subtitle asset of our own; maybe we need to reference one */
642 /* XXX: this is all a hack */
643 BOOST_FOREACH (shared_ptr<dcp::ReelAsset> i, _reel_assets) {
644 if (dynamic_pointer_cast<dcp::ReelSubtitleAsset> (i)) {
652 shared_ptr<Job> job = _job.lock ();
653 DCPOMATIC_ASSERT (job);
655 job->sub (_("Computing image digest"));
656 if (_picture_asset) {
657 _picture_asset->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
661 job->sub (_("Computing audio digest"));
662 _sound_asset->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
665 dcp::XMLMetadata meta;
666 meta.creator = Config::instance()->dcp_creator ();
667 if (meta.creator.empty ()) {
668 meta.creator = String::compose ("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
670 meta.issuer = Config::instance()->dcp_issuer ();
671 if (meta.issuer.empty ()) {
672 meta.issuer = String::compose ("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
674 meta.set_issue_date_now ();
676 cpl->set_metadata (meta);
678 shared_ptr<const dcp::CertificateChain> signer;
679 if (_film->is_signed ()) {
680 signer = Config::instance()->signer_chain ();
681 /* We did check earlier, but check again here to be on the safe side */
682 if (!signer->valid ()) {
683 throw InvalidSignerError ();
687 dcp.write_xml (_film->interop () ? dcp::INTEROP : dcp::SMPTE, meta, signer);
690 N_("Wrote %1 FULL, %2 FAKE, %3 REPEAT, %4 pushed to disk"), _full_written, _fake_written, _repeat_written, _pushed_to_disk
695 Writer::check_existing_picture_asset ()
697 /* Try to open the existing asset */
698 FILE* asset_file = fopen_boost (_picture_asset->file(), "rb");
700 LOG_GENERAL ("Could not open existing asset at %1 (errno=%2)", _picture_asset->file().string(), errno);
704 /* Offset of the last dcp::FrameInfo in the info file */
705 int const n = (boost::filesystem::file_size (_film->info_file ()) / _info_size) - 1;
707 FILE* info_file = fopen_boost (_film->info_file (), "rb");
709 LOG_GENERAL_NC ("Could not open film info file");
714 if (_film->three_d ()) {
715 /* Start looking at the last left frame */
716 _first_nonexistant_frame = n / 2;
718 _first_nonexistant_frame = n;
724 /* Read the data from the info file; for 3D we just check the left
725 frames until we find a good one.
727 dcp::FrameInfo info = read_frame_info (info_file, _first_nonexistant_frame, _film->three_d () ? EYES_LEFT : EYES_BOTH);
731 /* Read the data from the asset and hash it */
732 dcpomatic_fseek (asset_file, info.offset, SEEK_SET);
733 Data data (info.size);
734 size_t const read = fread (data.data().get(), 1, data.size(), asset_file);
735 if (read != static_cast<size_t> (data.size ())) {
736 LOG_GENERAL ("Existing frame %1 is incomplete", _first_nonexistant_frame);
739 MD5Digester digester;
740 digester.add (data.data().get(), data.size());
741 if (digester.get() != info.hash) {
742 LOG_GENERAL ("Existing frame %1 failed hash check", _first_nonexistant_frame);
748 --_first_nonexistant_frame;
752 if (!_film->three_d ()) {
753 /* If we are doing 3D we might have found a good L frame with no R, so only
754 do this if we're in 2D and we've just found a good B(oth) frame.
756 ++_first_nonexistant_frame;
763 /** @param frame Frame index.
764 * @return true if we can fake-write this frame.
767 Writer::can_fake_write (int frame) const
769 /* We have to do a proper write of the first frame so that we can set up the JPEG2000
770 parameters in the asset writer.
772 return (frame != 0 && frame < _first_nonexistant_frame);
776 Writer::write (PlayerSubtitles subs)
778 if (subs.text.empty ()) {
782 if (!_subtitle_asset) {
783 string lang = _film->subtitle_language ();
787 if (_film->interop ()) {
788 shared_ptr<dcp::InteropSubtitleAsset> s (new dcp::InteropSubtitleAsset ());
789 s->set_movie_title (_film->name ());
790 s->set_language (lang);
791 s->set_reel_number ("1");
794 shared_ptr<dcp::SMPTESubtitleAsset> s (new dcp::SMPTESubtitleAsset ());
795 s->set_content_title_text (_film->name ());
796 s->set_language (lang);
797 s->set_edit_rate (dcp::Fraction (_film->video_frame_rate (), 1));
798 s->set_reel_number (1);
799 s->set_time_code_rate (_film->video_frame_rate ());
800 s->set_start_time (dcp::Time ());
805 for (list<dcp::SubtitleString>::const_iterator i = subs.text.begin(); i != subs.text.end(); ++i) {
806 _subtitle_asset->add (*i);
811 Writer::write (list<shared_ptr<Font> > fonts)
813 /* Just keep a list of fonts and we'll deal with them in ::finish */
814 copy (fonts.begin (), fonts.end (), back_inserter (_fonts));
818 operator< (QueueItem const & a, QueueItem const & b)
820 if (a.frame != b.frame) {
821 return a.frame < b.frame;
824 return static_cast<int> (a.eyes) < static_cast<int> (b.eyes);
828 operator== (QueueItem const & a, QueueItem const & b)
830 return a.frame == b.frame && a.eyes == b.eyes;
834 Writer::set_encoder_threads (int threads)
836 _maximum_frames_in_memory = lrint (threads * 1.1);
840 Writer::frame_info_position (int frame, Eyes eyes) const
844 return frame * _info_size;
846 return frame * _info_size * 2;
848 return frame * _info_size * 2 + _info_size;
850 DCPOMATIC_ASSERT (false);
853 DCPOMATIC_ASSERT (false);
857 Writer::read_frame_info (FILE* file, int frame, Eyes eyes) const
860 dcpomatic_fseek (file, frame_info_position (frame, eyes), SEEK_SET);
861 fread (&info.offset, sizeof (info.offset), 1, file);
862 fread (&info.size, sizeof (info.size), 1, file);
864 char hash_buffer[33];
865 fread (hash_buffer, 1, 32, file);
866 hash_buffer[32] = '\0';
867 info.hash = hash_buffer;
873 Writer::write (shared_ptr<dcp::ReelAsset> asset)
875 _reel_assets.push_back (asset);